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

sitemap should not use list.xml #12101

Closed
jmooring opened this issue Feb 21, 2024 · 1 comment · Fixed by #12102
Closed

sitemap should not use list.xml #12101

jmooring opened this issue Feb 21, 2024 · 1 comment · Fixed by #12102
Assignees
Milestone

Comments

@jmooring
Copy link
Member

jmooring commented Feb 21, 2024

Tested with hugo v0.124.0-DEV-cf7023cb90f. This was not a problem with v0.122.0.

The problem occurs with multilingual sites. Monolingual sites are fine.

layouts/
└── _default/
    ├── baseof.html
    ├── home.html
    ├── list.html
    ├── list.xml   <-- seen as sitemap template instead of rss template
    └── single.html
git clone --single-branch -b hugo-forum-topic-48402 https://github.com/jmooring/hugo-testing hugo-forum-topic-48402
cd hugo-forum-topic-48402
hugo

Error: error building site: render: failed to render pages: render of "sitemapindex" failed: "/home/jmooring/code/hugo-testing/layouts/_default/list.xml:1:8": execute of template failed: template: _default/list.xml:1:8: executing "_default/list.xml" at <.Site.Title>: can't evaluate field Site in type []*hugolib.Site

The layouts/_default/list.xml template contains:

{{ .Site.Title }}

There are no problems if I rename the template to any of the following:

layouts/_default/rss.xml
layouts/_default/list.rss.xml  
layouts/_default/section.xml

Reference: https://discourse.gohugo.io/t/sitemapindex-and-site-title-error-on-list-html/48402

@bep bep self-assigned this Feb 21, 2024
@bep bep added this to the v0.123.2 milestone Feb 21, 2024
@bep bep changed the title RSS template is treated as a sitemap template sitemap should not use list.xml Feb 21, 2024
bep added a commit to bep/hugo that referenced this issue Feb 21, 2024
bep added a commit that referenced this issue Feb 21, 2024
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants