RSS către 66 de rețele sociale: Facebook, Instagram, X, LinkedIn, Telegram și altele Blog Afiliere Contact
Autentificare Începeți gratuit
Updated: 2026-10-06
Hexo RSS Feed: Set Up hexo-generator-feed and Auto-Post

Short answer: Hexo does not create an RSS feed out of the box, but the official hexo-generator-feed plugin does. Install it with npm, add a feed: block to _config.yml to choose RSS 2.0, Atom or both, set the site url correctly so links are absolute, and rebuild. The feed is regenerated on every hexo generate, so once it is deployed, an RSS auto-poster can share each new post on social networks automatically.

Hexo is a fast Node.js static site generator that is popular for developer blogs, documentation sites and personal journals, especially those hosted on GitHub Pages, Netlify or Cloudflare Pages. Because everything is built into static files, a Hexo blog has no database and no server-side code at request time. That is great for speed and security, but it means the RSS feed must be produced during the build. This guide shows how to set it up properly, the settings that most often cause broken links or missing posts, and how to use the feed to automate social sharing.

Does Hexo have an RSS feed by default?

No. A fresh Hexo site has no feed until you add a generator. Some themes show an RSS icon in the sidebar, but the icon only links to a file such as /atom.xml; if the plugin is not installed, that link returns 404. Check it now: open your live site, add /atom.xml sau /rss2.xml to the address, and see whether XML appears.

If you see your posts in XML, the plugin is already installed and the rest of this guide helps you tune it. If you see a 404 page, start with the next section.

Install hexo-generator-feed

From the root of your Hexo project, run:

npm install hexo-generator-feed --save

The --save flag adds the plugin to package.json, which matters if your site is built by a CI service such as GitHub Actions or Netlify: the build server installs what is listed there and nothing else. Forgetting it is a common reason why the feed exists on your laptop but not on the live site.

Run hexo clean și hexo generate, and look in the public folder: you should now see atom.xml.

Configure the feed in _config.yml

The plugin works with defaults, but explicit settings make the result predictable. Add this block to the site’s _config.yml, not the theme’s:

feed:
  enable: true
  type:
    - atom
    - rss2
  path:
    - atom.xml
    - rss2.xml
  limit: 20
  content: false
  content_limit: 200
  content_limit_delim: ' '
  order_by: -date
  autodiscovery: true

What each setting does:

  • type and path choose the formats and file names. Generating both RSS 2.0 and Atom is harmless and helps tools that prefer one format.
  • limit is the number of posts in the feed. Twenty is a good default; setting it to 0 sau false includes every post, which makes the file large on an older blog.
  • content controls whether the full post HTML is included. With false, the feed carries a summary.
  • content_limit și content_limit_delim control how long that summary is and where it is cut, so you do not end a sentence in the middle of a word.
  • order_by: -date lists the newest posts first.
  • autodiscovery adds the feed link to your pages’ HTML head, so browsers and tools can find it.

Choosing between summaries and full text is a trade-off. Full content is convenient for feed readers; summaries keep social posts short and send visitors to your site. Our comparison of excerpt-only feeds and auto-posting explains the options.

Set the site URL, or every link will be wrong

This is the single most common Hexo feed bug. A new project’s _config.yml contains a placeholder:

url: http://example.com
root: /

The feed generator builds every item link from url. If it still says example.com, or uses http instead of https, every link in the feed points to the wrong place, and every auto-posted link is broken. Set it to the real address of your blog:

url: https://blog.example.com
root: /
permalink: :year/:month/:day/:title/

If the blog lives in a subfolder, for example a GitHub Pages project site at https://user.github.io/blog/, set url to the full address including the folder and root: /blog/. After rebuilding, open the feed and check that the first <link> opens the post in a browser. Broken or relative links are covered in more detail in relative URLs in RSS feeds.

Keep permalinks and IDs stable

Feed readers and auto-posters remember which items they have already seen by their ID, usually the post URL. In Hexo, that URL comes from the permalink pattern. If you change the pattern, for example from :year/:month/:day/:title/ to :title/, every post gets a new URL and a new ID, and tools may treat your entire archive as new.

Decide on a permalink pattern early and keep it. If you must change it, set up redirects for the old URLs and expect that tools may need their state reset. The same applies when moving the blog to a new domain; see why a feed auto-posts the same article twice.

Dates, drafts and future posts

Hexo reads each post’s date from its front matter. Three details affect what appears in the feed and when:

  • Time zone. Set timezone in _config.yml (for example Europe/Berlin). Without it, dates follow the build machine’s zone, which on a CI server is usually UTC.
  • Drafts. Posts in source/_drafts are not published unless you build with --draft or set render_drafts: true. Keep that off for production builds.
  • Future dates. Hexo’s future setting decides whether posts dated in the future are included. If you want to prepare posts in advance, set future: false and rebuild regularly, for example with a scheduled CI job, so each post appears when its date arrives.

Because Hexo is static, nothing changes on the live site until you build and deploy again. A post dated today does not appear in the feed until the next build runs. For a full explanation of date problems, see RSS date format errors.

Images and how posts look when shared

Social networks show a picture with each link, and that picture decides whether people stop scrolling. With a static site there are two places the image can come from:

  1. The feed item. Depending on your plugin version and template, the feed may include an image from the post’s front matter or from the post content. You can also supply your own template with the template option if you need a specific image element.
  2. The page’s Open Graph tags. Most Hexo themes call the open_graph helper in the page head. Make sure each post defines a cover image in its front matter that the theme passes to og:image.

