
Short answer: To add an RSS feed to an Eleventy site, install the official feed plugin with npm, register it in your Eleventy configuration with the feedPlugin helper, choose the rss type, an output path such as /feed.xml and the posts collection, set the language, title, subtitle and base address in the metadata, and give each post a date and a short summary. The plugin writes absolute URLs for you. Build the site, check the generated file with curl and a validator, then give its public address to an auto-poster so new posts are shared automatically.
Eleventy is a flexible static site generator for JavaScript. It reads templates, markdown and data and writes plain files, and it does not assume what you are building, which is why it is used for blogs, documentation, portfolios and company sites alike. Because the output is static, a feed has to be generated at build time, and the official feed plugin does exactly that. It supports RSS, Atom and JSON feeds, normalises links to absolute addresses and can be configured in a few lines. This guide walks through the complete setup, explains the choices that matter, and ends with the checks that keep the feed dependable after you connect an auto-poster to it.
A static site has no database or interface that outside tools can query, so a feed is often the only machine-readable list of what is new. Readers who follow it get every post in order, search engines and aggregators discover pages faster, and an auto-poster such as PostRSS can share each new item on social networks as soon as it appears. For a small team that publishes occasionally, that is the difference between an announcement that quietly sits on the site and one that reaches the people who might read it.
If you only need to find the address of a feed that your site already produces, read how to find your Hugo, Jekyll or Eleventy feed. If you are comparing generators, the same ideas are covered for Hexo, Zola và Astro.
The feed plugin is published on npm as a separate package. Version 3 is written as an ES module and needs Eleventy 3 or newer; older versions of the plugin exist for older releases of Eleventy, so check which one matches your project before you start. Install it as a development dependency:
npm install @11ty/eleventy-plugin-rss --save-devThe helper functions of version 3 are named exports. If your configuration file is an ES module, import them directly. If it is a CommonJS file, follow the instructions in the plugin documentation for your Node version, because the way of loading an ES module differs between releases.
The simplest way to create a feed is the virtual template. You describe the feed in the plugin options and the plugin creates the template for you, so no extra file is needed in your project. Add the following to eleventy.config.js:
// eleventy.config.js
import { feedPlugin } from "@11ty/eleventy-plugin-rss";
export default function (eleventyConfig) {
eleventyConfig.addPlugin(feedPlugin, {
type: "rss",
outputPath: "/feed.xml",
collection: {
name: "posts",
limit: 20,
sort: "descending",
},
metadata: {
language: "en",
title: "Example Journal",
subtitle: "News and guides from Example Journal.",
base: "https://example.com/",
author: {
name: "Example Journal",
},
},
});
}Each option has a purpose. The type chooses the format; the plugin supports atom, rss and json, with atom as the default. The output path is where the file is written inside the output folder. The collection name tells the plugin which collection to list, the limit keeps the file small, and a limit of zero means no limit. The sort option controls the order before the limit is applied: the automatic setting reverses the collection on the assumption that Eleventy lists the oldest item first, while the descending setting sorts by date regardless of how the collection was built. Use descending for custom collections, because a custom collection that is already newest first would otherwise produce a feed of your oldest posts. The metadata block fills in the feed title, description, language, author and the base address.
The default template is written in Nunjucks, so make sure that format is among the template formats your project processes. Most projects already include it.
The plugin needs a collection that contains your posts. The simplest approach is a directory data file that tags every page in the posts folder, so that you do not repeat the tag in each file.
// posts/posts.json
{
"tags": "posts",
"layout": "layouts/post.njk"
}
// posts/2026-10-27-hello-eleventy.md
---
title: Hello, Eleventy
date: 2026-10-27
summary: A short note on how this site publishes new posts.
---
The body of the post goes here.Give every post a date and a summary. Eleventy can take the date from the front matter or from a date at the start of the file name, and the feed is sorted by it, so an explicit value removes the guesswork. The summary is used for the description of each item in an RSS feed, and for the summary element in Atom. If a post has no summary, readers and auto-posters see only the title, or an automatic excerpt that may not read well.
Feed readers and auto-posters fetch your feed from outside your site, so a relative address such as /blog/hello-eleventy/ means nothing to them. The plugin turns the links of the items and the links inside the content into absolute addresses based on the base value in the metadata, and it applies the transforms of your project, which also normalises a path prefix if you deploy to a subfolder. Check after the first build that every link starts with your real domain and uses https, and that the base value has no typing mistake. The reasons relative links fail are explained in why relative URLs break feed links.
| Feed element | Eleventy source | Rule |
|---|---|---|
| Title | title in front matter | Plain text, no markup |
| Link | Page address plus base | Absolute, https, returns 200 |
| Date | date in front matter or file name | Fixed once published, never the build time |
| Description | summary in front matter | One or two sentences |
| Feed language | metadata language | A valid language code such as en |
| Feed address | outputPath option | Never changes once published |
The address of the feed itself deserves the most care. Subscribers and auto-posters store it, so if you rename the file you silently break every connection. Pick a path once, such as /feed.xml, and keep it. If you must move it, leave a copy at the old address.
Many sites need several feeds: one for all posts, one for a changelog and one for a topic. The plugin supports this with a helper that returns the content and data of the same feed template, which you then add as a template with a different output path. You can also create a collection per topic and register the plugin once for each. Whatever you choose, give each feed a stable address, a clear title and its own collection, and describe each in the head of your layout so that tools can discover them. Splitting feeds by topic is also the cleanest way to send different content to different social channels, as explained in category filtering for auto-posting.
Add a link element to the head of your base layout so browsers, feed readers and tools can find the feed from any page. It needs a rel value of alternate, a type of application/rss+xml, a title and the address of the feed. The plugin also provides a filter for building absolute addresses, which is useful if you want the link in the head to be absolute as well.
<!-- in the head of your base layout -->
<link rel="alternate" type="application/rss+xml"
title="Example Journal" href="https://example.com/feed.xml">With that in place, a visitor or an auto-poster that only knows your home page can locate the feed on its own. The details are in the guide to feed autodiscovery.
Run the build and look at the output before you publish anything. Then fetch the file the way an outside tool would:
npx @11ty/eleventy
npx @11ty/eleventy --serve
curl -i http://localhost:8080/feed.xmlWork through a short list of checks:
There is a longer checklist in the feed validation guide and a short curl routine in the guide to debugging a feed with curl. If your host serves the file with the wrong content type, see the content type header guide.
A static site contains only what existed at the last build. A new post appears in the feed only after you rebuild and deploy, so make sure your host or CI service rebuilds whenever content changes. If you want to schedule posts for a future date, you need a scheduled rebuild, for example a daily job, and a condition that keeps future-dated posts out of the collection until their time arrives. Eleventy does this with a small filter or a computed property in your collection logic. Without it, a post dated tomorrow can appear in today’s feed, and an auto-poster will share it before it exists on the website.
Avoid republishing old posts by accident. Renaming a file, changing a slug or editing the date changes what the feed contains, and an auto-poster may treat the changed item as new. The causes and the fixes are covered in why a feed auto-posts the same article twice.
PostRSS has been publishing RSS and Atom feeds to social networks since 2014. Paste the address of your Eleventy feed, connect your accounts and choose how each post is built from the title, the description or the page title. PostRSS checks the feed as often as every minute and shares each new item, with its image and link, to the channels you choose among 66 supported networks, messengers, team chats and blogs, including LinkedIn, X, Bluesky, Mastodon and Telegram. Keyword filters, UTM parameters and posting windows let you tune each channel, and webhooks connect PostRSS to your own systems. See the PostRSS features page and the plan limits on the pricing page. More developer guides are under the Technical Guide tag.
Eleventy needs one plugin and one configuration block to publish a dependable feed: install the official feed plugin, register it with the feedPlugin helper, pick the type, the output path and the posts collection, sort newest first, fill in the metadata with the language, title, subtitle and base address, and give every post a date and a summary. Add a discovery link to your layout, rebuild whenever content changes, keep future-dated posts out of the collection, test the generated file with curl and a validator, keep its address unchanged and connect it to an auto-poster. After that, every post you publish can reach your readers and your social channels automatically.
Eleventy itself does not, but the official feed plugin creates RSS, Atom or JSON feeds from any collection with a few lines of configuration.
The collection is probably already sorted newest first, and the default sort reverses it. Set the sort option of the collection to descending so the plugin orders by date.
Add a summary field to the front matter of the post. The plugin uses it for the description of an RSS item and for the summary of an Atom entry.
Only with a scheduled rebuild and a rule that keeps future-dated posts out of the collection until their date, because a static site contains only what existed at the last build.
Yes. PostRSS reads any valid RSS or Atom address that is reachable without a login. Paste the address, connect your channels and new items are shared as soon as they appear.
What changed in the networks, what broke, and how to fix it before it costs you reach.
Do Internet Solutions, đội ngũ đứng sau PostRSS, phát triển. Mỗi sản phẩm giúp bạn tiết kiệm thời gian theo một cách riêng.