RSS a 66 redes sociales: Facebook, Instagram, X, LinkedIn, Telegram y más Blog Afiliados Contactos
Iniciar sesión Empezar gratis
Updated: 2026-10-27
Eleventy RSS Feed: Plugin, Template and Absolute URLs

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.

Why an Eleventy site needs a feed

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 y Astro.

Install the plugin

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-dev

The 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 virtual template: a complete feed in one block

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.

Create the posts collection

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.

Why absolute URLs matter

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.

Where each field comes from

Feed elementEleventy sourceRule
Titletitle in front matterPlain text, no markup
LinkPage address plus baseAbsolute, https, returns 200
Datedate in front matter or file nameFixed once published, never the build time
Descriptionsummary in front matterOne or two sentences
Feed languagemetadata languageA valid language code such as en
Feed addressoutputPath optionNever 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.

More than one feed

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.

Make the feed discoverable

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.

Build and test the feed

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.xml

Work through a short list of checks:

  • Confirm a 200 status and that the file starts with an XML declaration and an rss element.
  • Confirm that every link is absolute, uses https and points to your real domain.
  • Paste the public address into the W3C Feed Validation Service and fix every error.
  • Check that the newest post is first and that every date is correct and in the past.
  • Rebuild without changing anything and confirm that no item changed its address or date.

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.

Publishing and scheduling on a static host

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.

Common mistakes to avoid

  • Wrong sort for a custom collection. The feed shows your oldest posts; use the descending sort.
  • Missing base address. Links in the feed are wrong for every outside reader.
  • No summary. Items arrive with only a title or an automatic excerpt.
  • Changing the output path. Every stored subscription breaks silently.
  • Drafts and future posts in the collection. An auto-poster shares unfinished work.
  • Old plugin version. Check that the plugin version matches your Eleventy release before you follow any example.

How PostRSS works with an Eleventy feed

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.

Lectura relacionada

The bottom line

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.

FAQ

Does Eleventy have a built-in RSS feed?

Eleventy itself does not, but the official feed plugin creates RSS, Atom or JSON feeds from any collection with a few lines of configuration.

Why does my Eleventy feed show my oldest posts?

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.

How do I add a summary to each item?

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.

Can I schedule Eleventy posts for a future date?

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.

Can I use this feed with PostRSS?

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.

New guides, once a month

What changed in the networks, what broke, and how to fix it before it costs you reach.

We send a confirmation e-mail first. Unsubscribe any time.

Más herramientas de nuestro equipo

Creadas por Internet Solutions, el equipo detrás de PostRSS. Cada una te ahorra tiempo a su manera.