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 footerStyles from "./footer.module.css"
|
||||||
import { Link } from "gatsby"
|
import { Link } from "gatsby"
|
||||||
|
|
||||||
export default () => (
|
export default ({ editLink }) => (
|
||||||
<div className={footerStyles.footer}>
|
<div className={footerStyles.footer}>
|
||||||
<div className={footerStyles.footerContent}>
|
<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/">
|
<Link className={footerStyles.footerItem} to="/impressum/">
|
||||||
Impressum
|
Impressum
|
||||||
</Link>
|
</Link>
|
||||||
|
|
|
@ -3,10 +3,10 @@ import Nav from "../components/nav"
|
||||||
import Footer from "../components/footer"
|
import Footer from "../components/footer"
|
||||||
import layoutStyles from "./layout.module.css"
|
import layoutStyles from "./layout.module.css"
|
||||||
|
|
||||||
export default ({ children }) => (
|
export default ({ editLink, children }) => (
|
||||||
<>
|
<>
|
||||||
<Nav />
|
<Nav />
|
||||||
<div className={layoutStyles.layout}>{children}</div>
|
<div className={layoutStyles.layout}>{children}</div>
|
||||||
<Footer />
|
<Footer editLink={editLink} />
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
path: "/datenschutz"
|
path: "/datenschutz"
|
||||||
title: "Datenschutzerklärung"
|
title: "Datenschutzerklärung"
|
||||||
|
edit: "datenschutz.mdx"
|
||||||
---
|
---
|
||||||
|
|
||||||
## Datenschutzerklärung
|
## Datenschutzerklärung
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
path: "/events"
|
path: "/events"
|
||||||
title: "Events"
|
title: "Events"
|
||||||
|
edit: "events.mdx"
|
||||||
---
|
---
|
||||||
|
|
||||||
## Events
|
## Events
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
path: "/"
|
path: "/"
|
||||||
title: "Home"
|
title: "Home"
|
||||||
|
edit: "home.mdx"
|
||||||
---
|
---
|
||||||
|
|
||||||
## Wer wir sind
|
## Wer wir sind
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
path: "/impressum"
|
path: "/impressum"
|
||||||
title: "Impressum"
|
title: "Impressum"
|
||||||
|
edit: "impressum.mdx"
|
||||||
---
|
---
|
||||||
|
|
||||||
## Impressum
|
## Impressum
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
path: "/kontakt"
|
path: "/kontakt"
|
||||||
title: "Kontakt"
|
title: "Kontakt"
|
||||||
|
edit: "kontakt.mdx"
|
||||||
---
|
---
|
||||||
|
|
||||||
## Kontakt
|
## Kontakt
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
path: "/treff"
|
path: "/treff"
|
||||||
title: "Zeiten & Location"
|
title: "Zeiten & Location"
|
||||||
|
edit: "treff.mdx"
|
||||||
---
|
---
|
||||||
import RoomState from "../components/roomState.js"
|
import RoomState from "../components/roomState.js"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
path: "/verein"
|
path: "/verein"
|
||||||
title: "Verein"
|
title: "Verein"
|
||||||
|
edit: "verein.mdx"
|
||||||
---
|
---
|
||||||
|
|
||||||
## Verein
|
## Verein
|
||||||
|
|
|
@ -3,6 +3,9 @@ import { graphql } from "gatsby"
|
||||||
import Layout from "../components/layout"
|
import Layout from "../components/layout"
|
||||||
import { MDXRenderer } from "gatsby-plugin-mdx"
|
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({
|
export default function Template({
|
||||||
data, // this prop will be injected by the GraphQL query below.
|
data, // this prop will be injected by the GraphQL query below.
|
||||||
}) {
|
}) {
|
||||||
|
@ -13,8 +16,10 @@ export default function Template({
|
||||||
document.title = frontmatter.title
|
document.title = frontmatter.title
|
||||||
}, [frontmatter.title])
|
}, [frontmatter.title])
|
||||||
|
|
||||||
|
const editLink = frontmatter.edit ? ide + frontmatter.edit : null
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout editLink={editLink}>
|
||||||
<MDXRenderer>{body}</MDXRenderer>
|
<MDXRenderer>{body}</MDXRenderer>
|
||||||
</Layout>
|
</Layout>
|
||||||
)
|
)
|
||||||
|
@ -26,6 +31,7 @@ export const pageQuery = graphql`
|
||||||
body
|
body
|
||||||
frontmatter {
|
frontmatter {
|
||||||
title
|
title
|
||||||
|
edit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue