-
Notifications
You must be signed in to change notification settings - Fork 154
Explicitly set baseurl
in _config.yml
, README docs
#57
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
base: main
Are you sure you want to change the base?
Conversation
indicate use of baseurl when deploying from a subfolder
add empty `baseurl` field to serve as placeholder to be used when the template is deployed to Google Pages
This has been here before: 1ea731f — and the comment "… the action renders this unnecessary" sheds some light on it. You're right it's the correct configuration, however it's most likely being set up dynamically by the publishing action here: just-the-docs-template/.github/workflows/pages.yml Lines 40 to 43 in 8406f5c
It's not exactly documented well but actions/configure-pages does a lot of this magic happen based on the running context. |
Thank you for your reply. I have installed this template twice in the last few months, and the automated workflow did not set this up automatically. I had to investigate the source of the issues I was having with some paths and edit this line in manually. I have just used the template to generate a third new repository. This is the _config.yml file: https://github.com/markwkidd/test-the-docs/blob/main/_config.yml As far as I can tell, it does not include the baseurl line I am suggesting here. To have that feature work correctly, I would need to understand the issue and research an answer. Is it possible I am either misunderstanding, or the logic you describe isn't being applied to this situation? |
You won't see it in the actual file. What |
When would that line be added to a config.yml generated by the template? I am confused by your comment that the baseurl line would not be visible once the template has been generated and the Jekyll scripts are being processed in the new repository. To try to put this another way: I have generated a repo using the template, and configured GitHub Pages to run the Just the Docs scripts. At this time, the needed baseurl line is not appearing in the generated config.yml I linked to. It seems to me I am at the last step of a deployment, and if any scripting was going to add the necessary baseurl line, it would have happened by now. |
Ah, right, they don't write config at runtime, they return the path in step outputs, to be passed as a parameter later. Here: just-the-docs-template/.github/workflows/pages.yml Lines 40 to 45 in 8406f5c
what |
I have deployed this template three times including the recent test I linked to. In none of those cases did this functionality work automatically. I would be glad to submit more information or do more testing if it is helpful. |
The "recent test" has no content, thus no links to check. I did clone the handbook repo mentioned in the description tho, made completely bogus config changes, deployed it at a relative baseurl at GitHub.io, and all links work, as the build workflow logs show the paths get set correctly:
Unless you're describing a surface or a plugin functionality not obviously visible from the few main pages, in that case please try to explain a bit more; however I seem to have relative links to pages and images apparently working, unrelated to what's in the boilerplate config. |
Hi folks, Thanks for the lively conversation! Apologies for the delayed response - have been super busy with work. Broadly speaking, completely agree that the current iteration of the template excluding I should also note that the default value for My only concern (that prevents me from just hitting "merge" on this PR right now) is making sure that explicitly setting Thanks for your patience! |
baseurl
in _config.yml
, README docs
I have been learning Jekyll and Just the Docs recently, thank you for this very helpful template. Based on my experience customizing Just the Docs, my intention with this PR is to bring the Just the Docs README and default configuration closer to the approach recommended by Jekyll.
If I understand Jekyll correctly, when a site is going to be served from a subfolder, the
baseurl
parameter should be set in_config.yml
. Jekyll resources often specifically name a Github Pages deployment as an example of a situation when baseurl should be used.So if I have a github repo named
cushaw-handbook
that I am deploying via Github Pages, I believe that the correct Jekyll configuration would include:In my situation this is relevant to image processing and styling. With
baseurl
set, I can now use functionality Jekyll'srelative_url
function in my content:Thank you for considering this patch.