Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Site url not being set properly #246

Closed
1 task done
AgrawalAmey opened this issue Mar 23, 2024 · 4 comments · Fixed by #247
Closed
1 task done

Site url not being set properly #246

AgrawalAmey opened this issue Mar 23, 2024 · 4 comments · Fixed by #247
Labels
bug Something isn't working

Comments

@AgrawalAmey
Copy link

Checks

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.

@vincerubinetti
Copy link
Collaborator

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.

6aa88ee

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.

@vincerubinetti vincerubinetti changed the title Fix sitemap Site url not being set properly Mar 23, 2024
@vincerubinetti vincerubinetti linked a pull request Mar 23, 2024 that will close this issue
3 tasks
@vincerubinetti vincerubinetti added the bug Something isn't working label Mar 23, 2024
@AgrawalAmey
Copy link
Author

AgrawalAmey commented Mar 23, 2024 via email

@p-ang
Copy link

p-ang commented Mar 25, 2024

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!

@vincerubinetti
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants