Publish a twtxt Microblog Feed from Your Eleventy Site
A template in an Eleventy site generates a twtxt.txt file from status.lol updates, so the site also publishes a feed that twtxt clients can follow.
- By
- Brennan Kenneth Brown
- Published
- Reading time
- 2 minutes
- Level
- Intermediate
- You need
- An Eleventy site
- A status.lol account
A twtxt feed is a plain text file that twtxt clients can follow like a feed. This guide generates one from your status.lol updates with an Eleventy template, so each status you post also appears in a twtxt feed on your own site. It uses the omg.lol API, which I've used before.
What is twtxt?
From the twtxt GitHub README:
So you want to get some thoughts out on the internet in a convenient and slick way while also following the gibberish of others? Instead of signing up at a closed and/or regulated microblogging platform, getting your status updates out with twtxt is as easy as putting them in a publicly accessible text file. The URL pointing to this file is your identity, your account. twtxt then tracks these text files, like a feedreader, and builds your unique timeline out of them, depending on which files you track. The format is simple, human readable, and integrates well with UNIX command line utilities.
In short, twtxt is a CLI tool and a format specification for self-hosted, flat-file microblogging.
How does the status.lol to twtxt sync work?
I post once on status.lol, and the update appears on social.lol, on my site, and in my twtxt.txt with no cross-posting.
At build time, Eleventy fetches the latest status updates from the omg.lol API and transforms each status from JSON to twtxt format. The timestamps are converted to ISO 8601 MST timezone, and the emoji and content are combined into a single message. The result is generated into the final /twtxt.txt file. Replace brennan in the API URL with your own omg.lol address.
// In .eleventy.js
eleventyConfig.addGlobalData("statuslog", async () => {
let json = await EleventyFetch(
"https://api.omg.lol/address/brennan/statuses/",
{ duration: "1h", type: "json" }
);
return json.response.statuses.map(status => ({
timestamp: new Date(parseInt(status.created) * 1000)
.toISOString().replace(/\.\d{3}Z$/, '-07:00'),
content: `${status.emoji || ''} ${status.content}`.trim(),
created: status.created
})).sort((a, b) => b.created - a.created);
});
Keeping the feed on your own domain means your status updates are not trapped in one ecosystem. They are plain text, readable by any client that can fetch a URL, and people can follow you from Mastodon, twtxt clients, or RSS readers. The EleventyFetch cache limits how often the build calls the API.
How do I create the twtxt.txt template?
---
permalink: /twtxt.txt
eleventyExcludeFromCollections: true
---
# nick = brennan
# url = https://brennan.day/twtxt.txt
# avatar = https://brennan.day/assets/images/brennan.jpg
# description = Queer Métis author and FOSS web developer from Treaty 7 territory
{%- for status in statuslog %}
{{ status.timestamp }} {{ status.content }}
{%- endfor %}
That's it. A header with metadata, then a loop through statuses. The TAB character between timestamp and content is what makes it valid twtxt format.
Now, when I post "🚧 Testing twtxt setup" on status.lol, it automatically appears in my twtxt feed as:
2026-01-21T10:30:00-07:00 🚧 Testing twtxt setup
Anyone can follow my feed by adding https://brennan.day/twtxt.txt to their twtxt client. No registration, no API keys, no JavaScript.
How do people follow the feed?
Anyone can follow the feed by adding https://brennan.day/twtxt.txt (or your own feed URL) to their twtxt client. No registration, API keys, or JavaScript are needed. The twtxt documentation covers the client and the format. For other ways to receive replies on a static site, see adding Webmentions to an Eleventy site.