During local development with Hugo v0.120.3, when running
hugo server -D, it seems
.Site.BaseURL gets replaced with
From the LinkedIn Post Inspector we can see LinkedIn won’t play nice when
localhost is in the URL. So to still enable local dev, I would like to access the
baseURL in certain places of my site when accessing
So my question is, when running
hugo server -D, is there some way to still get access to the
baseURL (and not
almost never a good reason to use
.Site.BaseURL in your templates.
When running hugo server, you can specify the baseURL, port, etc.
hugo server --help
Yeah I was playing around with this, the issue faced here is the rest of the site no longer works when manually passing
hugo server -D --baseURL "https://foo.com".
I am wondering if there’s some way to have
localhost everywhere but one (involving part with LinkedIn sharing). All good if not, it’s sort of snowflake-y thing
Out of curiosity, what would you recommend instead of
.Site.BaseURL? Is there some other Hugo variable I should be using instead?
absLangURL in the docs.
Thanks for sharing! Appreciated.
I was just trying
absURL "" and it also resolves to
localhost when running
hugo server -D. Is there some way to have
absURL resolve to the published URL? I don’t see anything about that in the