fix page building and linking

This commit is contained in:
neri 2020-07-29 03:12:36 +02:00
parent 23b0a146eb
commit bf71ed2077
12 changed files with 3141 additions and 2487 deletions

View File

@ -11,7 +11,7 @@ module.exports = {
resolve: `gatsby-source-filesystem`,
options: {
name: `pages`,
path: `${__dirname}/src/pages`,
path: `${__dirname}/src/webpages`,
},
},
{

View File

@ -1,22 +1,22 @@
import React from "react"
import navStyles from "./nav.module.css"
import { Link } from "gatsby"
import React from 'react'
import navStyles from './nav.module.css'
import { Link } from 'gatsby'
let pages = [
["home", "/", navStyles.desktopOnly],
["zeiten & location", "treff", ""],
["events", "events", ""],
["über uns", "about", ""],
["kontakt", "kontakt", ""],
["verein", "verein", ""],
["supporte uns", "support", ""],
['home', '/', navStyles.desktopOnly],
['zeiten & location', '/treff', ''],
['events', '/events', ''],
['über uns', '/about', ''],
['kontakt', '/kontakt', ''],
['verein', '/verein', ''],
['supporte uns', '/support', ''],
]
export default ({ path }) => {
// nav items should always be active in the staticly generated html
const isSSR = typeof window === "undefined"
const isSSR = typeof window === 'undefined'
const activeClasses = link =>
isSSR && path === "/" + link ? " " + navStyles.navItemActive : ""
isSSR && path === link ? ' ' + navStyles.navItemActive : ''
return (
<>
@ -36,9 +36,9 @@ export default ({ path }) => {
{pages.map(([title, link, device]) => (
<Link
key={title}
className={navStyles.navItem + activeClasses(link) + " " + device}
className={navStyles.navItem + activeClasses(link) + ' ' + device}
activeClassName={navStyles.navItemActive}
to={`/${link}`}
to={`${link}`}
>
{title}
</Link>

5598
yarn.lock

File diff suppressed because it is too large Load Diff