add edit link to sites

This commit is contained in:
neri 2019-12-14 17:10:54 +01:00
parent 00e71ed59e
commit d52c589ed6
10 changed files with 27 additions and 4 deletions

View File

@ -2,9 +2,19 @@ import React from "react"
import footerStyles from "./footer.module.css"
import { Link } from "gatsby"
export default () => (
export default ({ editLink }) => (
<div className={footerStyles.footer}>
<div className={footerStyles.footerContent}>
{editLink ? (
<a
className={footerStyles.footerItem}
href={editLink}
target="_blank"
rel="noopener noreferrer"
>
Seite bearbeiten
</a>
) : null}
<Link className={footerStyles.footerItem} to="/impressum/">
Impressum
</Link>

View File

@ -3,10 +3,10 @@ import Nav from "../components/nav"
import Footer from "../components/footer"
import layoutStyles from "./layout.module.css"
export default ({ children }) => (
export default ({ editLink, children }) => (
<>
<Nav />
<div className={layoutStyles.layout}>{children}</div>
<Footer />
<Footer editLink={editLink} />
</>
)

View File

@ -1,6 +1,7 @@
---
path: "/datenschutz"
title: "Datenschutzerklärung"
edit: "datenschutz.mdx"
---
## Datenschutzerklärung

View File

@ -1,6 +1,7 @@
---
path: "/events"
title: "Events"
edit: "events.mdx"
---
## Events

View File

@ -1,6 +1,7 @@
---
path: "/"
title: "Home"
edit: "home.mdx"
---
## Wer wir sind

View File

@ -1,6 +1,7 @@
---
path: "/impressum"
title: "Impressum"
edit: "impressum.mdx"
---
## Impressum

View File

@ -1,6 +1,7 @@
---
path: "/kontakt"
title: "Kontakt"
edit: "kontakt.mdx"
---
## Kontakt

View File

@ -1,6 +1,7 @@
---
path: "/treff"
title: "Zeiten & Location"
edit: "treff.mdx"
---
import RoomState from "../components/roomState.js"

View File

@ -1,6 +1,7 @@
---
path: "/verein"
title: "Verein"
edit: "verein.mdx"
---
## Verein

View File

@ -3,6 +3,9 @@ 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.
}) {
@ -13,8 +16,10 @@ export default function Template({
document.title = frontmatter.title
}, [frontmatter.title])
const editLink = frontmatter.edit ? ide + frontmatter.edit : null
return (
<Layout>
<Layout editLink={editLink}>
<MDXRenderer>{body}</MDXRenderer>
</Layout>
)
@ -26,6 +31,7 @@ export const pageQuery = graphql`
body
frontmatter {
title
edit
}
}
}