feat: consolidate all feeds into a single template and normalize inputs

This commit is contained in:
Cory Dransfeldt 2023-09-06 11:49:40 -07:00
parent 638f784eb7
commit 517e849ef5
No known key found for this signature in database
18 changed files with 104 additions and 154 deletions

View file

@ -1,19 +0,0 @@
---
layout: null
permalink: /feeds/books
---
{% layout "./_includes/feeds/books.liquid" %}
{% block title %}Books • Cory Dransfeldt{% endblock %}
{% block self %}books.xml{% endblock %}
{% block update %}{{ books[0].dateAdded | date: "%Y-%m-%dT%H:%M:%S-08:00" }}{% endblock %}
{% block entries %}
{% for book in books %}
<entry>
<title>{{ book.title | escape }}</title>
<link href="{{ book.url | stripUtm | encodeAmp }}" />
<updated>{{ book.dateAdded | date: "%m.%d.%Y" }}</updated>
<id>{{ book.url | stripUtm | encodeAmp }}</id>
<content type="html"></content>
</entry>
{% endfor %}
{% endblock %}

12
src/feeds/books.md Normal file
View file

@ -0,0 +1,12 @@
---
layout: null
permalink: /feeds/books
---
{% render "partials/feeds/content.liquid"
permalink:'/feeds/books'
title:'Books • Cory Dransfeldt'
data:books
updated:books[0].dateAdded
site:site
eleventy:eleventy
%}

View file

@ -1,23 +0,0 @@
---
layout: null
permalink: /feeds/posts
---
{% layout "./_includes/feeds/feed.liquid" %}
{% block title %}All posts • Cory Dransfeldt{% endblock %}
{% block self %}feed.xml{% endblock %}
{% block update %}
{{ collections.posts[0].date | date: "%Y-%m-%dT%H:%M:%S-08:00" }}{% endblock %}
{% block entries %}
{% assign posts = collections.posts | reverse %}
{% for post in posts limit: 15 %}
<entry>
<title>{{ post.data.title }}</title>
<link href="{{ site.url }}{{ post.url }}" />
<updated>{{ post.date | date: "%m.%d.%Y" }}</updated>
<id>{{ site.url }}{{ post.url }}</id>
<content type="html">
{{ post.data.post_excerpt | markdown | escape }}
</content>
</entry>
{% endfor %}
{% endblock %}

13
src/feeds/feed.md Normal file
View file

@ -0,0 +1,13 @@
---
layout: null
permalink: /feeds/posts
---
{% assign posts = collections.posts | reverse %}
{% render "partials/feeds/content.liquid"
permalink:'/feeds/posts'
title:'All posts • Cory Dransfeldt'
data:posts
updated:posts[0].date
site:site
eleventy:eleventy
%}

View file

@ -1,19 +0,0 @@
---
layout: null
permalink: /feeds/follow
---
{% layout "./_includes/feeds/follow.liquid" %}
{% block title %}Follow • Cory Dransfeldt{% endblock %}
{% block self %}follow.xml{% endblock %}
{% block update %}{{ follow.posts[0].date_published | date: "%Y-%m-%dT%H:%M:%S-08:00" }}{% endblock %}
{% block entries %}
{% for item in follow.posts %}
<entry>
<title>{{ item.title | escape }}</title>
<link href="{{item.url | stripUtm | encodeAmp }}" />
<updated>{{ item.date_published | date: "%m.%d.%Y" }}</updated>
<id>{{ item.url | stripUtm | encodeAmp }}</id>
<content type="html"></content>
</entry>
{% endfor %}
{% endblock %}

12
src/feeds/follow.md Normal file
View file

@ -0,0 +1,12 @@
---
layout: null
permalink: /feeds/follow
---
{% render "partials/feeds/content.liquid"
permalink:'/feeds/follow'
title:'Follow • Cory Dransfeldt'
data:follow.posts
updated:follow.posts[0].date_published
site:site
eleventy:eleventy
%}

View file

@ -1,19 +0,0 @@
---
layout: null
permalink: /feeds/links
---
{% layout "./_includes/feeds/links.liquid" %}
{% block title %}Links • Cory Dransfeldt{% endblock %}
{% block self %}links.xml{% endblock %}
{% block update %}{{ links[0].date | date: "%Y-%m-%dT%H:%M:%S-08:00" }}{% endblock %}
{% block entries %}
{% for link in links %}
<entry>
<title>{{ link.title | escape }}</title>
<link href="{{ link.url | stripUtm | encodeAmp }}" />
<updated>{{ link.date | date: "%m.%d.%Y" }}</updated>
<id>{{ link.url | stripUtm | encodeAmp }}</id>
<content type="html"></content>
</entry>
{% endfor %}
{% endblock %}

12
src/feeds/links.md Normal file
View file

@ -0,0 +1,12 @@
---
layout: null
permalink: /feeds/links
---
{% render "partials/feeds/content.liquid"
permalink:'/feeds/links'
title:'Links • Cory Dransfeldt'
data:links
updated:links[0].date
site:site
eleventy:eleventy
%}