From d53c9d7166430dd872d5420606f1d2349707add8 Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Mon, 24 Oct 2022 14:23:11 +0800 Subject: [PATCH] add footer --- src/components/Footer.js | 25 +++++++++++++++++++++++++ src/pages/index.js | 3 +++ 2 files changed, 28 insertions(+) create mode 100644 src/components/Footer.js diff --git a/src/components/Footer.js b/src/components/Footer.js new file mode 100644 index 0000000..6e2ca8f --- /dev/null +++ b/src/components/Footer.js @@ -0,0 +1,25 @@ +import * as React from "react" +import * as styles from "../styles/Footer.module.css" +import {useStaticQuery, graphql} from "gatsby" + +const Footer = () => { + const data = useStaticQuery(graphql` +query { + siteBuildMetadata { + buildTime(formatString: "YYYY MMMM DD") + } +} + + `) + console.log('data', data) + const {buildTime} = data.siteBuildMetadata + return ( + + ) +} + +export default Footer diff --git a/src/pages/index.js b/src/pages/index.js index 4ebad4c..0da21e6 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -3,6 +3,7 @@ import * as styles from "../styles/Home.module.css" import {StaticImage} from "gatsby-plugin-image" import Header from "../components/Header" import PostPreview from "../components/PostPreview" +import Footer from "../components/Footer" const IndexPage = () => { return ( @@ -47,6 +48,8 @@ const IndexPage = () => { } /> + +