Use absolute image URLs and images at least 1200 pixels wide. If networks show the wrong picture, read why auto-posted links show the wrong image.

Category, tag and custom feeds

The plugin generates site-wide feeds: one Atom file, one RSS file, or both. Many blogs need more than that. A developer blog might want a separate feed for release notes, or a personal site might want to send only travel posts to one social account and only programming posts to another.

There are three practical ways to do it:

  • Filter in the auto-poster. Keep one feed and let the posting tool filter items by keywords or categories. This needs no changes to Hexo at all and is usually the simplest option.
  • A custom template. The plugin’s template option lets you supply your own Nunjucks template. You can add elements, change how summaries are built or include category information that downstream tools can filter on.
  • A separate generator. Community plugins and small custom generators can produce one feed per category or tag. Check that any plugin you choose is maintained and works with your Hexo version before relying on it.

Whatever you choose, make sure categories and tags are written consistently in front matter. A post tagged JavaScript and another tagged javascript end up in different groups, and filters or hashtags built from them become messy. For routing ideas, see RSS feed category filtering.

Deploy and verify the feed

The usual build and deploy sequence is:

hexo clean
hexo generate
hexo deploy

On Netlify, Vercel or Cloudflare Pages, the build command is typically npx hexo generate with public as the output folder. After deploying:

  • open https://your-site/atom.xml și https://your-site/rss2.xml;
  • check that the newest post is at the top and its link works;
  • run the feed through the W3C Feed Validation Service;
  • view a page’s source and confirm the autodiscovery <link rel="alternate"> is present.

The plugin’s options are documented in the hexo-generator-feed repository, which is worth checking when you upgrade Hexo.

Common Hexo feed problems

SymptomCauseFix
atom.xml returns 404 on the live sitePlugin not in package.json or not builtnpm install hexo-generator-feed --save, rebuild
Links point to example.comPlaceholder url in _config.ymlSet the real https address
Links miss the subfolderWrong root on a project siteSet url și root to include the folder
New post missing from the feedSite not rebuilt, or post is a draftRun the build; move the post out of _drafts
Whole archive repostedPermalink pattern or domain changedKeep permalinks stable; add redirects
Feed very largelimit set to 0 with full contentLimit to 20 items or use summaries

Automate social sharing from a Hexo feed

Static sites have no “on publish” hook that could call social network APIs, and writing a CI step for every network means handling logins, tokens and rate limits yourself. The feed solves this neatly: it already announces every new post, so an auto-poster can watch it and publish each new item for you. Tips for Hexo:

  • deploy before you expect the post to be shared, because the auto-poster sees the post only after the new feed is online;
  • use clear, descriptive post titles, since they often become the post text;
  • write a short description or excerpt for each post so the summary reads well;
  • add tags and categories; they can be turned into hashtags.

How PostRSS works with a Hexo blog

PostRSS has been publishing RSS and Atom feeds to social networks since 2014. Paste the address of your Hexo atom.xml sau rss2.xml, connect your accounts and choose the post format. PostRSS checks the feed as often as every minute and shares each new post, with its image and link, to the networks you pick from 66 supported networks, messengers, team chats and blogs, including Mastodon, Bluesky, Telegram, Discord, DEV and Tumblr. Keyword filters, UTM parameters, hashtags from categories and posting windows are available as well. See the PostRSS features page and the plan limits on the pricing page. More guides like this are under the Technical Guide tag.

Related reading

The bottom line

A Hexo RSS feed takes one plugin and a few lines of configuration. Install hexo-generator-feed with --save, choose Atom, RSS 2.0 or both, set a sensible item limit, and above all set the real site url. Keep permalinks stable, rebuild whenever you publish, and validate the result. Then the feed can carry every new post to your social channels automatically.

FAQ

Where is the RSS feed of a Hexo blog?

With hexo-generator-feed installed, the feed is usually at /atom.xml, and at /rss2.xml if you enable RSS 2.0. The exact file names are set by the path option in the site’s _config.yml.

Why do the links in my Hexo feed point to example.com?

The url setting in _config.yml still contains the placeholder from a new project. Set it to your real https address, rebuild and deploy, and the feed links will be correct.

Should I use Atom or RSS 2.0 for Hexo?

Either works with modern readers and auto-posters. Hexo’s plugin can generate both at once, which costs nothing and helps tools that prefer one format.

Why is my new post not in the feed yet?

A static site changes only when it is rebuilt and deployed. Make sure the build ran after you added the post, and that the post is not still in the drafts folder or dated in the future.

Can I auto-post a Hexo blog to social media?

Yes. Once the feed is live, an RSS auto-poster such as PostRSS can watch it and share every new post to the networks you connect, without any changes to your Hexo build.

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.

Mai multe instrumente de la echipa noastră

Create de Internet Solutions, echipa din spatele PostRSS. Fiecare produs vă economisește timp în felul său.

PostRSS - automatizarea fluxurilor RSS și auto-postare
Prezentare Confidențialitate

Acest site utilizează cookie-uri pentru a vă putea oferi cea mai bună experiență de utilizare posibilă. Informațiile despre cookie-uri sunt stocate în browserul dumneavoastră și îndeplinesc funcții precum recunoașterea dumneavoastră atunci când reveniți pe site-ul nostru și ajutorarea echipei noastre de a înțelege care secțiuni ale site-ului sunt cele mai interesante și utile pentru dumneavoastră.