Feedsαπό την Internet Solutions

Adding RSS to a Static Site: Hugo, Jekyll, Eleventy and Astro

26 Αυγούστου 20268 λεπτά ανάγνωσηςΡοές RSS
Adding RSS to a Static Site: Hugo, Jekyll, Eleventy and Astro

Short answer: Static site generators build feeds at build time, just like pages. Hugo creates RSS for the home page and sections out of the box; Jekyll uses the official jekyll-feed plugin to produce an Atom feed; Eleventy uses its official RSS plugin with a small template; and Astro uses the @astrojs/rss package in an endpoint file. In every case, set the site’s absolute base URL, include full dates with time zones, use permanent IDs, add an autodiscovery link to your layout, and validate the output after each deploy.

Static sites are popular with developers, documentation teams and anyone who wants a fast, secure site without a database. Their feeds, however, are often an afterthought: a template copied from a starter theme years ago, a feed that shows relative links, or no feed at all because nobody enabled it. Because a static feed is generated once per build and served as a plain file, it is extremely reliable once it is right. This guide explains how to get it right in the four most common generators, and what to check whichever tool you use.

How feeds work on static sites

On a dynamic platform such as WordPress, the feed is generated on request from the database. On a static site, the generator writes the feed file during the build, exactly like an HTML page, and the web server or CDN serves it as a file. This has consequences:

Hugo

Hugo generates RSS feeds by default for the home page, sections and taxonomy terms, using an internal RSS template. The home page feed is at /index.xml, and each section has its own, such as /posts/index.xml. Key settings:

Most Hugo themes include the autodiscovery link using Hugo’s output formats in the head partial. If your theme does not, add a link rel="alternate" for the RSS output format.

Jekyll

Jekyll’s standard solution is the official jekyll-feed plugin, which GitHub Pages also supports. After adding it to your Gemfile and the plugins list in the configuration, it generates an Atom feed at /feed.xml. Points to know:

Eleventy

Eleventy provides an official RSS plugin, @11ty/eleventy-plugin-rss. Recent versions can generate a feed from a collection through a virtual template with a few lines of configuration, while older setups use a Nunjucks or Liquid template with filters provided by the plugin. The plugin’s filters handle the tricky parts:

Define your production URL in a global data file, use it in the feed template and layout, and add the autodiscovery link to your base layout. Eleventy lets you produce Atom, RSS or JSON Feed; pick one as your main feed.

Astro

Astro uses the @astrojs/rss package. You create an endpoint file, commonly src/pages/rss.xml.js, that returns the result of the package’s rss() function with a title, description, site URL and a list of items built from your content collection. Details:

Checks that apply to every generator

Check Why it matters
Absolute base URL set to production Links and images work in every reader
Permanent IDs that do not change on rebuild No duplicates when you restructure
Dates with times and time zones Correct order and “new” detection
Limited number of items Fast fetching, small files
Autodiscovery link in the layout head Readers find the feed from any page
Correct Content-Type from the host Tools recognise the file as a feed
Validation after each significant change Catches template regressions

Scheduled posts, drafts and rebuilds

Static sites often publish on a schedule: you write a post with a future date, and it appears when the next build runs after that date. If builds only run when you push code, a scheduled post will not appear until the next push. Most hosting platforms allow scheduled builds, for example once an hour or once a day, or you can trigger builds with a cron job. Also make sure drafts and future posts are excluded from feeds in production; most generators do this by default, but custom templates sometimes include everything in a collection.

Other generators and frameworks

The same principles apply to generators not covered above. Gatsby, Next.js, Nuxt, Zola, Pelican, MkDocs and many others either have an official feed plugin or make it easy to write one. When evaluating any option, check that it:

For documentation sites, a feed of release notes or changelog entries is often more valuable than a feed of every page, because readers want to know what changed, not every edit to a reference page.

Moving an existing feed to a new generator

When migrating from WordPress or another generator, the feed URL and item IDs are the two things to protect. Keep the old feed path working, either by generating the feed at the same path or with a permanent 301 redirect, and reuse the old IDs where possible. If the old feed used permalinks as guids and your URLs are unchanged, IDs will match automatically. If URLs change, readers will see the recent items once more as new; that is usually acceptable, but warn your most important consumers, such as partners or newsletter tools.

If you also need to follow sites that do not publish any feed, or combine your static site’s feed with other sources for a partner or a dashboard, our tool, Feeds, can create feeds from pages without RSS and merge several sources into one link with keyword filters. Nothing needs to be installed on the source sites. See the plans.

Related reading

The bottom line

