add footer

This commit is contained in:
2022-10-24 14:23:11 +08:00
parent f26a62925a
commit d53c9d7166
2 changed files with 28 additions and 0 deletions

25
src/components/Footer.js Normal file
View File

@@ -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 (
<footer className={styles.footer}>
<small>
Website built with Gatsby.js at {buildTime}. ©2022-2023 Social OjO. All Rights Reserved.
</small>
</footer>
)
}
export default Footer

View File

@@ -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 = () => {
}
/>
</main>
<Footer />
</>
)
}