
Short answer: To add an RSS feed to a Lume site, import the feed plugin in _config.ts and call site.use with an output file such as /feed.rss, a query that selects your posts, a limit and the fields of each item. Set the location of the site so that every link in the feed is absolute, give every post an explicit date, add a discovery link to your layout, build the site, check the generated file with curl and a validator and give its public address to an auto-poster. New posts are then shared on your social channels as soon as the next build is published.
Lume is a static site generator for Deno. It turns markdown, templates and data files into plain pages that any host can serve, and it is popular for blogs, documentation and small business sites because the build is quick and the configuration is a single TypeScript file. A site like that usually publishes things people want to follow, such as articles, release notes or announcements, and a feed is the standard way to let readers, aggregators and auto-posters watch them without an account. Lume ships a feed plugin for exactly this job, so you do not have to write the XML yourself. This guide shows the full setup, explains the options that matter, and ends with the checks that keep the feed dependable after you connect other systems to it.
A static site has no database that a visitor can query, so a feed is often the only machine-readable list of what is new. Readers who follow it in a feed reader receive every post in order. Search engines and aggregators discover fresh pages faster. And an auto-poster such as PostRSS can read the same file and share each new item on social networks, which turns a quiet publishing routine into a steady stream of visitors without extra work after each release.
If you are comparing generators, the same ideas are covered for Hexo, Zola și Astro. If you already know your site produces a feed somewhere and only need its address, read which RSS feed URL to use.
The feed plugin is part of Lume, so there is nothing to install. Open _config.ts and register it. The configuration below creates a feed of the newest posts, written to the output folder as /feed.rss and also as a JSON feed for tools that prefer it. It also sets the location of the site, which Lume uses to build absolute addresses.
// _config.ts
import lume from "lume/mod.ts";
import feed from "lume/plugins/feed.ts";
const site = lume({
location: new URL("https://example.com"),
});
site.use(feed({
output: ["/feed.rss", "/feed.json"],
query: "type=post",
sort: "date=desc",
limit: 20,
info: {
title: "Example Journal",
description: "News and guides from Example Journal.",
lang: "en",
authorName: "Example Journal",
},
items: {
title: "=title",
description: "=excerpt",
published: "=date",
content: "=children",
categories: "=tags",
lang: "=lang",
},
}));
export default site;The options are short but each one matters. The query selects pages, here every page whose type variable is post. The sort option orders them by date, newest first, and the limit keeps the file small; by default the plugin includes only the ten newest items, so raise it if your readers or tools expect a longer history. The extension of the output file chooses the format: the rss extension produces RSS and the json extension produces a JSON feed.
The query only works if your posts carry the variable it looks for. The simplest approach is a data file in the posts folder, so that every page inside it receives the same type, layout and tags without repeating them. Each post then needs a title, a date and an excerpt of one or two sentences.
# posts/_data.yml
type: post
layout: layouts/post.vto
tags:
- news
# posts/2026-10-27_hello-lume.md
---
title: Hello, Lume
date: 2026-10-27 09:00:00
excerpt: A short note on how this site publishes new posts.
---
The body of the post goes here.Write the date explicitly. A feed is sorted by it, and every auto-poster uses it to decide what is new. If a page has no date, a generator may fall back to a file timestamp, and on a build server that is often the moment the repository was checked out, which makes old posts look new after every deployment. An explicit date in the front matter or in the file name removes the guesswork.
Feed readers and auto-posters fetch your feed from outside your site, so a relative address such as /blog/hello-lume/ means nothing to them. The location option in the example above tells Lume which domain the site will be served from, and the plugin uses it to write absolute links for items and for the feed itself. Without it, links can point to the local development address and look correct on your own computer while failing everywhere else. After the first build, open the generated file and confirm that every link starts with your real domain and uses https; the reasons are explained in why relative URLs break feed links.
If you publish from a CI service, pass the location as a command line option or an environment variable in the build step, so that preview builds do not leak a staging address into a feed that is later cached. Staging feeds cause real trouble when an auto-poster finds one; see staging sites and RSS auto-posting.
The items option maps Lume variables to feed fields. Each decision changes what readers and auto-posters see:
You can also read values from the rendered page with a CSS selector, for example taking the content from the element that holds the article body, and define fallbacks with double vertical bars, so that a missing excerpt falls back to a different field. Keep fallbacks simple; every extra rule is one more thing that can silently produce an empty field.
| Feed element | Lume source | Rule |
|---|---|---|
| Title | title variable | Plain text, no markup |
| Link | Page address plus location | Absolute, https, returns 200 |
| Published date | date variable | Set in front matter, never the build time |
| Summary | excerpt variable | One or two sentences |
| Categorii | tags variable | Short, consistent names |
| Feed address | output 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 break every connection. Choose a path once, such as /feed.rss, and keep it. If you must move it, leave a copy at the old address.
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. 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, including how to add several feeds to one site, are in the guide to feed autodiscovery.
<!-- in layouts/base.vto, inside head -->
<link rel="alternate" type="application/rss+xml"
title="Example Journal" href="https://example.com/feed.rss">Use the address exactly as it is served, and keep the link on every page, not only on the home page.
Run the build and look at the output before you publish anything. The commands below build the site once and then serve the output folder locally, so you can fetch the file with curl as an outside tool would.
deno task build
deno task serve
curl -i http://localhost:3000/feed.rssThen work through a short list of checks:
There is a longer checklist in the feed validation guide and a short routine in the guide to debugging a feed with curl. Remember that a static host may serve the correct content type only if the file extension is known to it; if your host sends the file as plain text, see the content type header guide.
A static site contains only what existed at the last build. That has two consequences for a feed. First, 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. Second, 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 posts dated in the future out of the build. Lume can exclude pages marked as drafts from production builds, which is a convenient way to hold back work in progress; keep drafts out of the feed query so an auto-poster never shares an unfinished article.
Whatever setup you choose, avoid republishing old posts by accident. Moving files, changing a slug or editing the date in front matter changes what a feed contains, and an auto-poster may treat the changed item as new. The reasons 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 Lume 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.
Lume needs one plugin call to publish a dependable feed: register the feed plugin, select your posts with a query, sort by date, raise the limit if you publish often and map the title, summary, date and tags to the item fields. Set the location of the site so links are absolute, write an explicit date for every post, add a discovery link to your layout, rebuild whenever content changes, 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.
Yes. Lume includes a feed plugin that generates RSS and JSON feeds from any collection of pages, so you only configure it in _config.ts and rebuild the site.
The location of the site is not set. Pass a URL with your real domain in the options of the lume function, or as a build option on your CI service, and rebuild.
The default is ten. Set the limit option to a higher number if you publish often or want readers and tools to see a longer history.
Not by itself, because a static site contains only what existed at the last build. Use a scheduled rebuild and keep future-dated or draft pages out of the build and out of the feed query.
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.
Create de Internet Solutions, echipa din spatele PostRSS. Fiecare produs vă economisește timp în felul său.