/** * Bio component that queries for data * with Gatsby's useStaticQuery component * * See: https://www.gatsbyjs.com/docs/use-static-query/ */ import * as React from "react"; import { useStaticQuery, graphql } from "gatsby"; import { StaticImage } from "gatsby-plugin-image"; const Bio = () => { const data = useStaticQuery(graphql` query BioQuery { site { siteMetadata { author social { twitter } } } } `); // Set these values by editing "siteMetadata" in gatsby-config.js const author = data.site.siteMetadata?.author; const social = data.site.siteMetadata?.social; return (
{author && (

Written by {author} {` `} You should follow them on Twitter

)}
); }; export default Bio;