HichiHachi
HichiHachi

Reputation: 491

How to add static files to gatsby site

I currently have a working Gatsby site, but I want to include static html/css files to the site.

example - I have currentSite.com but I want to add currentSite.com/moreStuff/evenMoreStuff using a folder of static stuff I have.

How do I go about this with minimal editing to my gatsby files?

Thanks in advance.

Upvotes: 1

Views: 3320

Answers (1)

EliteRaceElephant
EliteRaceElephant

Reputation: 8162

  1. In your Gatsby project root is a /static folder. If it isn't there you can create it.

  2. Place your static HTML in there. It should have the path /static/moreStuff/evenMoreStuff,

  3. gatsby develop or gatsby build.

You're done.

Make sure not to create a page in your /pages directory with the same name or route as your static html files.

Upvotes: 2

Related Questions