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

Fix RSS link for paginated list pages #1192

Merged
merged 1 commit into from
Apr 23, 2023

Conversation

bkrl
Copy link
Contributor

@bkrl bkrl commented Apr 18, 2023

What does this PR change? What problem does it solve?

The RSS link in list pages was previously hard-coded to index.xml, which doesn't work on paginated list pages because it might go to something like /section/pages/2/index.xml instead of /section/index.xml. I made it use (.OutputFormats.Get "rss").RelPermalink instead following the example in Hugo's docs.

PR Checklist

  • This change adds/updates translations and I have used the template present here.
  • I have enabled maintainer edits for this PR.
  • I have verified that the code works as described/as intended.
  • This change adds a Social Icon which has a permissive license to use it.
  • This change does not include any CDN resources/links.
  • This change does not include any unrelated scripts such as bash and python scripts.
  • This change updates the overridden internal templates from HUGO's repository.

The link was previously hard-coded to index.html, which doesn't work on
paginated list pages because it would go to something like
/section/pages/2/index.html instead of /section/index.html.
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Owner

@adityatelange adityatelange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect!

@adityatelange adityatelange merged commit 8d1e45a into adityatelange:master Apr 23, 2023
@bkrl bkrl deleted the fix-rss-link branch April 24, 2023 18:30
romainx pushed a commit to romainx/hugo-PaperMod that referenced this pull request May 1, 2023
The link was previously hard-coded to index.html, which doesn't work on
paginated list pages because it would go to something like
/section/pages/2/index.html instead of /section/index.html.
jdxgfty pushed a commit to jdxgfty/hugo-PaperMod that referenced this pull request Nov 3, 2024
The link was previously hard-coded to index.html, which doesn't work on
paginated list pages because it would go to something like
/section/pages/2/index.html instead of /section/index.html.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants