import React, { useEffect } from "react" import { graphql } from "gatsby" import Layout from "../components/layout" import { MDXRenderer } from "gatsby-plugin-mdx" const ide = "https://repos.ctdo.de/-/ide/project/neri/ctdo-hompage/edit/master/-/src/markdown-pages/" export default function Template({ data, // this prop will be injected by the GraphQL query below. }) { const { mdx } = data // data.markdownRemark holds your post data const { frontmatter, body } = mdx useEffect(() => { document.title = frontmatter.title }, [frontmatter.title]) const editLink = frontmatter.edit ? ide + frontmatter.edit : null return ( {body} ) } export const pageQuery = graphql` query($path: String!) { mdx(frontmatter: { path: { eq: $path } }) { body frontmatter { title edit } } } `