Content Management

Update Blog

Add, edit, or remove a blog post with Decap CMS or by editing Markdown files directly.

Where blog posts live

Each post is one Markdown file:

src/content/blog/<slug>.md

The file name is the slug. /blog/content-collections-vs-hardcoded reads content-collections-vs-hardcoded.md.

With Decap CMS

  1. Open /admin/.
  2. Open Blog Posts.
  3. Click New Blog Posts to add, or click an existing entry to edit.
  4. Fill in the fields:
    • Title — the post title.
    • Slug — the URL segment. Must match the file name.
    • Date — the publish date.
    • Order — a number. Lower numbers appear first.
    • Category — one of the filters defined in the blog config.
    • Tags — a list of tags.
    • Read Time — a short string like 6 min read.
    • Excerpt — short text for the card and meta description.
    • Cover Image — optional. Uploaded to static/images/blog/.
    • Image Alt — alt text for the cover image.
    • Author — name, initials, role.
    • Body — the Markdown body shown on the post page.
  5. Save.

Code-only edition

Create a new file in src/content/blog/, for example my-post.md:

---
title: 'My Post'
slug: 'my-post'
date: '2026-10-10'
order: 1
category: 'sveltekit'
tags: ['sveltekit', 'content']
readTime: '5 min read'
excerpt: 'A short description for the card and meta description.'
image: 'https://images.unsplash.com/photo-...'
imageAlt: 'Alt text for the cover image'
author:
  name: 'Creativitas'
  initials: 'CR'
  role: 'Theme Author'
---

## First heading

The body of the post.

Save the file. The list page reads it on the next build or dev reload.

How image works

The image field stores a URL or path. If it is a URL, the card and post page use it directly. If it is an upload, Decap stores the file in static/images/blog/ and writes the path as /images/blog/<file>.

If image is empty, the card shows the CSS gradient fallback and the post page shows no hero image. No broken image.

Previous and next

The post page shows previous and next links. They are calculated from the order field across all posts. Lower numbers come first.

Next step

Read Push to GitHub to version the project.