Using Path and Asset Prefixes

The vast majority of Gatsby sites are hosted at the root of their domain (e.g., example.com/), and their assets are usually located in some directory within that domain (e.g., example.com/img or example.com/css). However, there are certain scenarios in which Gatsby developers prefer to host their Gatsby sites at a different location than the domain root, as well as situations where external assets outside the domain need to be used.

In this section, we’ll cover both of these conditions in detail. Deploying a Gatsby site to a location other than the domain root requires the use of path prefixes in Gatsby site configuration, while employing assets from a different domain requires developers to use asset prefixes to identify where those files are located.


Posted

in

,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *