feat: feedpress plus cleanup

This commit is contained in:
Cory Dransfeldt 2023-09-04 14:47:29 -07:00
parent cc0a934f88
commit 29d3042f63
16 changed files with 32 additions and 107 deletions

View file

@ -1,10 +1,10 @@
module.exports = async function () {
const { ActivityFeed } = await import('@11ty/eleventy-activity-feed')
const feed = new ActivityFeed()
feed.addSource('atom', '📝', 'https://coryd.dev/feed.xml')
feed.addSource('atom', '🔗', 'https://coryd.dev/links.xml')
feed.addSource('atom', '📝', 'https://coryd.dev/feeds/posts')
feed.addSource('atom', '🔗', 'https://coryd.dev/feeds/links')
feed.addSource('rss', '🎥', 'https://letterboxd.com/cdme/rss')
feed.addSource('atom', '📖', 'https://coryd.dev/books.xml')
feed.addSource('atom', '📖', 'https://coryd.dev/feeds/books')
const entries = feed.getEntries().catch()
const res = await entries
const activity = { posts: [] }

View file

@ -41,15 +41,15 @@
type="application/atom+xml"
rel="alternate"
title="Cory Dransfeldt"
href="/feed.xml">
href="https://feedpress.me/coryd">
<link
rel="alternate"
type="application/json"
title="Cory Dransfeldt"
href="/feed.json" />
href="https://feedpress.me/coryd.json" />
<link
rel="alternate"
href="/follow.xml"
href="https://feedpress.me/coryd-follow"
title="Cory Dransfeldt's activity feed"
type="application/rss+xml">
<script type="application/ld+json">

View file

@ -4,7 +4,7 @@
<title>
{% block title %}All posts • Cory Dransfeldt{% endblock %}
</title>
<link href="{{ site.url }}/feed.xml" rel="self" />
<link href="{{ site.url }}/feeds/posts" rel="self" />
<link href="{{ site.url }}" />
<link rel="hub" href="https://pubsubhubbub.superfeedr.com/" />
<updated>{% block update %}{{ collections.posts[0].date | date: "%Y-%m-%dT%H:%M:%S-08:00" }}{% endblock %}</updated>

View file

@ -24,7 +24,7 @@ class="m-0 text-xl font-black leading-tight tracking-normal dark:text-gray-200 m
{{ title }}
</h2>
- Posts ([RSS](/feed.xml) • [JSON](/feed.json)): posts from my site.
- Links ([RSS](/links.xml) • [JSON](/links.json)): links I've liked.
- Books ([RSS](/books.xml) • [JSON](/books.json)): books I'm currently reading.
- Follow ([RSS](/follow.xml) • [JSON](/follow.json)): my activity from around the web.
- Posts ([RSS](https://feedpress.me/coryd) • [JSON](https://feedpress.me/coryd.json)): posts from my site.
- Links ([RSS](https://feedpress.me/coryd-links) • [JSON](https://feedpress.me/coryd-links.json)): links I've liked.
- Books ([RSS](https://feedpress.me/coryd-books.xml) • [JSON](https://feedpress.me/coryd-books.json)): books I'm currently reading.
- Follow ([RSS](https://feedpress.me/coryd-follow) • [JSON](https://feedpress.me/coryd-follow.json)): my activity from around the web.

View file

@ -1,6 +1,6 @@
---
layout: null
permalink: /books.xml
permalink: /feeds/books
---
{% layout "./_includes/feeds/books.liquid" %}
{% block title %}Books • Cory Dransfeldt{% endblock %}

View file

@ -1,6 +1,6 @@
---
layout: null
permalink: /feed.xml
permalink: /feeds/posts
---
{% layout "./_includes/feeds/feed.liquid" %}
{% block title %}All posts • Cory Dransfeldt{% endblock %}

View file

@ -1,6 +1,6 @@
---
layout: null
permalink: /follow.xml
permalink: /feeds/follow
---
{% layout "./_includes/feeds/follow.liquid" %}
{% block title %}Follow • Cory Dransfeldt{% endblock %}

View file

@ -1,20 +0,0 @@
---
permalink: '/books.json'
---
{
"version": "https://jsonfeed.org/version/1",
"title": "Books • Cory Dransfeldt",
"icon": "https://coryd.dev/static/images/avatar.webp",
"home_page_url": "https://coryd.dev",
"feed_url": "https://coryd.dev/books.json",
"items": [{% for book in books %}
{
"id": "{{ book.url | stripUtm | encodeAmp }}",
"title": "{{ book.title | escape }}",
"url": "{{ book.url | stripUtm | encodeAmp }}",
"content_text": "{{ book.description | strip_html }}",
"date_published": "{{ book.dateAdded | date: "%Y-%m-%dT%H:%M:%S-08:00" }}"
}{% if not forloop.last %},{% endif %}
{% endfor %}
]
}

View file

@ -1,21 +0,0 @@
---
permalink: '/feed.json'
---
{% assign posts = collections.posts | reverse %}
{
"version": "https://jsonfeed.org/version/1",
"title": "All posts • Cory Dransfeldt",
"icon": "https://coryd.dev/assets/img/avatar.webp",
"home_page_url": "https://coryd.dev",
"feed_url": "https://coryd.dev/feed.json",
"items": [{% for item in posts %}
{
"id": "{{ site.url }}{{ item.url }}",
"title": "{{ item.data.title }}",
"url": "{{ site.url }}{{ item.url }}",
"content_text": "{{ item.data.title }} {{ site.url }}{{ item.url }}",
"date_published": "{{ item.date | date: "%Y-%m-%dT%H:%M:%S-08:00" }}"
}{% if not forloop.last %},{% endif %}
{% endfor %}
]
}

View file

@ -1,21 +0,0 @@
---
permalink: '/follow.json'
---
{% assign posts = follow.posts %}
{
"version": "https://jsonfeed.org/version/1",
"title": "All activity • Cory Dransfeldt",
"icon": "https://coryd.dev/static/images/avatar.webp",
"home_page_url": "https://coryd.dev",
"feed_url": "https://coryd.dev/follow.json",
"items": [{% for item in posts %}
{
"id": "{{ item.id }}",
"title": "{{ item.title }}",
"url": "{{ item.url }}",
"content_text": "{{ item.title }} {{ item.url }}",
"date_published": "{{ item.date_published | date: "%Y-%m-%dT%H:%M:%S-08:00" }}"
}{% if not forloop.last %},{% endif %}
{% endfor %}
]
}

View file

@ -1,20 +0,0 @@
---
permalink: '/links.json'
---
{
"version": "https://jsonfeed.org/version/1",
"title": "Links • Cory Dransfeldt",
"icon": "https://coryd.dev/static/images/avatar.webp",
"home_page_url": "https://coryd.dev",
"feed_url": "https://coryd.dev/links.json",
"items": [{% for link in links %}
{
"id": "{{ link.id }}",
"title": "{{ link.title | escape }}",
"url": "{{ link.url | stripUtm | encodeAmp }}",
"content_text": "{{ link.summary | escape }}",
"date_published": "{{ link.date | date: "%Y-%m-%dT%H:%M:%S-08:00" }}"
}{% if not forloop.last %},{% endif %}
{% endfor %}
]
}

View file

@ -1,6 +1,6 @@
---
layout: null
permalink: /links.xml
permalink: /feeds/links
---
{% layout "./_includes/feeds/links.liquid" %}
{% block title %}Links • Cory Dransfeldt{% endblock %}