Every major static site generator can publish a clean feed with a small amount of setup: Hugo does it natively, Jekyll and Eleventy through official plugins, Astro through its RSS package. The details that make or break a static feed are the same everywhere: the production base URL, permanent IDs, full dates, a sensible item limit, autodiscovery and regular validation. Get those right once and the feed will serve you quietly for years.

FAQ

Does Hugo create an RSS feed automatically?

Yes. Hugo generates RSS for the home page, sections and taxonomy terms by default, for example at /index.xml. Set baseURL correctly and consider limiting the number of items and customising the template for full text.

How do I add a feed to a Jekyll site?

Add the jekyll-feed plugin, set url in _config.yml, and put {% feed_meta %} in your layout head. The plugin generates an Atom feed at /feed.xml, and GitHub Pages supports it.

Why do links in my static site’s feed not work?

The generator is probably producing relative URLs or using the wrong base URL. Set the production URL in the configuration and make sure links inside content are converted to absolute URLs.

Why doesn’t my scheduled post appear in the feed?

Static feeds are only updated when the site is rebuilt. If no build runs after the post’s date, the post and the feed stay unchanged. Set up scheduled builds on your host.

Should a static site publish RSS, Atom or JSON Feed?

Any of them works. Choose one as the main feed, advertise it with an autodiscovery link, and add others only if your audience needs them.

#CMS#Feed formats#Publishing#RSS
Δημιουργήστε την πρώτη σας ροή — δωρεάν.Ροή από οποιαδήποτε σελίδα. Κάθε προϊόν σε κάθε κατάλογο.
Ξεκινήστε δωρεάν

Περισσότερα από το blog

Όλα τα άρθρα →
Internet Solutions

Περισσότερα από την ομάδα μας

Από την Internet Solutions. Δοκιμάστε και τα άλλα προϊόντα μας — το καθένα σας εξοικονομεί χρόνο με διαφορετικό τρόπο.

internet-solutions.net ↗
Αυτόματες αναρτήσεις στα socialΖωντανά
PostRSS

Οι νέες αναρτήσεις από τη ροή RSS σας πηγαίνουν αυτόματα σε Facebook, X, LinkedIn, Telegram και σε 60+ ακόμη δίκτυα.

Δωρεάν πλάνο · από το 2014Επίσκεψη →
Ζωντανή συνομιλία AI για ιστοσελίδεςΖωντανά
Talkmio

Η ιστοσελίδα σας απαντά στους επισκέπτες 24/7 από το δικό σας περιεχόμενο, στη γλώσσα τους.

Δωρεάν πλάνο · χωρίς κάρταΕπίσκεψη →
AI βοηθόςΖωντανά
Ask Mio

Συνομιλία, κώδικας, σχεδιασμός, γραφή και έρευνα. Το Mio επιλέγει το καλύτερο μοντέλο για κάθε εργασία.

Δωρεάν πλάνοΕπίσκεψη →
AI αυτόματος πιλότος για blog και socialΖωντανά
AI Blog Autopilot

Η AI γράφει άρθρα SEO 2.000–3.000 λέξεων και κοινοποιεί το καθένα σε 58+ κοινωνικά δίκτυα.

Τα 3 πρώτα άρθρα δωρεάνΕπίσκεψη →
Έλεγχος υγείας ιστοσελίδαςΖωντανά
Site AI Audit

SEO, ταχύτητα, SSL, ασφάλεια και ρύθμιση email σε μία αναφορά, ταξινομημένα με βάση τι πρέπει να διορθωθεί πρώτα.

Ο πρώτος έλεγχος δωρεάνΕπίσκεψη →
Σε βάθος SEO crawlΖωντανά
Site SEO AI Audit

Πλήρες SEO crawl σε 7 τομείς, μαζί με την ορατότητα στην αναζήτηση AI, με διορθώσεις ταξινομημένες κατά αντίκτυπο.

Ο πρώτος έλεγχος δωρεάνΕπίσκεψη →
Ανάπτυξη ιστοσελίδων και SEOΖωντανά
Internet Solutions

Ιστοσελίδες, e-shops και εξειδικευμένα συστήματα — τα σχεδιάζει, τα αναπτύσσει και τα υποστηρίζει η ομάδα μας.

Από το 2011Επίσκεψη →
Feeds
Επισκόπηση απορρήτου

Αυτός ο ιστότοπος χρησιμοποιεί cookies ώστε να σας προσφέρουμε την καλύτερη δυνατή εμπειρία. Οι πληροφορίες των cookies αποθηκεύονται στον browser σας και εξυπηρετούν λειτουργίες όπως την αναγνώρισή σας όταν επιστρέφετε και τη βοήθεια προς την ομάδα μας να καταλάβει ποιες ενότητες του ιστοτόπου βρίσκετε πιο ενδιαφέρουσες και χρήσιμες.