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

GitHub workflow unsets site.baseurl at build time due to unnecessary --baseurl parameter #54

Open
gracegrimwood opened this issue May 21, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@gracegrimwood
Copy link
Contributor

Noting this down because it's been on my to-do list for a while and I still haven't got around to doing it:

The "Build with Jekyll" step in the GitHub workflow for the site currently overrides the baseurl variable declared in _config.yml with an empty value.

This happens because the step invokes Jekyll with the command

bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"

But the variable steps.pages.outputs.base_path is empty when the step is invoked, so the global site.baseurl is overridden with that empty value.

This is not really a problem for the production site because we don't set site.baseurl or rely on it for anything. However, for example, when testing the workflow in other repositories or attempting to demo changes to the site on a subpath of a personal GitHub pages URL, this breaks the site significantly (i.e. images, styles, and links do not resolve because site.baseurl is incorrect so the URLs are mangled at build time).

The fix is simple, we just need to remove the --baseurl "${{ steps.pages.outputs.base_path }}" portion from the Jekyll build command.

@gracegrimwood gracegrimwood added bug Something isn't working good first issue Good for newcomers labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant