sync with pliny dev
This commit is contained in:
+15
-1
@@ -11,7 +11,7 @@ import {
|
||||
remarkCodeTitles,
|
||||
remarkImgToJsx,
|
||||
extractTocHeadings,
|
||||
} from 'pliny/mdx-plugins.js'
|
||||
} from 'pliny/mdx-plugins/index.js'
|
||||
// Rehype packages
|
||||
import rehypeSlug from 'rehype-slug'
|
||||
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
|
||||
@@ -20,6 +20,7 @@ import rehypeCitation from 'rehype-citation'
|
||||
import rehypePrismPlus from 'rehype-prism-plus'
|
||||
import rehypePresetMinify from 'rehype-preset-minify'
|
||||
import siteMetadata from './data/siteMetadata'
|
||||
import { allCoreContent } from 'pliny/utils/contentlayer.js'
|
||||
|
||||
const root = process.cwd()
|
||||
|
||||
@@ -60,6 +61,19 @@ function createTagCount(allBlogs) {
|
||||
writeFileSync('./app/tag-data.json', JSON.stringify(tagCount))
|
||||
}
|
||||
|
||||
function createSearchIndex(allBlogs) {
|
||||
if (
|
||||
siteMetadata?.search?.provider === 'kbar' &&
|
||||
siteMetadata.search.kbarConfig.searchDocumentsPath
|
||||
) {
|
||||
writeFileSync(
|
||||
`public/${siteMetadata.search.kbarConfig.searchDocumentsPath}`,
|
||||
JSON.stringify(allCoreContent(allBlogs))
|
||||
)
|
||||
console.log('Local search index generated...')
|
||||
}
|
||||
}
|
||||
|
||||
export const Blog = defineDocumentType(() => ({
|
||||
name: 'Blog',
|
||||
filePathPattern: 'blog/**/*.mdx',
|
||||
|
||||
Reference in New Issue
Block a user