There are two ways to give your blog a design of your own:

  1. A custom template. You write the HTML and CSS. Superblog still builds, hosts and optimizes the blog.
  2. Headless. You build your own frontend and fetch your posts from the REST API.

Both are available on the SUPER plan and above.

Start with a custom template unless your blog has to render inside an app you already run. With a template, Superblog keeps adding the SEO tags, schemas, sitemaps and llms.txt to every page. With the headless route, your frontend has to produce all of them itself.

Working examples of both are in the sample repository.

Option 1: a custom template

A custom template replaces Superblog's design with your own markup. You write one HTML file per type of page, and Superblog fills it with your posts, categories, tags and settings.

  1. Install the Superblog CLI and sign in:
   npm i -g @superblog/cli
   superblog login
  1. Start a live session in an empty folder:
   mkdir my-template && cd my-template
   superblog template dev

It offers to create a starter template, then builds your real blog with it at a live preview address. Save a file and the page reloads. Your live blog does not change.

  1. Publish when it is ready:
   superblog template preview
   superblog template deploy

Choose how to style it

The CLI asks one question when it creates the starter:

ChoiceWhat you get
Superblog frameworkTailwind CSS and DaisyUI are compiled for you. Your colour, font and style settings in the dashboard still apply.
My own CSSSuperblog ships no stylesheet. You get a starter stylesheet that is yours to edit or delete.

The choice is saved in template.json, and you can change it later. The sample repository has the starter for each: template-tailwind/ and template-own-css/.

What Superblog keeps doing for you

  1. The <head> of every page: SEO tags, canonical URLs, Open Graph tags and fonts. A template cannot change these, so it cannot break them.
  2. JSON-LD schemas, sitemaps, RSS and llms.txt.
  3. Image optimization, hosting and the CDN.
  4. A check on every build. A template with an error stops the deploy and names the file and line, so a broken design never goes live.

The full template reference is in every starter, in docs/index.html. To build the template with a coding assistant such as Claude or Codex, point it at docs/LLMS.md. See Build your own template for how a template works with your dashboard settings.

Option 2: headless with the REST API

Fetch your posts from the REST API and render them with any framework.

  1. Create an API key with Read published content access. It can read your published posts and nothing else, so a leaked key cannot change your blog.
  2. List your published posts. The API returns up to 200 posts per page:
   curl "https://write.superblog.ai/api/v2/sites/yourblog/posts?statusFilter=PUBLISHED&limit=200&page=1" \
     -H "Authorization: Bearer YOUR_API_KEY"
  1. Fetch one post by its cuid from that list. Its content field is HTML, ready to render:
   curl https://write.superblog.ai/api/v2/sites/yourblog/posts/POST_CUID \
     -H "Authorization: Bearer YOUR_API_KEY"

Replace yourblog with your blog's supername, the first part of its superblog.click address.

The API looks posts up by cuid, not by slug. To build a page for each slug, list the posts first and match the slug to its cuid. The headless-nextjs/ example in the sample repository does this in Next.js, with a static page and SEO tags for every post.

Before you go headless

  1. Keep the API key on your server. Call the API at build time or from server code, never from the browser. A read published content key cannot change anything, but anyone who has it can still read your content through the API. A full access key can edit and delete everything on your blog, so never use one in a frontend.
  2. Your frontend owns SEO. Titles, descriptions, canonical URLs, JSON-LD schemas, the sitemap, RSS and llms.txt are added by the blog Superblog hosts. A headless frontend has to generate each of them.
  3. Avoid duplicate pages. If you also deploy the blog Superblog hosts, the same posts are public at two addresses. Set each post's canonical URL to its page on your frontend, so search engines index yours.
  4. Edits show up when your frontend fetches them. The API returns your posts as they are in the dashboard, with no Superblog deploy needed. How soon readers see a change depends on how often your frontend rebuilds or re-fetches.

Only need your latest posts?

To show a few recent posts on your homepage or in an app, you do not need either option. Every blog publishes its posts as RSS and JSON, on every plan, with no API key. See Show your posts on another site or app.

ESC
Type to search...
↑↓ Navigate↵ Openesc Close