mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-05 23:43:37 +02:00
feat: Implement mdx
This commit is contained in:
@@ -9,7 +9,7 @@ import { PageContent } from "../components/PageContent"
|
||||
// @todo maybe find alternative type for data
|
||||
const Archive: FC<any> = ({ data }) => {
|
||||
const { relativePath, ctime } = data.file
|
||||
const { html, excerpt, timeToRead } = data.file.post
|
||||
const { body, excerpt, timeToRead } = data.file.post
|
||||
|
||||
const title = humanize(relativePath)
|
||||
|
||||
@@ -24,7 +24,7 @@ const Archive: FC<any> = ({ data }) => {
|
||||
timeToRead={timeToRead}
|
||||
shifted={false}
|
||||
/>
|
||||
<PageContent content={<Markdown content={html} />} />
|
||||
<PageContent content={<Markdown content={body} />} />
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
@@ -36,8 +36,8 @@ export const query = graphql`
|
||||
file(relativePath: { eq: $file }) {
|
||||
relativePath
|
||||
ctime
|
||||
post: childMarkdownRemark {
|
||||
html
|
||||
post: childMdx {
|
||||
body
|
||||
excerpt
|
||||
timeToRead
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import useSidebar from "../hooks/useSidebar"
|
||||
const ResourceHome: FC<any> = ({ data, pageContext }) => {
|
||||
const { current: language } = useSidebar()
|
||||
const { relativePath } = data.file
|
||||
const { html, excerpt, fields, frontmatter, timeToRead } = data.file.post
|
||||
const { body, excerpt, fields, frontmatter, timeToRead } = data.file.post
|
||||
|
||||
const shiftLayout = Boolean(
|
||||
frontmatter.recommended_reading || frontmatter.external_resources
|
||||
@@ -34,7 +34,7 @@ const ResourceHome: FC<any> = ({ data, pageContext }) => {
|
||||
/>
|
||||
<PageContent
|
||||
content={
|
||||
<ResourcesHomeContent language={pageContext.language} html={html} />
|
||||
<ResourcesHomeContent language={pageContext.language} body={body} />
|
||||
}
|
||||
recommendedReading={frontmatter.recommended_reading}
|
||||
externalResources={frontmatter.external_resources}
|
||||
@@ -53,8 +53,8 @@ export const query = graphql`
|
||||
base: { eq: "intro.md" }
|
||||
) {
|
||||
relativePath
|
||||
post: childMarkdownRemark {
|
||||
html
|
||||
post: childMdx {
|
||||
body
|
||||
excerpt
|
||||
fields {
|
||||
authors {
|
||||
|
||||
@@ -14,7 +14,7 @@ const ResourcePage: FC<any> = ({ data }) => {
|
||||
const { current: language } = useSidebar()
|
||||
const { relativePath } = data.file
|
||||
const {
|
||||
html,
|
||||
body,
|
||||
headings,
|
||||
excerpt,
|
||||
fields,
|
||||
@@ -49,7 +49,7 @@ const ResourcePage: FC<any> = ({ data }) => {
|
||||
<PageContent
|
||||
content={
|
||||
<>
|
||||
<Markdown content={html} />
|
||||
<Markdown content={body} />
|
||||
<Footer />
|
||||
</>
|
||||
}
|
||||
@@ -67,8 +67,8 @@ export const query = graphql`
|
||||
query ResourcePage($file: String!) {
|
||||
file(relativePath: { eq: $file }) {
|
||||
relativePath
|
||||
post: childMarkdownRemark {
|
||||
html
|
||||
post: childMdx {
|
||||
body
|
||||
headings {
|
||||
depth
|
||||
value
|
||||
|
||||
Reference in New Issue
Block a user