-
Notifications
You must be signed in to change notification settings - Fork 241
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
Use site.baseurl to allow for local testing. #25
base: master
Are you sure you want to change the base?
Conversation
Newer versions of Jekyll introduced the site.baseurl configuration option [1], which is useful for testing the site locally. This commit adds support for site.baseurl to this theme. site.url is now used for the protocol and domain name only, without a trailing slash. site.baseurl, if specified, has a leading slash and no trailing slash. In many instances, site.url has been replaced by site.baseurl where the protocol and domain are not necessary (e.g., <a>, <img>, etc.). site.url is now used in the following places: - the canonical link - the feed link and within the feed - sharing, including Open Graph - search Some advice for where to use each comes from this StackOverflow post [2], and other changes were based on the scaffolding generated by the latest version of Jekyll (3.0.3). [1]: https://jekyllrb.com/docs/upgrading/0-to-2/#baseurl [2]: http://stackoverflow.com/a/27400343
Relative urls are considered bad practice by most, so if the Just my two pennies, feel free to disregard. |
@jrfnl To be clear, this pull request is less about pushing root-relative URLs into this theme than bringing the theme up to speed with what Jekyll currently does. Jekyll's addition of
The names are admittedly not as clear as they could be, though that was Jekyll's choice, not mine. Jekyll uses root-relative URLs in its generated scaffolding by default, with the exception of the canonical URL and the feed. However, I understand that others may want to use absolute URLs everywhere. Fortunately, if this pull request is accepted, that is still rather simple: url: ''
baseurl: http://aronbordin.com/neo-hpstr-jekyll-theme This works because whenever I've added a block to |
Tested this patch and found the following:
Everything else appears fine when testing locally. I really like the idea of using the new baseurl configuration setting. Hope when this gets fixed it gets merged. |
Hi @seanfisk thanks for your contribution and sorry for this loooooooong delay. I've made some big modifications in master, can you allow me to edit your commits ? I'd like to update this pr to the new project structure :) Thank you |
No worries, @aron-bordin! Believe me, I understand being busy 😉 Feel free to edit my commits as you desire! I can try to fix issues including some of those mentioned by @ccjjmartin if I have time as well. |
Newer versions of Jekyll introduced the
site.baseurl
configuration option, which is useful for testing the site locally. This commit adds support forsite.baseurl
to this theme.site.url
is now used for the protocol and domain name only, without a trailing slash.site.baseurl
, if specified, has a leading slash and no trailing slash.In many instances,
site.url
has been replaced bysite.baseurl
where the protocol and domain are not necessary (e.g.,<a>
,<img>
, etc.).site.url
is now used in the following places:Some advice for where to use each comes from this StackOverflow post, and other changes were based on the scaffolding generated by the latest version of Jekyll (3.0.3).
I've done quite a bit of testing (via
jekyll serve
and GitHub Pages), but it's certainly possible I missed something. Thanks for maintaining this theme! :)