Scott Andrew

Posted January 28, 2025.

Integrating Eleventy with Buttondown to create subscribers-only content

The real reason I wanted to shrinkwrap the Eleventy Edge plugin was to finish another project I'm tinkering with: a sample integration of Buttondown with Eleventy to create subscribers-only content.

For example, if you were, say, subscribed to the Neat Hobby! Newsletter, you might be able to see the cool thing on this page.

There's actually a LOT of subscriber-only content on Neat Hobby! — bonus comics, a hidden blog, etc. — but the only way to see it was to follow hidden links I only include in the newsletter. Those links are otherwise unprotected and that's fine, I don't mind if they get shared. But what I really wanted was something like what Ghost has, where hidden features and content can be unlocked for subscribers by just checking an email address.

And then something cool happened: Buttondown recently made their API free of charge. Kind of a big deal! Now I can use an edge function to call the API and check if an email is subscribed to the newsletter, then use the Eleveny Edge plugin to conditionally render content based on that check. No password required! Exactly the amount of friction I was aiming for.

All the current code is here, minus my site-specific tweaks. If you're curious, see the article Building A Membership Site With 11ty for more about the concepts I used to build this.