add edit link to sites
This commit is contained in:
parent
00e71ed59e
commit
d52c589ed6
|
@ -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>
|
||||
|
|
|
@ -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} />
|
||||
</>
|
||||
)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
path: "/datenschutz"
|
||||
title: "Datenschutzerklärung"
|
||||
edit: "datenschutz.mdx"
|
||||
---
|
||||
|
||||
## Datenschutzerklärung
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
path: "/events"
|
||||
title: "Events"
|
||||
edit: "events.mdx"
|
||||
---
|
||||
|
||||
## Events
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
path: "/"
|
||||
title: "Home"
|
||||
edit: "home.mdx"
|
||||
---
|
||||
|
||||
## Wer wir sind
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
path: "/impressum"
|
||||
title: "Impressum"
|
||||
edit: "impressum.mdx"
|
||||
---
|
||||
|
||||
## Impressum
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
path: "/kontakt"
|
||||
title: "Kontakt"
|
||||
edit: "kontakt.mdx"
|
||||
---
|
||||
|
||||
## Kontakt
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
path: "/treff"
|
||||
title: "Zeiten & Location"
|
||||
edit: "treff.mdx"
|
||||
---
|
||||
import RoomState from "../components/roomState.js"
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
path: "/verein"
|
||||
title: "Verein"
|
||||
edit: "verein.mdx"
|
||||
---
|
||||
|
||||
## Verein
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue