Skip to content
Back to Blog
RSSNext.jsSEObacklinksstatic siteHackerNoonauto cross-post blogRSS feed Next.js

How to Auto-Post to HackerNoon with an RSS Feed

Joshua R. Gutierrez6 min read

We publish blog posts on our own site and we also want them on HackerNoon, Medium, Dev.to, Hashnode, and CoderLegion. We did not want to paste every article into five editors by hand.

So we built an RSS feed into our Next.js static site and pointed HackerNoon at it. Four files, roughly 50 lines. Here is what we changed, and the one detail that silently breaks the import.

What an RSS feed actually buys you

Import, not copy-paste. HackerNoon, Medium, and Dev.to can pull articles from a feed. You publish once on your own domain and import from there.

A canonical you control. You can declare the canonical URL in the feed and in the imported article, so the syndicated copy points back to the original. Whether a platform honors that is up to the platform, so after an import goes live, open the imported page, view source, and check that the rel=canonical is pointing at your URL. Do not assume.

One source of truth. The feed is generated from the same data as the blog, so nothing drifts.

That is the honest list. We are not going to tell you what the syndicated copies did for our rankings, because we have not measured it, and a backlink count is not a ranking.

The architecture

The site is Next.js with static export. No server, no runtime API routes. Everything is pre-rendered at build time and served from a CDN.

The blog posts live in a TypeScript array in one data file. Each post has a slug, title, description, date, author, tags, and the full content as a markdown string. Publishing means adding an object to the array and pushing.

For the feed, we added a route handler at /feed.xml that emits valid RSS 2.0. Because the site is a static export, Next.js pre-renders that route into a static XML file at build time.

The feed carries both a short description and the full article body in the content:encoded element. We convert the markdown to basic HTML inline: headings, bold, links, paragraphs. Nothing clever. It only has to be readable after import.

The four files

src/app/feed.xml/route.ts. The route handler. It loops the posts, converts markdown to HTML, and returns RSS 2.0 with the dc, content, and atom namespaces, served as application/rss+xml.

layout.tsx. A link rel="alternate" type="application/rss+xml" tag in the head so browsers and crawlers can discover the feed.

sitemap.ts. Updated to list individual blog post URLs. It had only listed the /blog index.

robots.txt. A line pointing at /feed.xml.

The gotcha

HackerNoon has an RSS import in the story editor. You paste the feed URL, it lists your articles, you select the ones to import, and they land in your drafts. Publishing still goes through their editorial review.

The importer needs the full article body in content:encoded. Our first attempt only shipped the short description in the standard description element, and the importer reported that it found no articles. It did not say why. Adding the full HTML body inside content:encoded, wrapped in CDATA, fixed it on the next build.

If an RSS importer tells you your feed is empty and you can see the items in the XML yourself, check content:encoded first.

Build it yourself

Create a route handler at src/app/feed.xml/route.ts that exports a GET function. Loop your posts, build the XML, return it as a Response with content type application/rss+xml. Include the content:encoded namespace and put the full article HTML inside a CDATA block. Add the link rel="alternate" tag to your root layout head, add post URLs to the sitemap, and add the feed line to robots.txt.

Build, deploy, then fetch the feed URL and read the XML with your own eyes before you point a platform at it. Half the import failures we have seen were visible in the raw feed.

Our feed is live at axiondeepdigital.com/feed.xml. If you want a second opinion on the rest of the site, we run a free audit that loads the page in Chromium and runs 60+ checks across nine categories. It does not check for an RSS feed, which is a gap we know about.

Joshua R. Gutierrez, SEO Engineer, Axion Deep Digital

Written by

Joshua R. Gutierrez

SEO Engineer, Axion Deep Digital

SEO strategist and full-stack engineer who builds the audit tooling, then does the work. Technical SEO, Core Web Vitals, and content systems for SaaS and B2B.

View full profile & credentials →

Ready to build a website that performs?

Let us audit your current site, identify the biggest opportunities, and build a plan to grow your traffic and leads.