Show XYZ: neopub
03 May 2022
This description from the IndieWeb wiki describes best what neopub is1. I built neopub as because I wanted to have a micropub endpoint to be able to like stuff in monocle, post from Micro.blog and because I like doing hard things.
neopub is a blogging software developed by RobinBoers. It runs micro.geheimesite.nl and is written in PHP. It has a built-in micropub endpoint and sends webmentions. neopub is inspired by neofeed, publog and aaronparecki.com.
If you want to learn more about neopub, check the IndieWeb wiki. This post is about how and why I made it.
I wanted to set up some sort of micropub endpoint since I saw neofeed while building this blog. Recently I came across p83.nl when trying to export my subscriptions from aperture. It’s a website built by Peter Stuifzand. I felt really inspired by the design2 and the fact that he built his own blogging software3 to run the thing.
So I started working on my own thingie. I decided to use
PHP because I can run PHP applications on my webserver
without the need for an external server/VPS. I found
this minimal micropub endpoint
by Jeremy Keith and
editted it with a bit of help from the IndieWeb wiki to
write posts to a file:
In neopub, all posts are written to a JSON file in the content directory. Every year a new JSON file is created, so after a few years of use you’ll have something like this in the content directory:
At most I post once per two days, some weeks once a day. That means that in one year I accumulate around 250-300 posts. I think the server will be able to handle rendering that, so I’m not really woried about performance.
On the pages for tags or post types only posts from the current year are visible. I wanted older posts to be hidden by default. You can of course still access them via their permalink or using for example: https://micro.geheimesite.nl/posts/20214.
That’s about it. I’m planning on adding some more features, like:
- Being able to change/delete posts
- A media endpoint for uploading photos
If you want you can find the source code on GitHub
This was also posted to /en/indieweb.