Posting to Your Static Site with Quill and Micropub
After building an IndieAuth comment system, I wanted to complete the loop by posting content to my site from an external client. Here's how I implemented a Micropub endpoint for my static site using Quill as the client.
few posts ago, I wrote up about how I [used IndieAuth to create a comment system](https://brennan.day/setting-up-decap-cms-with-jekyll-a-real-world-example/) for my static site. The next stepped seemed to naturally be to add the ability to post content myself to my site from external clients.
I've tried different solutions for this in the past, [headless CMS like Decap](https://brennan.day/setting-up-decap-cms-with-jekyll-a-real-world-example/), but Micropub seemed like a more elegant solution for several reasons which I'll get into.
[Quill](https://quill.p3k.io/) is probably the most popular Micropub client, letting you write posts to your site from a simple web interface. This post will be explaining how I built another endpoint for my site and how it fits together with my already-existing IndieAuth setup!
## What is Micropub?
Let's start off by explaining what exactly [Micropub](https://micropub.spec.indieweb.org/) is. It's a W3C recommendation (meaning it’s reached the W3C’s highest maturity level for a web technology) that standardizes how you create, update, and delete content on your site.
Instead of logging into a custom domain panel, any Micropub-compatible client can post to your site. Your website becomes your API, and that's the really nice part about the IndieWeb, you can then choose what tools work best for you. Quill is one such client. It provides a clean, distraction-free writing interface sending posts to your site via the Micropub protocol.
## Why Micropub?
There are several reasons why somebody might want to use this setup. For starters, it means I can post from my phone using a Micropub client, which is *way* easier than trying to use an interface that play well with Git. It also means I am not locked into just one interface, because my site is my API, and I own my content. In the future, I could also build tools to post to my site programmatically, since this allows interoperability.
<figure> <img src="/assets/images/blog/quill-screenshot.jpg" alt="Quill interface showing the post editor with the title 'Posting to Your Static Site with Quill and Micropub' and content being written."> <figcaption>Quill's clean, distraction-free writing interface means you can write a static post from anywhere. The rich text editor supports formatting while maintaining simplicity.</figcaption> </figure>
## Architecture
As we've already established, my site is static with no database or backend running. HTML files are generated by 11ty and deployed to Netlify, so how are posts recieved from Quill? Serverless functions, just like the comment system. The flow looks like this:
Quill sends a Micropub request to `https://brennan.day/micropub`, Netlify Function recieves the request, validates, and processes the content. The GitLab API
Did you enjoy this article?
Recommend it — Standard Reader surfaces well-loved writing to more readers across the network.