From 495bc6e79c6b6e2d58173c22a9b8bb3c2cef6609 Mon Sep 17 00:00:00 2001 From: W Beecher Baker Date: Tue, 15 Oct 2024 10:27:56 -0400 Subject: [PATCH] make Github Pages the normal case and deployment to Cascade the exception --- src/utils/url.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/url.js b/src/utils/url.js index c17afb4..b21047e 100644 --- a/src/utils/url.js +++ b/src/utils/url.js @@ -7,12 +7,12 @@ export function isValidUrl(string) { } } -// Allow base_url to be different on Github Pages than when deployed elsewhere, for example to Cascade. -// GithubPages requires the base_url to be the repository name, while Cascade needs the page to +// Allow base_url to be different when deployed elsewhere than Github Pages — for example to a CMS. +// GithubPages requires the base_url to be the repository name, while a CMS may need the page to // fit into its own directory structure. export const getBaseUrl = (configuration = __APP_ENV__) => { const baseUrl = configuration?.base_url || '' - const githubPagesBaseUrl = configuration?.github_pages_base_url || '' + const deployedBaseUrl = configuration?.deployed_base_url || '' const isGithubPages = window.location.origin.indexOf('.github.io/') > 0 - return isGithubPages ? githubPagesBaseUrl : baseUrl + return isGithubPages ? baseUrl : deployedBaseUrl } \ No newline at end of file