mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-06 23:43:45 +02:00
chore: port faq page to mdx
This commit is contained in:
+5
-5
@@ -1,7 +1,7 @@
|
||||
import { graphql } from "gatsby"
|
||||
import React, { Fragment } from "react"
|
||||
import cx from "classnames"
|
||||
import { MarkdownRemark } from "../../generated/graphql"
|
||||
import { Mdx } from "../../generated/graphql"
|
||||
import { ComponentQuery } from "../../typings"
|
||||
import { Markdown } from "../components/Markdown"
|
||||
import { SEO } from "../components/SEO"
|
||||
@@ -9,7 +9,7 @@ import { PageContent } from "../components/PageContent"
|
||||
import { HeaderBarebone } from "../components/HeaderBarebone"
|
||||
import { buildToc } from "../utils"
|
||||
|
||||
function FaqPage({ data }: ComponentQuery<{ md: MarkdownRemark }>) {
|
||||
function FaqPage({ data }: ComponentQuery<{ md: Mdx }>) {
|
||||
const { md } = data
|
||||
|
||||
const toc = buildToc(md.headings!)
|
||||
@@ -22,15 +22,15 @@ function FaqPage({ data }: ComponentQuery<{ md: MarkdownRemark }>) {
|
||||
className={cx({ shifted: toc.length })}
|
||||
/>
|
||||
|
||||
<PageContent content={<Markdown content={md.html!} />} toc={toc} />
|
||||
<PageContent content={<Markdown content={md.body!} />} toc={toc} />
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
|
||||
export const query = graphql`
|
||||
query FaqPage {
|
||||
md: markdownRemark(frontmatter: { path: { eq: "/faq" } }) {
|
||||
html
|
||||
md: mdx(frontmatter: { path: { eq: "/faq" } }) {
|
||||
body
|
||||
headings {
|
||||
depth
|
||||
value
|
||||
|
||||
Reference in New Issue
Block a user