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

Limit the RSS feed to 15 entries #1999

Merged
merged 3 commits into from
Sep 1, 2023
Merged

Limit the RSS feed to 15 entries #1999

merged 3 commits into from
Sep 1, 2023

Conversation

thibaultamartin
Copy link
Contributor

Fixes #1918

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Sep 1, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 40b29cf
Status: ✅  Deploy successful!
Preview URL: https://9ef0ec36.matrix-website.pages.dev
Branch Preview URL: https://limit-feed.matrix-website.pages.dev

View logs

@@ -19,25 +20,14 @@
<generator uri="https://www.getzola.org/">Zola</generator>
<updated>{{ last_updated | date(format="%+") }}</updated>
<id>{{ feed_url | safe }}</id>
{% set pageslen = pages | length %}
{% if pageslen > 15 %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this necessary? Have you tested what end=15 does if there are fewer (or exactly) 15 pages?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems needed, here's the output of zola serve without it

Error: Failed to serve the site
Error: Failed to render 'atom.xml'
Error: Reason: Variable `pages[i]` not found in context while rendering 'atom.xml': the evaluated version was `pages.1`. Maybe the index is out of bounds?

@thibaultamartin thibaultamartin merged commit b8a1314 into main Sep 1, 2023
3 checks passed
@thibaultamartin thibaultamartin deleted the limit-feed branch September 1, 2023 10:02
MTRNord pushed a commit that referenced this pull request Nov 21, 2024
* Limit the RSS feed to 15 entries

* Limit to last entry to test inoreader

* Revert "Limit to last entry to test inoreader"

This reverts commit d15810b.
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.

Limit the number of items returned in the atom feed
2 participants