mirror of
https://github.com/BillyOutlast/posthog.com.git
synced 2026-02-04 03:11:21 +01:00
fix copy md (#12790)
This commit is contained in:
@@ -252,10 +252,15 @@ export const onCreateNode: GatsbyNode['onCreateNode'] = async ({
|
||||
|
||||
const contentWithoutFrontmatter = stripFrontmatter(node.rawBody)
|
||||
const contentWithSnippets = resolveSnippets(contentWithoutFrontmatter, node.fileAbsolutePath)
|
||||
|
||||
// Prepend title as H1 if it exists
|
||||
const title = node.frontmatter?.title
|
||||
const contentWithSnippetsAndTitle = title ? `# ${title}\n\n${contentWithSnippets}` : contentWithSnippets
|
||||
|
||||
createNodeField({
|
||||
node,
|
||||
name: `contentWithSnippets`,
|
||||
value: contentWithSnippets,
|
||||
value: contentWithSnippetsAndTitle,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -340,7 +340,7 @@ export default function Handbook({
|
||||
hideRightSidebar,
|
||||
contentMaxWidthClass,
|
||||
},
|
||||
fields: { slug, contributors, appConfig, templateConfigs, commits },
|
||||
fields: { slug, contributors, appConfig, templateConfigs, commits, contentWithSnippets },
|
||||
excerpt,
|
||||
} = post
|
||||
|
||||
@@ -401,6 +401,7 @@ export default function Handbook({
|
||||
showSurvey
|
||||
hideRightSidebar={hideRightSidebar}
|
||||
contentMaxWidthClass={contentMaxWidthClass}
|
||||
markdownContent={contentWithSnippets}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
@@ -435,6 +436,7 @@ export const query = graphql`
|
||||
excerpt(pruneLength: 150)
|
||||
fields {
|
||||
slug
|
||||
contentWithSnippets
|
||||
commits {
|
||||
author {
|
||||
avatar_url
|
||||
|
||||
Reference in New Issue
Block a user