feat(fs.dev): Added OG intro for description
This commit is contained in:
parent
d71a8246ac
commit
b59c5036ed
8 changed files with 51 additions and 150 deletions
|
@ -9,6 +9,7 @@ import { compile } from '@mdx-js/mdx'
|
|||
import remarkFrontmatter from 'remark-frontmatter'
|
||||
import remarkGfm from 'remark-gfm'
|
||||
import remarkCopyLinkedFiles from 'remark-copy-linked-files'
|
||||
import { remarkIntroPlugin } from './remark-intro-plugin.mjs'
|
||||
// Rehype plugins we want to use
|
||||
import rehypeHighlight from 'rehype-highlight'
|
||||
|
||||
|
@ -29,6 +30,7 @@ const mdxLoader = async (language, site, slug) => {
|
|||
path.resolve(`../../markdown/${site}/${slug}/${language}.md`),
|
||||
'utf-8'
|
||||
)
|
||||
const intro = []
|
||||
const mdx = String(
|
||||
await compile(md, {
|
||||
outputFormat: 'function-body',
|
||||
|
@ -42,6 +44,10 @@ const mdxLoader = async (language, site, slug) => {
|
|||
sourceDir: path.resolve(`../../markdown/${site}/${slug}`),
|
||||
staticPath: '/mdx/',
|
||||
}
|
||||
],
|
||||
[
|
||||
remarkIntroPlugin,
|
||||
{ intro }
|
||||
]
|
||||
],
|
||||
rehypePlugins: [
|
||||
|
@ -50,7 +56,7 @@ const mdxLoader = async (language, site, slug) => {
|
|||
})
|
||||
)
|
||||
|
||||
return mdx
|
||||
return {mdx, intro}
|
||||
}
|
||||
|
||||
export default mdxLoader
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue