[site/MDX&slug]: fixes after rebase
This commit is contained in:
parent
2230fa22ec
commit
748df6f46f
|
|
@ -5,6 +5,7 @@ import { YOUTUBE_REGEX } from "../lib/constants";
|
||||||
import siteConfig from "../config/siteConfig";
|
import siteConfig from "../config/siteConfig";
|
||||||
import MdxContent from './MdxContent'
|
import MdxContent from './MdxContent'
|
||||||
import useHeadingsObserver from '../hooks/useHeadingsObserver'
|
import useHeadingsObserver from '../hooks/useHeadingsObserver'
|
||||||
|
// import dynamic from 'next/dynamic'
|
||||||
|
|
||||||
// import { Paragraph } from "./Paragraph";
|
// import { Paragraph } from "./Paragraph";
|
||||||
// import { Anchor } from "./Anchor";
|
// import { Anchor } from "./Anchor";
|
||||||
|
|
@ -15,11 +16,11 @@ import useHeadingsObserver from '../hooks/useHeadingsObserver'
|
||||||
|
|
||||||
// const Paragraph = dynamic(() => import("./Paragraph").then(mod => mod.Paragraph))
|
// const Paragraph = dynamic(() => import("./Paragraph").then(mod => mod.Paragraph))
|
||||||
|
|
||||||
export default function MdxPage({ body, frontMatter, editUrl }) {
|
export default function MdxPage({ body, frontMatter }) {
|
||||||
const observer = useHeadingsObserver();
|
const observer = useHeadingsObserver();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
title, description, date, authors, youtube, podcast, image, _raw
|
title, description, date, keywords, youtube, podcast, image, _raw
|
||||||
} = frontMatter
|
} = frontMatter
|
||||||
|
|
||||||
let youtubeThumnbnail;
|
let youtubeThumnbnail;
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,8 @@ export default function Page({ body, ...meta }) {
|
||||||
created: meta.created === "Invalid Date" ? null : meta.created
|
created: meta.created === "Invalid Date" ? null : meta.created
|
||||||
}
|
}
|
||||||
|
|
||||||
// enable editing content only for claims, concepts, and guide for now
|
|
||||||
const editUrl = ['claims', 'concepts', 'guide'].includes(meta._raw.sourceFileDir)
|
|
||||||
? siteConfig.repoRoot + siteConfig.repoEditPath + meta._raw.sourceFilePath
|
|
||||||
: null
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MdxPage body={body} frontMatter={frontMatter} editUrl={editUrl} />
|
<MdxPage body={body} frontMatter={frontMatter} />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue