2021-05-15 20:08:57 +00:00
|
|
|
import React from 'react'
|
2020-03-04 00:56:39 +00:00
|
|
|
import { graphql } from 'gatsby'
|
|
|
|
import Layout from '../components/layout'
|
|
|
|
import { MDXRenderer } from 'gatsby-plugin-mdx'
|
|
|
|
import { MDXProvider } from '@mdx-js/react'
|
2021-05-15 20:36:47 +00:00
|
|
|
import { Helmet } from 'react-helmet'
|
2020-03-04 00:56:39 +00:00
|
|
|
|
2021-05-15 20:36:47 +00:00
|
|
|
const MdLeakH1 = (props) => <h2 {...props}># {props.children}</h2>
|
|
|
|
const MdLeakH2 = (props) => <h3 {...props}>## {props.children}</h3>
|
|
|
|
const MdLeakH3 = (props) => <h4 {...props}>### {props.children}</h4>
|
|
|
|
const MdLeakH4 = (props) => <h5 {...props}>#### {props.children}</h5>
|
2020-03-04 00:56:39 +00:00
|
|
|
|
|
|
|
const components = {
|
|
|
|
h1: MdLeakH1,
|
|
|
|
h2: MdLeakH2,
|
|
|
|
h3: MdLeakH3,
|
|
|
|
h4: MdLeakH4,
|
|
|
|
}
|
|
|
|
|
|
|
|
export default function Template({
|
|
|
|
data, // this prop will be injected by the GraphQL query below.
|
|
|
|
}) {
|
|
|
|
const {
|
|
|
|
frontmatter: { title, path },
|
|
|
|
body,
|
|
|
|
} = data.mdx
|
|
|
|
|
|
|
|
return (
|
2021-05-15 20:08:57 +00:00
|
|
|
<>
|
|
|
|
<Helmet
|
|
|
|
htmlAttributes={{
|
|
|
|
lang: 'de',
|
|
|
|
}}
|
|
|
|
title={`ctdo - ${title.toLowerCase()}`}
|
|
|
|
/>
|
|
|
|
<Layout path={path}>
|
|
|
|
<MdLeakH1>{title}</MdLeakH1>
|
|
|
|
<MDXProvider components={components}>
|
|
|
|
<MDXRenderer>{body}</MDXRenderer>
|
|
|
|
</MDXProvider>
|
|
|
|
</Layout>
|
|
|
|
</>
|
2020-03-04 00:56:39 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export const pageQuery = graphql`
|
2021-05-15 20:36:47 +00:00
|
|
|
query ($slug: String!) {
|
2020-03-04 00:56:39 +00:00
|
|
|
mdx(fields: { slug: { eq: $slug } }) {
|
|
|
|
id
|
|
|
|
excerpt(pruneLength: 160)
|
|
|
|
body
|
|
|
|
frontmatter {
|
|
|
|
title
|
|
|
|
date(formatString: "MMMM DD, YYYY")
|
|
|
|
description
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`
|