-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Description
In the starter template for publishing a jekyll-based site to Github pages using the new Actions infrastructure, it shows how you can autodetect the correct publishing URL:
starter-workflows/pages/jekyll.yml
Lines 36 to 39 in 1c7042e
- name: Setup Pages | |
id: pages | |
uses: actions/configure-pages@v1 | |
- run: bundle exec jekyll build --baseurl ${{ steps.pages.outputs.base_path }} # defaults output to '/_site' |
As the comment suggests, this results in just "/
" for the main site published to a domain (e.g. example.com
) and to something like /subfolder/
for subprojects.
This is not what Jekyll expects; in fact the default configuration has baseurl
be the empty string: https://jekyllrb.com/docs/configuration/default/
If you have a site that uses baseurl
as a prefix to support separate deployments, the URLs generated will now start with two leading slashes rather than function as expected.
I see two ways to resolve this:
- update the "Setup pages" action to reflect the correct
baseurl
which would be a breaking change, or - change the starter workflow, doing one or both of the following
- Add a note that
--baseurl …
needs to be left out for a main site, or - Remove the
--baseurl
from the example altogether, make another workflow for subprojects specifically
- Add a note that
I probably missed a cleaner solution, but this would at least work.