From 3eb79e34f25bd90a695e49bc0712a3938f5e9472 Mon Sep 17 00:00:00 2001 From: "@s.roertgen" Date: Thu, 23 Mar 2023 11:15:39 +0100 Subject: [PATCH] add pathPrefix option --- README.md | 4 ++++ gatsby-config.js | 1 + package.json | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 203a1b3..31ee48c 100644 --- a/README.md +++ b/README.md @@ -77,3 +77,7 @@ gatsby serve ``` Once this starts, you can view your site at http://localhost:9000. + +## Deployment + +If you need to serve this blog from other than root, set `pathPrefix: ""` in `gatsby-config.js` and insert the right prefix. \ No newline at end of file diff --git a/gatsby-config.js b/gatsby-config.js index 838fefc..7958898 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -1,4 +1,5 @@ module.exports = { + pathPrefix: "/metafacture-blog", siteMetadata: { title: `Metafacture Blog`, author: { diff --git a/package.json b/package.json index 95f9d5c..bdfaad3 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "url": "git+https://github.com/metafacture/metafacture-blog.git" }, "scripts": { - "build": "gatsby build", + "build": "gatsby build --prefix-paths", "develop": "gatsby develop -H 0.0.0.0", "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"", "start": "npm run develop",