Skip to content

Commit 49b0420

Browse files
breadcrumb update
1 parent 07a7794 commit 49b0420

21 files changed

+144
-43
lines changed

gatsby-config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,19 @@ module.exports = {
4040
icon: `src/res/favicon.png`, // This path is relative to the root of the site.
4141
},
4242
},
43+
{
44+
resolve: `gatsby-plugin-breadcrumb`,
45+
options: {
46+
// defaultCrumb: optional To create a default crumb
47+
// see Click Tracking default crumb example below
48+
defaultCrumb: {
49+
location: {
50+
pathname: "/",
51+
},
52+
crumbLabel: "Home",
53+
crumbSeparator: " /",
54+
},
55+
}
56+
},
4357
],
4458
}

package-lock.json

Lines changed: 63 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"author": "William McGonagle <[email protected]>",
77
"dependencies": {
88
"gatsby": "^4.25.1",
9+
"gatsby-plugin-breadcrumb": "^12.3.1",
910
"gatsby-plugin-image": "^2.25.0",
1011
"gatsby-plugin-manifest": "^4.25.0",
1112
"gatsby-plugin-react-svg": "^3.3.0",

src/components/layout.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ import * as React from "react"
99

1010
import Header from "./header"
1111
import Footer from "./footer"
12+
import {Breadcrumb} from 'gatsby-plugin-breadcrumb'
1213

13-
const Layout = ({ children }) => {
14+
const Layout = ({ children,location='',crumbLabel }) => {
1415

1516
return (
1617
<>
1718
<Header />
19+
<Breadcrumb location={location} crumbLabel={crumbLabel} />
1820
<main>{children}</main>
1921
<Footer />
2022
</>

src/components/person.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
import * as React from "react"
2-
import { GatsbyImage } from "gatsby-plugin-image";
2+
import { GatsbyImage } from "gatsby-plugin-image"
33
import { Link } from "gatsby"
4-
function Person({ first, last, photo, biography }) {
54

6-
let slug = `${first}-${last}`.toLowerCase();
7-
let description = biography.split(' ').slice(0, 40).join(' ');
5+
function Person({ first, last, photo, biography, location = "", crumbLabel }) {
6+
let slug = `${first}-${last}`.toLowerCase()
7+
let description = biography.split(" ").slice(0, 40).join(" ")
88

9-
return <Link className="block w-full h-full" to={`/team/${slug}`}>
10-
<div className="rounded shadow p-4 h-full">
11-
<img src={photo} class="rounded-full w-1/2 mb-4" />
12-
<h3 className="text-lg font-bold">{first} {last}</h3>
13-
<p className="text-md">{description || ""}</p>
14-
</div>
9+
return (<>
10+
<Link className="block w-full h-full" to={`/team/${slug}`}>
11+
<div className="rounded shadow p-4 h-full">
12+
<img src={photo} class="rounded-full w-1/2 mb-4" />
13+
<h3 className="text-lg font-bold">
14+
{first} {last}
15+
</h3>
16+
<p className="text-md">{description || ""}</p>
17+
</div>
1518
</Link>
16-
19+
</>
20+
)
1721
}
1822
export default Person

src/pages/accessibility.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import Seo from "../components/seo"
55

66
import Markdown from "../components/markdown"
77

8-
function AccessibilityPage() {
8+
function AccessibilityPage({location}) {
99

1010
const fileData = require('!!raw-loader!../../data/accessibility.txt')
1111

1212
return (
13-
<Layout>
13+
<Layout location={location} crumbLabel="Accessibility">
1414
<section>
1515
<div
1616
class="mx-auto max-w-screen-xl px-4 py-48 lg:flex lg:items-center"

src/pages/contact.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import * as React from "react"
33
import Layout from "../components/layout"
44
import Seo from "../components/seo"
55

6-
function ContactPage() {
6+
function ContactPage({location}) {
77

88
const social = require('../../data/general.json').social
99

1010
return (
11-
<Layout>
11+
<Layout location={location} crumbLabel="Contact">
1212
<section>
1313
<div
1414
class="mx-auto max-w-screen-xl px-4 py-48 lg:flex lg:items-center"

src/pages/documents.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import * as React from "react"
33
import Layout from "../components/layout"
44
import Seo from "../components/seo"
55

6-
function PressPage() {
6+
function PressPage({location}) {
77
const documents = require('../../data/general.json').documents
88

99
return (
10-
<Layout>
10+
<Layout location={location} crumbLabel="Documents">
1111
<section>
1212
<div
1313
class="mx-auto max-w-screen-xl px-4 py-48 lg:flex lg:items-center"

src/pages/faq.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import * as React from "react"
33
import Layout from "../components/layout"
44
import Seo from "../components/seo"
55

6-
function PartnerPage() {
6+
function PartnerPage({location}) {
77
let generalData = require('../../data/general.json')
88
const faq = generalData.faq;
99

1010
return (
11-
<Layout>
11+
<Layout location={location} crumbLabel="FAQs">
1212
<section>
1313
<div
1414
class="mx-auto max-w-screen-xl px-4 py-48 lg:flex lg:items-center"

src/pages/impact.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Link } from "gatsby"
33
import Layout from "../components/layout"
44
import Seo from "../components/seo"
55

6-
function ImpactPage() {
6+
function ImpactPage({location}) {
77
let generalData = require('../../data/general.json')
88
let impactNumber = generalData.impact.adults + generalData.impact.children;
99

@@ -16,7 +16,7 @@ function ImpactPage() {
1616

1717

1818
return (
19-
<Layout>
19+
<Layout location={location} crumbLabel="Impact">
2020
<section>
2121
<div
2222
class="mx-auto max-w-screen-xl px-4 py-48 lg:flex lg:items-center"

0 commit comments

Comments
 (0)