Closed David00 closed 1 year ago
Technically, stitching site.url
with site.baseurl
is expected and by design because that is what Jekyll considers as leading components of an absolute URL.
However, the duplication of the /rpi-power-monitor
in your case is due to configuration mismatch.
GitHub Pages probably sets the --baseurl
Jekyll CLI switch under the hood which is evident in the /docs/v0.3.0/test.html
render (in contrast to what is in your _config.yml
).
To rectify, edit your config file to have (which is actually the correct way):
url: "https://david00.github.io"
baseurl: "/rpi-power-monitor"
That worked!!
That should have been so obvious to me... but it wasn't. I actually tried the opposite edit of setting baseurl: ""
, but that broke all of the styling.
Thank you so much for taking a look and providing context and a solution!
Hi, I have a site hosted on Github pages, and
redirect_from
is appending thesite.base_url
after thesite.url
.I'm simply attempting to redirect requests that go to
/docs/latest/page.md
to/docs/v0.3.0/page.md
.My site's baseurl is
/rpi-power-monitor
, and the site.url ishttps://david00.github.io/rpi-power-monitor
. When I use redirect_from, I end up getting redirected tohttps://david00.github.io/rpi-power-monitor/rpi-power-monitor
.I've setup a demo of exactly what I mean, which contains some details about the page's front matter, the values of
site.url
andsite.baseurl
, and a fewredirect_from
values that I've tried:https://david00.github.io/rpi-power-monitor/docs/v0.3.0/test.html
If you want to see my site's
_config.yml
andGemfile
, they are here in the docs branch: https://github.com/David00/rpi-power-monitor/tree/docsPlease let me know if you need any more info!
Thank you.