Site url not being set properly
Closed this issue · 4 comments
Checks
- I have searched the docs, existing issues, and existing discussions for answers first.
Link to your website repo
NA
Version of Lab Website Template you are using
NA
Description
Currently, the sitemap generated with this template doesn't get parsed correctly by google. jekyll-sitemap requires "url" attribute to be set in _config.yml. I suppose we should update the instructions to capture that.
The site url is (supposed to be) set automatically right before the site is built each time on github actions:
https://github.com/greenelab/lab-website-template/blob/main/.github/workflows/build-site.yaml#L45
However I forgot that echo prints newlines literally. Here is a hot fix that you can apply, or you can wait for v1.2.1 to be ready.
Also, please next time do not open an issue without including your repo and version. To debug this issue I had to look through your repos to try to find the one you're seeing the problem in and dig through the workflow runs. This isn't sustainable for me.
To add to this, the jekyll-sitemap plugin needs a url: property set on the _config.yaml file to create valid sitemap.xml and robots.txt files. Without it, the files generated might not have a fully qualified URL and, therefore, will not be syntactically valid.
I suggest adding a manual setting there instead of relying on github actions!
The entire template is based around github actions automating as much of the process as possible for users. That would not be in line with the way the rest of the template is designed. The docs also do not mention manually setting a "baseurl" because it was a consistent source of confusion for users, so the template does it automatically for them.
The only way the user would need to manually set the url in the config file is if they were building their site locally (or via some other process) and deploying it manually, which is completely outside the scope of the docs.