Another Eleventy content syndication path

After posting and discussing my post from yesterday with Nicolas Hoizey I decided to explore his suggested path and explore using a GitHub action to handle posts to Mastodon, rather than Make. Nicolas, thankfully, has an action that supports exactly this path. It currently supports JSON feeds, with planned support for Atom/RSS.[1]

For now, to surface my Eleventy activity feed as JSON, we peak under the hood of @11ty/eleventy-activity-feed and, rather than calling toRssFeed, call getEntries and use the merged feed data it returns as JSON to construct a follow.json feed in src/_data/follow.js[2]

module.exports = async function () {
  const { ActivityFeed } = await import('@11ty/eleventy-activity-feed')
  const feed = new ActivityFeed()
  feed.addSource('atom', 'Blog', '')
  feed.addSource('rss', 'Letterboxd', '')
  feed.addSource('rss', 'Glass', '')
  feed.addSource('rss', 'Oku', '')
  const entries = feed.getEntries()
  const res = await entries
  const activity = { posts: [] }
  res.forEach((entry) =>
      id: entry.url,
      title: entry.title,
      url: entry.url,
      content_html: entry.content || '',
      date_published: entry.published,
  return activity

We can then render this to our desired feed in follow.11ty.liquid:

permalink: '/follow.json'
{% assign posts = follow.posts %}
"version": "",
"title": "All activity • Cory Dransfeldt",
"icon": "",
"home_page_url": "",
"feed_url": "",
"items": [{% for item in posts %}
  "id": "{{ }}",
  "title": "{{ item.title }}",
  "url": "{{ item.url }}",
  "content_html": "",
  "date_published": "{{ item.date_published | date: "%Y-%m-%dT%H:%M:%S-08:00" }}"
  }{% if not forloop.last %},{% endif %}
{% endfor %}

Finally, we skip the Make-dependent portion of this exercise and leverage a cron-based action:

name: Scheduled follow feed to Mastodon
    - cron: '0 * * * *'
    runs-on: ubuntu-latest
      - name: Checkout
        uses: actions/checkout@v3
      - name: Feed to Mastodon
        uses: nhoizey/github-action-feed-to-mastodon@v2
          feedUrl: ""
          mastodonInstance: ""
          mastodonToken: ${{ secrets.MASTODON_TOKEN }}
          testMode: true
      - name: Pull any changes from Git
        run: git pull
      - name: Commit and push
        uses: stefanzweifel/git-auto-commit-action@v4

GitHub will now check the follow.json feed and post updates hourly.

  1. This is also the part where I should make the time to try and add support for this and contribute the change. ↩︎

  2. The JSON Feed site provides a validator and this feed validates, but I'm returning an empty content_html field to satisfy their schema. This is in large part because returning properly sanitized and formatted html inside a string got messier than I would have liked and is not strictly necessary for my purposes here. ↩︎

Cory Dransfeldt Cory Dransfeldt

I'm a software developer in Camarillo, California. I enjoy hanging out with my beautiful family and 4 rescue dogs, technology, automation, music, writing, reading and tv and movies.