1
0
mirror of https://github.com/danbee/danbarber.me synced 2025-03-04 08:59:10 +00:00

Limit feeds to categorised posts

This commit is contained in:
Daniel Barber 2019-07-08 21:04:33 -04:00
parent 5239875f2b
commit d83043e796
3 changed files with 4 additions and 4 deletions

View File

@ -26,7 +26,7 @@ layout:
},
{% endif %}
"items": [
{% assign posts = site.posts | where_exp: "post", "post.draft != true" %}
{% assign posts = site.posts | where_exp: "post", "post.draft != true" | where_exp: "post", "post.categories contains 'blog'" %}
{% for post in posts limit: 20 %}
{
"id": {{ post.id | absolute_url | jsonify }},

View File

@ -26,8 +26,8 @@ layout:
},
{% endif %}
"items": [
{% assign posts = site.posts | where_exp: "post", "post.draft != true" %}
{% for post in site.categories.photos limit: 20 %}
{% assign posts = site.posts | where_exp: "post", "post.draft != true" | where_exp: "post", "post.categories contains 'photos'" %}
{% for post in posts limit: 20 %}
{
"id": {{ post.id | absolute_url | jsonify }},
"url": {{ post.url | absolute_url | jsonify }},

View File

@ -15,7 +15,7 @@ layout:
</author>
<generator uri="http://octopress.org/">Octopress</generator>
{% for post in site.posts limit: 20 %}
{% for post in site.categories.blog limit: 20 %}
<entry>
<title type="html"><![CDATA[{{ post.title | cdata_escape }}]]></title>
<link href="{{ site.url }}{{ post.url }}"/>