feat: json follow feed + github actions to post

This commit is contained in:
Cory Dransfeldt 2023-03-28 10:53:42 -07:00
parent 55b45b8305
commit 02e444e25e
No known key found for this signature in database
4 changed files with 67 additions and 0 deletions

13
src/_data/follow.js Normal file
View file

@ -0,0 +1,13 @@
module.exports = async function () {
const { ActivityFeed } = await import('@11ty/eleventy-activity-feed')
const feed = new ActivityFeed()
feed.addSource('atom', 'Blog', 'https://coryd.dev/feed.xml')
feed.addSource('rss', 'Letterboxd', 'https://letterboxd.com/cdme/rss')
feed.addSource('rss', 'Glass', 'https://glass.photo/coryd/rss')
feed.addSource('rss', 'Oku', 'https://oku.club/rss/collection/NvEmF')
const entries = feed.getEntries()
const res = await entries
const activity = { posts: [] }
res.forEach((entry) => activity.posts.push({ title: entry.title, url: entry.url }))
return activity
}

14
src/follow.11ty.liquid Normal file
View file

@ -0,0 +1,14 @@
---
permalink: '/follow.json'
---
{% assign posts = follow.posts %}
{
"posts": [
{% for item in posts %}
{
"title": "{{ item.data.title }}",
"url": "{{ item.url }}"
}{% if not loop.last %},{% endif %}
{% endfor %}
]
}