First of all, I have wrapped the URLs you posted in code blocks because the forum anti spam software flagged your posts for excessive external linking.
Please use the code block button when posting the contents of your config.
Second, your baseURL configuration is non standard. The Docs are quite explicit.
Also you need to post the full source code of your repository just a content file and the config are not enough because we need to see how you construct these links in your templates.
Hey everyone,
Thanks a lot for your help - I really appreciate it!
As you requested, I pushed all website source files to this repo: https://github.com/FabianFalck/upload . All I do is run âhugoâ in this folder and then copy the thing via FTP to my website.
I followed your advices, but still could not find a solution. I think @funkydan2 's advice is good: relativeURLs should be set to true. But I donât really know how the css file could then be correctly found. And still, the URLs donât work properly.
I think it is really one or two parameters that have to be changed, but I canât find themâŚ
Thanks a lot, I really thought this was the âerror you canât findâ and it would solve it. Unfortunately, it didnât.
I did exactly as you said and pushed the public folder to my website, but weird behavior of external links being prefixed by my website name persistsâŚ
PS.: Would it be possible to give me rights to post immediately? I always have to wait a day or an hour to post againâŚ
So Iâve cloned your site and noticed a few things.
baseURL is case sensitive, and needs to be set to the URL your site is published to (e.g. baseURL = "http://fabianfalck.com/" (see @alexandrosâs post above)
In page frontmatter, URLs which refer to external sites need to start with either http(s):// or //. e.g. in content/publication/ipp2018.md set url_dataset = "//www.politicalcompass.de/data/preprocessedsentiments.csv".
The reason for 2. is because the theme uses this code to build the link buttons:
And (I understand that) .RelPermalink is seeing a url which doesnât include // and is interpretting the string as a reference to a local file, instead of to an external site.
FinallyâŚif youâre using Netlify for hosting, you can take advantage of having your site built from a git repository
The main thing youâll need to do is change your theme to be a submodule.
@funkydan2 Your support is superb! Thanks a lot for your help!
However, I am afraid it still does not work for me. I did 1. and 2. (I also updated my website), but it is still prefixed by the website domain before the www, both when adding // and http://. Did this work for you when you cloned the page on your machine?
UPDATE: When I test the website with âhugo serverâ, everything works perfectly fine! So only on my actual website server, there is a problem. Does anyone have an idea what this difference could result from, i.e. how is hugo server different from hosting it on my website?
I think this is now very close to be solved, but still donât know how to do itâŚ
A difference between running hugo and hugo server is that when youâre running the testing environment, the baseURL setting is ignored (or, actually I think itâs set to localhost:1313).
When I run hugo on your repository - having changed baseURL and removed the relativeURLs setting, I get
I agree, the href parameter is correct. However, when I click on my website on this exact button, then the URL prefixed with my website is opened. Thatâs how I test it all the time and thatâs what does not work. Maybe this helps to solve itâŚ
The public folder hasnât been updated to match the changes youâve made (the public folder was updated 12 hours ago and the content and config.toml 2 hours agoâŚwhen Iâm looking at it). After running hugo after making edits, and then uploading the new files in /public to your server? When I look at the code on your live server, and the public folder on github, itâs different from when I clone your repository, build the site using hugo and inspect the source.
Am currently using 0.49.2 on my Windows box. But I wouldnât think the version would be the culprit. Perhaps you donât have the latest commits on Fabianâs repo?
I could now narrow the problem down: I agree with you that the compilation with âhugoâ on my local machine works. In the HTML files, the link is given as "//www.politicalcompass.de/data/preprocessedsentiments.csv" which will point to an external website.
However, when I transfer the public folder to my server and look at the source on www.fabianfalck.com on the Index page (searching for politicalcompass), the link is ./http:/www.politicalcompass.de/data/preprocessedsentiments.csv. When you actually click on it, the link changes to http://fabianfalck.com/http:/www.politicalcompass.de/data/preprocessedsentiments.csv which makes sense. But obviously, this link is wrong, as this is no internal document.
So the issue comes from the server somehow. Did anyone have had this issue before and an idea what this might come from?