chore: port faq page to mdx

This commit is contained in:
dfireBird
2020-08-08 16:47:43 +05:30
parent e92c61a963
commit f8101fa439
2 changed files with 6 additions and 6 deletions
+5 -5
View File
@@ -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