Skip to content

Conversation

chalin
Copy link
Contributor

@chalin chalin commented Nov 13, 2023

@chalin chalin added this to the 23Q4 milestone Nov 13, 2023
@chalin chalin force-pushed the chalin-im-baseurl-2023-11-13 branch from 5bd9fc8 to daaa236 Compare November 13, 2023 13:56
@chalin chalin merged commit 8e35258 into google:main Nov 13, 2023
@chalin chalin deleted the chalin-im-baseurl-2023-11-13 branch November 13, 2023 13:57
@fekete-robert
Copy link
Contributor

We usually use different hugo environments, and set the baseurl to / in the default one, which works for local builds, and set it to the full url in the production environment, which is used for the prod deployment. (And also set the GA id and similar only in prod.)

@emckean
Copy link
Collaborator

emckean commented Nov 13, 2023

Oh, maybe we can add that as a best-practice tip in the docs?

@chalin
Copy link
Contributor Author

chalin commented Nov 13, 2023

For the projects I work on, including the setup for the User Guide: the base config for production. We pass in a different baseURL for preview builds:

"build:preview": "npm run _hugo-dev -- --minify --baseURL \"${DEPLOY_PRIME_URL:-/}\"",

Dev builds are handled like this:

"_hugo-dev": "npm run _hugo -- -e dev -DFE",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants