Pagefind and Micro.blog actions
Today I added support for Pagefind to Micro.blog. Pagefind is a search library for static sites. Because Micro.blog uses Hugo underneath, Pagefind fits nicely into our architecture.
You can see it in action on my own blog’s search page.
Along the way to adding this, I realized we could extend more of Micro.blog’s publishing. Because Pagefind runs on your built HTML pages, after your Markdown goes through Hugo, we needed a hook into the processing of your blog. I’m calling these actions. There are a few now and will be more later.
You will find an Edit Actions button on the blog settings page. When adding a new action, you’ll see these options:
Each action can run either right after Hugo, but before Micro.blog finishes publishing your blog to our servers, or after everything is done. You can imagine in the future other useful tools that could be tacked on to this, such as our existing GitHub backups or maybe uploading via SFTP to other servers.
I’ve added a new “Ping” action that sends a POST to another server. This sends simple JSON with a url field for your blog. I’ve also moved the Wayback Machine copy into this part of the interface, but kept the old checkbox for convenience for now.
Have other ideas for actions? We can add more and hopefully open it up to plug-ins later. And of course this is optional, so it’s mostly tucked away in the UI.