Cross posting from a next.js blog to

[Nov 13, 2020]

I like the idea of, and I’ve lazily cross-posted my blog to the site via RSS for a while, but the feed always ended up in the format of [post title] - [link to post], which doesn’t capture the spirt of microblogging.

I reworked the RSS feed in general when updating this site to next.js, but I thought I'd take a stab at getting crossposting working too.

Since I couldn’t find much in their documentation on what parameters were used to construct the feed from an RSS feed, I found users who were cross posting, looked at their feeds, and then tested out a couple posts to see how they showed up on the timeline.


  1. It's much easier to use a JSON feed. This is perhaps not surprising since Manton Reece drafted the spec and created
  2. Microblogging is strongly against using titles for posts.

I ended up taking the same loop my index page uses (gets every single markdown post, but then returns the latest ten) and running it through this function:

import siteConfig from "../data/config.json";
var md = require("markdown-it")();

const makeJsonFeed = (posts) => {
 const feed = {
   feed_url: siteConfig.jsonURL,
   title: siteConfig.description,
   home_page_url: siteConfig.siteUrl,
   author: {
     url: siteConfig.siteUrl,
 const items = => {
   return {
     author: {
       url: siteConfig.siteUrl,
     id: `${siteConfig.siteURL}${post.slug}`,
     url: `${siteConfig.siteURL}${post.slug}`,
     content_html: md.render(post.markdownBody),
 feed.items = items;

 return JSON.stringify(feed);

export default makeJsonFeed;

And on the index route, I use it like this:

const jsonFeedObj = makeJsonFeed(postsToUse);
fs.writeFileSync("./public/rss/feed.json", jsonFeedObj);

While I do have titles on most of my posts, they are optional, and I chose to leave them off the JSON feed. If they are added, goes back to the [post title] - [link to post] I was trying to get away from!

You can see the result at my timeline or in the JSON feed.