ℹ️ Pagefind site search

Micro.blog has support for running Pagefind to index your blog. Pagefind will provide a search box and search results, with lots of options to customize it.

To enable Pagefind, click on Design → Blog Settings (in the upper-right corner) → Edit Actions. Actions are special tools that can run during blog publishing.

Then create a new standalone page in Micro.blog. Call it Search (or anything), and paste in the following HTML:

<link href="/pagefind/pagefind-ui.css" rel="stylesheet">
<script src="/pagefind/pagefind-ui.js"></script>
<div id="search"></div>
<script>
    window.addEventListener('DOMContentLoaded', (event) => {
        new PagefindUI({ element: "#search", showSubResults: true });
    });
</script>

See the Pagefind documentation for more options on the search box UI and controlling how pages our indexed.

Note that it takes extra time to run Pagefind for blogs with many thousands of posts. We are looking at making this faster.