diff --git a/content/feed/feed.njk b/content/feed/feed.njk index 61f63d3c..3019206a 100755 --- a/content/feed/feed.njk +++ b/content/feed/feed.njk @@ -1,6 +1,7 @@ --- # Metadata comes from _data/metadata.json permalink: /feed/feed.xml +numberOfLatestPostsToShow: 10 --- @@ -14,7 +15,7 @@ permalink: /feed/feed.xml {{ metadata.author.name }} {{ metadata.author.email }} - {% for post in collections.posts | reverse %} + {% for post in collections.posts| head(-1 * numberOfLatestPostsToShow) | reverse %} {% set absolutePostUrl %}{{ post.url | htmlBaseUrl(metadata.url) }}{% endset %} {{ post.data.title }} diff --git a/content/feed/json.njk b/content/feed/json.njk index b9ea38fe..ac35c7f7 100644 --- a/content/feed/json.njk +++ b/content/feed/json.njk @@ -1,6 +1,7 @@ --- # Metadata comes from _data/metadata.json permalink: /feed/feed.json +numberOfLatestPostsToShow: 10 --- { "version": "https://jsonfeed.org/version/1.1", @@ -14,7 +15,7 @@ permalink: /feed/feed.json "url": "{{ metadata.author.url }}" }, "items": [ - {% for post in collections.posts | reverse %} + {% for post in collections.posts| head(-1 * numberOfLatestPostsToShow) | reverse %} {% set absolutePostUrl = post.url | htmlBaseUrl(metadata.url) %} { "id": "{{ absolutePostUrl }}",