Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exercise 2 - Make Footer Data Dynamic #5

Open
wants to merge 8 commits into
base: 01_customize-gatsby-site-info
Choose a base branch
from
13 changes: 12 additions & 1 deletion site/src/components/footer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
import React from "react";
import { Link } from "gatsby";
import { useStaticQuery, graphql } from "gatsby";

export default function footer() {
const data = useStaticQuery(graphql`
query FooterQuery {
site {
siteMetadata {
title
}
}
}
`);

return (
<div>
<div className="bg-white ">
Expand All @@ -11,7 +22,7 @@ export default function footer() {
to="/"
className="no-underline text-gray-700 hover:text-gray-500"
>
&copy; SketchXConf 2020
&copy;{data.site.siteMetadata.title}
</Link>
</p>

Expand Down