Closed vce-open closed 3 years ago
Did you set the proper baseURL
in config.toml
?
hi i tried different versions to crosscheck, correct me if i am wrong is this proper https://<org11>.github.io/<reponame>/
for base url.
i think few other hugo projects with same link syntax before hosting it on own domains.
is this proper
https://<org11>.github.io/<reponame>/
for base url.
nope.
without reponame
, just https://<org11>.github.io
would be correct.
that would be good if <reponame>
is same as <org_name> or <github-username>
as per github pages offical docs, i have multiple hugo repos.
And also if we have that as base url footer menu gives issues and pages get loading issues as images will exist in reponame/images
but not `/images' while deploying using gh-pages . I did verify that for just in case before raising request.
Have you actually tried setting baseURL = "https://<org11>.github.io"
?
I have no experience with GitHub Pages. Generally, if you wanna host multiple Hugo sites under the same (sub)domain, you have to put each site's static files into a separate subfolder and set baseURL
to that subfolder. With GitHub Pages project sites it seems to be a slightly different story: My guess is that GitHub's HTTP server prepends https://<org11>.github.io/<reponame>/
to all relative URLs of a project site. Now documentation says they don't even support any static file generator other than Jekyll – i.e. you have to build the site locally. This basically means there won't be a satisfying solution unless you gonna switch to using a GitHub Pages organization/user site, because:
baseURL
to https://<org11>.github.io/<reponame>/
, your site won't properly work since Hugo will prepend /<reponame>/
to all relative URLs during build and then GitHub's HTTP server will resolve these URLs with https://<org11>.github.io/<reponame>/
as the root, resulting in the doubled /<reponame>/<reponame>/page
you described above.baseURL
to "https://<org11>.github.io"
(or an empty string ""
), your site will work except for the Open Graph / Twitter Card image <meta>
tags which must be absolute URLs by spec and thus the base URL has to be resolved at build time – erroneously to https://<org11>.github.io/path/to/image_file
(or path/to/image_file
if baseURL = ""
).The only proper solution I guess would be to set baseURL = "https://<org11>.github.io/<reponame>/"
and copy the generated static files into a folder named <reponame>
in the <org11>.github.io
repository (the GitHub Pages organization site repo). That should work as expected.
i did try "Have you actually tried setting baseURL = "https://
is this a recent change on Hugo side "Hugo will prepend /
can you mean time see this hugo issue on github.
Thanks salim
is this a recent change on Hugo side (...)
No, I guess this problem only occurs when using GitHub Pages project sites in combination with a theme that uses relative URLs (like Airspace does).
can you mean time see this hugo issue on github.
The issue you mention has been fixed long time ago.
we plan to buy a domain so i am not sure if i have configured my
config.toml
wrong or is it real issueused github actions and github pages to deploy and host website on
https://<org11>.github.io/<reponame>/
in top navigation menu pages are redirected to/<reponame>/<reponame>/page
when the correct behaviour should be/<reponame>/page
.