Skip to content

Commit 6ee1733

Browse files
committed
fix: update development environment URLs for standards projects
- Update `SITE_URL` and `SITE_BASE_URL` values in `.env.site.development` files for `muldicat` and `isbd` - Fix base paths to correctly reflect `/standards-dev` structure
1 parent ff11b51 commit 6ee1733

File tree

13 files changed

+35
-32
lines changed

13 files changed

+35
-32
lines changed

libs/shared-config/src/lib/utils/loadEnvConfig.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@ export function getEnvironmentName(): string {
2929
const docsEnv = process.env['DOCS_ENV'];
3030
if (docsEnv) {
3131
const docsEnvMap: Record<string, string> = {
32-
'localhost': 'local',
32+
'local': 'local', // DOCS_ENV=local maps to 'local' environment files
33+
'localhost': 'local', // DocsEnv.Localhost also maps to 'local' environment files
3334
'preview': 'preview',
3435
'dev': 'development',
3536
'production': 'production',
3637
};
3738
if (docsEnvMap[docsEnv]) {
3839
return docsEnvMap[docsEnv];
3940
}
41+
// Throw error for invalid DOCS_ENV values
42+
throw new Error(`Invalid DOCS_ENV value: '${docsEnv}'. Expected one of: ${Object.keys(docsEnvMap).join(', ')}`);
4043
}
4144

4245
// Fallback to NODE_ENV mapping

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@
7979
"sheets:export": "ts-node scripts/sheets-export.ts",
8080
"sheets:import": "ts-node scripts/sheets-import.ts",
8181
"sheets:ingest": "node scripts/sheets-to-mdx.js --sheet 'https://docs.google.com/...'",
82-
"start": "pnpm stop:portal && docusaurus start",
83-
"start:all": "pnpm stop:all && concurrently \"docusaurus start portal --port 3000\" \"docusaurus start standards/ISBDM --port 3001\" \"docusaurus start standards/LRM --port 3002\" \"docusaurus start standards/FRBR --port 3003\" \"docusaurus start standards/isbd --port 3004\" \"docusaurus start standards/muldicat --port 3005\" \"docusaurus start standards/unimarc --port 3006\"",
84-
"start:frbr": "pnpm stop:frbr && docusaurus start standards/FRBR --port 3003",
85-
"start:isbd": "pnpm stop:isbd && docusaurus start standards/isbd --port 3004",
86-
"start:isbdm": "pnpm stop:isbdm && docusaurus start standards/ISBDM --port 3001",
87-
"start:lrm": "pnpm stop:lrm && docusaurus start standards/LRM --port 3002",
88-
"start:muldicat": "pnpm stop:muldicat && docusaurus start standards/muldicat --port 3005",
89-
"start:portal": "pnpm stop:portal && docusaurus start portal --port 3000",
90-
"start:unimarc": "pnpm stop:unimarc && docusaurus start standards/unimarc --port 3006",
82+
"start": "pnpm stop:portal && DOCS_ENV=local docusaurus start",
83+
"start:all": "pnpm stop:all && concurrently \"DOCS_ENV=local docusaurus start portal --port 3000\" \"DOCS_ENV=local docusaurus start standards/ISBDM --port 3001\" \"DOCS_ENV=local docusaurus start standards/LRM --port 3002\" \"DOCS_ENV=local docusaurus start standards/FRBR --port 3003\" \"DOCS_ENV=local docusaurus start standards/isbd --port 3004\" \"DOCS_ENV=local docusaurus start standards/muldicat --port 3005\" \"DOCS_ENV=local docusaurus start standards/unimarc --port 3006\"",
84+
"start:frbr": "pnpm stop:frbr && DOCS_ENV=local docusaurus start standards/FRBR --port 3003",
85+
"start:isbd": "pnpm stop:isbd && DOCS_ENV=local docusaurus start standards/isbd --port 3004",
86+
"start:isbdm": "pnpm stop:isbdm && DOCS_ENV=local docusaurus start standards/ISBDM --port 3001",
87+
"start:lrm": "pnpm stop:lrm && DOCS_ENV=local docusaurus start standards/LRM --port 3002",
88+
"start:muldicat": "pnpm stop:muldicat && DOCS_ENV=local docusaurus start standards/muldicat --port 3005",
89+
"start:portal": "pnpm stop:portal && DOCS_ENV=local docusaurus start portal --port 3000",
90+
"start:unimarc": "pnpm stop:unimarc && DOCS_ENV=local docusaurus start standards/unimarc --port 3006",
9191
"stop:all": "lsof -ti:3000,3001,3002,3003,3004,3005,3006 | xargs kill -9 2>/dev/null || true && pkill -f 'docusaurus start' 2>/dev/null || true",
9292
"stop:frbr": "lsof -ti:3003 | xargs kill -9 2>/dev/null || true",
9393
"stop:isbd": "lsof -ti:3004 | xargs kill -9 2>/dev/null || true",

packages/theme/src/config/docusaurus.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ export const sharedThemeConfig = {
111111
},
112112
],
113113
copyright: `
114-
Copyright © ${new Date().getFullYear()} International Federation of Library Associations and Institutions (IFLA)<br />
114+
Copyright © ${new Date().getFullYear()} International Federation of Library Associations and Institutions (IFLA)<br>
115115
<a href="https://creativecommons.org/licenses/by/4.0/" target="_blank" rel="noopener noreferrer">
116-
<img src="img/cc0_by.png" alt="My Logo Alt Text" style="vertical-align:middle; height:24px;" />
116+
<img src="img/cc0_by.png" alt="CC BY 4.0" style="vertical-align:middle; height:24px;">
117117
</a>
118118
Gordon Dunsire and Mirna Willer (Main design and content editors).
119119
`,

