Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly set baseURL for the User Guide #1737

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

chalin
Copy link
Collaborator

@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
5 checks passed
@chalin chalin deleted the chalin-im-baseurl-2023-11-13 branch November 13, 2023 13:57
@fekete-robert
Copy link
Collaborator

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
Collaborator 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