try using shaki theme

This commit is contained in:
Jonathan Summers-Muir committed 2022-12-09 01:49:33 +08:00
1 parent 18fd4ef46f
commit 3a009f5395
2 files changed
+3 -8

No files matched your search

+3 -2
View File
@@ -4,7 +4,8 @@ import matter from 'gray-matter'
import { serialize } from 'next-mdx-remote/serialize'
import { remarkCodeHike } from '@code-hike/mdx'
import codeHikeTheme from '~/codeHikeTheme.js'
// import codeHikeTheme from '~/codeHikeTheme.js'
import theme from 'shiki/themes/solarized-dark.json'
async function generateRefMarkdown(sections, slug) {
let markdownContent = []
@@ -45,7 +46,7 @@ async function generateRefMarkdown(sections, slug) {
// MDX's available options, see the MDX docs for more info.
// https://mdxjs.com/packages/mdx/#compilefile-options
mdxOptions: {
remarkPlugins: [[remarkCodeHike, { autoImport: false, codeHikeTheme }]],
remarkPlugins: [[remarkCodeHike, { autoImport: false, theme }]],
useDynamicImport: true,
},
// Indicates whether or not to parse the frontmatter from the mdx source
@@ -7,8 +7,6 @@ import { flattenSections } from '~/lib/helpers'
import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths'
import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps'
import * as shiki from 'shiki'
const sections = flattenSections(clientLibsCommonSections)
export default function JSReference(props) {
@@ -16,10 +14,6 @@ export default function JSReference(props) {
}
export async function getStaticProps({ params }: { params: { slug: string[] } }) {
const forceShiki = await shiki.getHighlighter({
theme: 'github-light',
})
return handleRefStaticProps(sections, params, '/js', '/javascript')
}