I want to add a title and description meta tag for my index.html
page in my public folder to improve SEO but gatsby has index.html
in its gitignore
file. Is it ok for me to remove index.html
from gitignore
without breaking anything? Is there a different way to update index.html
without having it reset every time I push through git?
“src” is a convention for “source code”. /api JavaScript and TypeScript files under src/api become functions automatically with paths based on their file name. Check out the functions guide for more detail. /pages Components under src/pages become pages automatically with paths based on their file name.
The static folder is useful as a workaround for a number of less common cases: You need a file with a specific name in the build output, such as manifest. webmanifest . You have thousands of images and need to dynamically reference their paths. You want to include a small script like pace.
The public folder is created by Gatsby on each build and if you add anything to the public folder, it will be overriden when the build runs next time
As per the Gatsby documentation
/public Automatically generated. The output of the build process will be exposed inside this folder. Should be added to the .gitignore file if not added already.
In order to add page metadata such as description and title, Gatsby recommends to use react-helment
According to documentation
Adding metadata to pages, such as page title, meta description, alt text and structured data using JSON-LD, helps search engines understand your content and when to show your pages in search results.
A common way to add metadata to pages is to add
react-helmet
components (together with the Gatsby React Helmet plugin for SSR support) to your page components.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With