Adding a Favicon to Gatsby site

Adding a simple favicon.ico icon to a Gatsby site is pretty easy.

  1. Add the icon file to the src/images folder

In the src/components/seo.js file

  1. Import the icon import favicon from '../images/favicon.ico'
  2. Add the following attribute to the <Helmet> component
  link={[
    { rel: 'shortcut icon', type: 'image/x-icon', href: `${favicon}` },
  ]}