packages/theme/src/config/siteConfig.server.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,29 @@ import { DocsEnv, type SiteKey, sites } from './siteConfigCore';
99
export function getCurrentEnv(): DocsEnv {
1010
const docsEnv = process.env.DOCS_ENV;
1111

12-
if (docsEnv && DocsEnv && Object.values(DocsEnv).includes(docsEnv as DocsEnv)) {
13-
return docsEnv as DocsEnv;
12+
// Map DOCS_ENV values to DocsEnv enum values
13+
if (docsEnv) {
14+
const docsEnvMap: Record<string, DocsEnv> = {
15+
'local': DocsEnv.Localhost,
16+
'localhost': DocsEnv.Localhost,
17+
'preview': DocsEnv.Preview,
18+
'dev': DocsEnv.Dev,
19+
'production': DocsEnv.Production,
20+
};
21+
22+
if (docsEnvMap[docsEnv]) {
23+
return docsEnvMap[docsEnv];
24+
}
1425
}
1526

1627
// Fallback to NODE_ENV if DOCS_ENV is not set or invalid
1728
const nodeEnv = process.env.NODE_ENV;
1829

19-
2030
if (nodeEnv === 'development') {
21-
return DocsEnv?.Localhost as DocsEnv; // Added optional chaining and cast for safety
31+
return DocsEnv.Localhost;
2232
}
2333

24-
return DocsEnv?.Production as DocsEnv; // Added optional chaining and cast for safety
34+
return DocsEnv.Production;
2535
}
2636

2737
/**

portal/.env.site.development

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
# Core site configuration
44
SITE_URL=https://jonphipps.github.io
5-
SITE_BASE_URL=/standards-dev/portal/
5+
SITE_BASE_URL=/standards-dev/

portal/.env.site.local

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
# Core site configuration
44
SITE_URL=http://localhost:3000
5-
SITE_BASE_URL=/portal/
6-
SITE_PORT=3000
5+
SITE_BASE_URL=/
6+
SITE_PORT=3000

portal/.env.site.preview

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
# Core site configuration
44
SITE_URL=https://iflastandards.github.io/standards-dev
5-
SITE_BASE_URL=/portal/
5+
SITE_BASE_URL=/

portal/.env.site.production

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
# Core site configuration
44
SITE_URL=https://www.iflastandards.info
5-
SITE_BASE_URL=/portal/
5+
SITE_BASE_URL=/

portal/docusaurus.config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,9 @@ const config: Config = deepmerge(
125125
includeRdfDownloads: false,
126126
includeSitemap: false,
127127
includeBlog: false,
128-
customCopyright: 'Copyright © ${new Date().getFullYear()} International Federation of Library Associations and Institutions (IFLA)',
129128
}).links,
130129
copyright: createStandardsFooter({
131130
githubUrl: envConfig.GITHUB_REPO_URL!,
132-
customCopyright: 'Copyright © ${new Date().getFullYear()} International Federation of Library Associations and Institutions (IFLA)',
133131
}).copyright,
134132
}),
135133
{

standards/ISBDM/docusaurus.config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,9 @@ const config: Config = deepmerge(
182182
includeRdfDownloads: true,
183183
includeSitemap: true,
184184
includeBlog: true,
185-
customCopyright: 'Gordon Dunsire and Mirna Willer (Main design and content editors).',
186185
}).links,
187186
copyright: createStandardsFooter({
188187
githubUrl: envConfig.GITHUB_REPO_URL!,
189-
customCopyright: 'Gordon Dunsire and Mirna Willer (Main design and content editors).',
190188
}).copyright,
191189
}),
192190
{

0 commit comments

Comments
 (0)