Getting Started
This blog is a template. Every page is plain HTML, CSS, and a little JavaScript, and posts are written in BBCode and turned into HTML by bloops. Nothing runs on the server, so any host that serves static files will do. This post covers making the template yours, writing a post, and publishing it.
What you need
- uv installs bloops and prek and runs the build script with a suitable Python.
- Git keeps track of the blog, and a host for static sites serves it. The template comes set up for Vercel.
- Asymptote is needed only if your posts draw diagrams. Bloops calls
asy to compile them to SVG.
Install the two command-line tools once. Each gets its own isolated environment, and uv tool upgrade --all updates them later.
uv tool install bloops
uv tool install prek
# or, without uv (needs Python 3.12+)
pip install bloops prek
Either way, you then have the bloops and prek commands used below.
Make it yours
- Create a repository from this template and clone it.
- Replace
Your Blog Name in index.html. It appears twice: in the page title and in the heading. Replace the placeholder description below the heading, too.
- Set
SITE_URL near the top of build.py to the address the blog will be served at, such as https://my-blog.vercel.app. It starts as the address of this template's demo, and the build script stops until you change it.
- Set the
Sitemap: line of robots.txt to the same address followed by /sitemap.xml, such as Sitemap: https://my-blog.vercel.app/sitemap.xml. The build script stops until it matches SITE_URL. Both are described under Search engines.
- Replace the favicon with your own, described below.
- Keep, reword, or drop the credits footer, described below.
- Delete the example posts: remove their folders and their entries in
posts.json. With no posts, the home page says so.
- Install the git hook, described below.
Colors are Catppuccin tokens at the top of style.css, for the home page, and of post.css, for posts. Both files follow the reader's light or dark preference, and the button in the corner flips it.
The favicon is favicon.svg, with favicon.ico as a fallback for browsers that cannot show SVG icons. To use your own, replace favicon.svg and make the fallback from it with ImageMagick:
magick -background none favicon.svg \
-define icon:auto-resize=48,32,16 favicon.ico
The posts need no changes: bloops gives every page its own default icon, and the build script swaps it for these two files.
Every page ends with a footer that credits bloops and this template. The build script writes it into the home page, the 404 page, and every post, so it lives in one place: CREDITS near the top of build.py. Change it there and run the build script to update every page. To drop it, delete the footer from the home page, the 404 page, and the post pages, and remove CREDITS and the with_credits calls from the script.
How it is laid out
your-blog/
├── index.html home page and post list
├── 404.html page for missing addresses
├── style.css home page styles
├── post.css styles for every post
├── post.js theme toggle, sidenotes
├── favicon.svg the blog's icon
├── favicon.ico icon for older browsers
├── posts.json slug, date, excerpt
├── build.py lists posts on index.html
├── prek.toml the pre-push hook
├── sitemap.xml written by build.py
├── robots.txt points crawlers at it
├── vercel.json URLs and security headers
└── my-post/
├── content.bbcode the post, in BBCode
├── index.html generated by bloops
└── static/
├── style.css imports ../../post.css
├── script.js loads ../../post.js
└── diagram.svg Asymptote diagrams
Each post's static/style.css imports the root post.css with an @import statement, and its static/script.js loads the root post.js, so changing the look of every post means editing one file. The post.css and post.js here are copies of bloops's own static/style.css and static/script.js; copy them over again to pick up a newer bloops style.
Writing a post
- Make a folder named after the post's slug, which becomes its address: lowercase letters, digits, and hyphens, such as
my-post.
- Copy the entire
static/style.css and static/script.js files from an existing post into my-post/static/. They import the root post.css and post.js. Bloops only writes its own copies of these when they are missing, so the stubs survive every rebuild.
- Write
my-post/content.bbcode, starting with the title as a level-one heading. The build script takes the post's title from there. The Bloops Showcase post shows every tag bloops knows; its content.bbcode is a good reference.
- Build the post with bloops.
bloops -pc -i my-post # live preview
bloops -i my-post # build once
Always edit content.bbcode, never the generated index.html: every build writes the page again from the source, and changes made by hand are lost.
Listing it on the home page
Add an entry for the post to posts.json. All three fields are required. The date is written as year-month-day, and the list on the home page is sorted newest first. The excerpt is the preview shown under the title.
{
"slug": "my-post",
"date": "2026-10-28",
"excerpt": "What the post is about."
}
Then run the build script:
uv run build.py # uv picks the Python
python3 build.py # needs Python 3.12+
It writes the post list on the home page with each post's reading time, copies every post's title from its heading into posts.json, sets each post's browser-tab title and favicon, which bloops leaves as placeholders, ends every page with the credits footer, and writes sitemap.xml, described under Search engines. Run it again after every bloops build. If an entry is wrong, for example a missing excerpt, a date that does not exist, or a slug with no built page, it stops and says which entry and what is wrong.
When bloops itself is updated, its page template may change too, and pages built with the old version fall behind. Rebuild every post from its content.bbcode in one go:
uv run build.py --rebuild
This runs bloops on every post folder, then updates the home page as usual. It stops at the first post bloops cannot build and shows the error. Hand edits to generated pages are lost, which is one more reason to edit only the BBCode.
It runs the bloops command it finds on your PATH. To use a different one, such as a local checkout of bloops you are working on, set BLOOPS to the command that runs it:
BLOOPS="uv run --project ../bloops bloops" \
uv run build.py --rebuild
Previewing the whole site
bloops -pc previews one post at a time. To click through the home page and every post together, run a local server from the blog's root folder, the one holding the home page's index.html:
python3 -m http.server
python3 -m http.server -d path/to/blog # elsewhere
Then open localhost:8000. Posts are served at the same addresses as on the live site, such as /my-post/.
The git hook
prek runs a check before every push. Install the hook once in each clone:
prek install
Before every push, it reruns the build script in check mode. If the post list or a title was out of date, the script fixes it and the push stops, so you can commit the result and push again.
The check runs in a Python environment prek sets up itself, so it works even when the system Python is older than 3.12.
Publishing
Import the repository on Vercel. There is no build step and no framework preset to pick: the files are served as they are, and every push to the main branch deploys. The sources, the build script, and the hook configuration are listed in .vercelignore, so only the pages, styles, scripts, and diagrams are uploaded. Any other static host works too; it only needs to serve my-post/index.html at /my-post/, and 404.html for any address that does not exist. Vercel does the latter on its own; on other hosts, it may need a setting. The local server from Previewing the whole site does not use it, so open /404.html there to see the page.
- Build the post with bloops.
- Add it to
posts.json and run the build script.
- Commit and push.
Search engines
Two files at the root help search engines find every page:
sitemap.xml lists the home page and every post with its date. The build script writes it from SITE_URL on every run, so never edit it by hand.
robots.txt lets every crawler in and gives the sitemap's address, so search engines find the sitemap on their own. It is a fixed file you edit once; the build script only checks it.
User-agent: *
Allow: /
Sitemap: https://my-blog.vercel.app/sitemap.xml
Both start with the address of this template's demo. The build script stops until SITE_URL is your own address and the Sitemap: line of robots.txt matches it, so a copy of the template never sends search engines to the demo. If the blog moves to a new address, update both and run the script again.
To have the blog indexed sooner, submit the sitemap's address, such as https://my-blog.vercel.app/sitemap.xml, in Google Search Console or Bing Webmaster Tools.