forge site deploy sets FORGE_SITE_URL and FORGE_SITE_BASE; without them the site still builds for the root of 012.dev.site. .forge/sites declares the docs site so it deploys to https://pages.src.rest/sites/cat/012/docs/.
- commit
- a63f866f8565d95d9d77880d47360f3bbb6f6f54
- parent
- 26dd53cc8d74359b261688fea7990b35ba0efff4
- author
- Dami <dami.etoile@gmail.com>
- kind
- feat risk score 1.3 of 3, Jev's estimate
| A | .forge/ | 2 | ++ |
| M | website/ | 8 | +++++--- |
@@ -24,15 +24,17 @@ const sections: [string, string][] = [
2424 ];2525 2626 // The site is served at the root of its own host; SITE_URL names that27-// host for canonical links and the sitemap.28-const url = process.env.SITE_URL || 'https://012.dev.site';27+// host for canonical links and the sitemap. `forge site deploy` serves it28+// under a path instead and says where with FORGE_SITE_URL and FORGE_SITE_BASE.29+const forgeSite = process.env.FORGE_SITE_URL ? new URL(process.env.FORGE_SITE_URL) : null;30+const url = forgeSite?.origin || process.env.SITE_URL || 'https://012.dev.site';2931 3032 const config: Config = {3133 title: '012',3234 tagline: 'A spreadsheet for the terminal: the look of Lotus 1-2-3, the behavior of Google Sheets.',3335 favicon: 'img/favicon.svg',3436 url,35- baseUrl: '/',37+ baseUrl: process.env.FORGE_SITE_BASE || '/',3638 // Every page is a directory with an index.html, so plain static hosting3739 // resolves each address.3840 trailingSlash: true,