Blog
A blog is where a website comes alive: news from the bakery, a travel diary, a recipe every week. In WordPress the blog is the core; in ForgeCMS it is a module, free like the rest of the core, and it works the way you already know: a list in one file, one text per post, all on Codeberg.
Goal
By the end of this chapter you can:
- switch the blog on,
- write, schedule and hide posts, from a computer or a phone,
- sort posts into sections, add search and share buttons,
- let people write who should never see a file.
Switching it on
Ask the AI:
Please add a blog at /blog, show the three newest posts on the home page,
and add share buttons for WhatsApp, Telegram, email and "copy link".
What it does: in app.sml on the server it adds
Blog {
path: "/blog"
share: "whatsapp telegram email copy"
}
It creates a page for /blog with the element Blog { }, puts Blog { limit: 3 } on the home page, and creates the file blog.sml in your content repo.

Writing a post
Every post is two things on Codeberg: a few lines in blog.sml, and a Markdown file with the text.
1. The text. Create blog/new-rye-bread.md:
We tried for three years.
Now it is here: **dark rye**, 24 hours of rest, baked in the stone oven.
2. The picture (optional). Upload it to static/blog/, for example static/blog/rye.jpg.
3. The entry. In blog.sml, add a Post block:
Post {
id: "new-rye-bread"
title: "Our new rye bread"
date: "2026-10-28"
image: "blog/rye.jpg"
teaser: "Three years of trying, and now it is in the shop."
text: "blog/new-rye-bread.md"
}
Commit. The post appears at /blog/new-rye-bread, and in the list.
What the lines mean:
| Line | Meaning |
|---|---|
id |
the address of the post: lower case letters, digits and -, unique |
title |
the heading |
date |
"2026-10-28" or with a time, "2026-10-28 19:30" |
image |
picture below static/ (optional) |
teaser |
the short text in the list and in the feed (optional) |
text |
the Markdown file with the post (optional; without it the teaser is the post) |
place |
where it was written, nice for travel blogs (optional) |
video |
a YouTube or PeerTube address, shown above the text (optional) |
The order in the file does not matter: ForgeCMS sorts by date, newest first. Copy the last Post block, change it, done.
All of this works in the Codeberg website on a phone. The travel blog of my bike trip to Spain was written that way, from campsites and cafés.
Scheduled and hidden posts
- A date in the future schedules a post. It is invisible until that moment and then appears by itself. Write the Christmas post in November.
draft: "true"hides a post until you remove the line.
A hidden post has no page and is not in the feed. Nobody can find it by guessing the address.
Sections, search, feed
Sections (rubrics) group posts. Define them at the top of blog.sml and give posts a rubric:
Rubric { id: "bakery" title: "In the bakery" }
Rubric { id: "recipes" title: "Recipes" }
Post { id: "sourdough-starter" ... rubric: "recipes" }
A page with Blog { rubric: "recipes" } lists only the recipes.
Search: Blog { search: "true" } puts a search box above the list. It finds words in titles, teasers and texts, and does not care about upper and lower case or umlauts.
The feed: every blog has one at /blog/feed.xml. Readers who use a feed reader subscribe to it and get every new post, without you collecting a single email address.
Share buttons
The share line in app.sml lists the buttons under each post, in this order: whatsapp telegram facebook x bluesky linkedin email copy. They are plain links. No Facebook or other scripts are loaded, nothing is tracked, no cookie banner is needed. On phones there is also a button that opens the phone's own share menu.
Languages
Every line of a post can have a translation with _ and the language code: title_de, teaser_de, text_de. A post without a translation shows the main language. The built-in texts of the blog, like "Older posts", exist in German, English and Spanish; you can change any of them in a Labels { } block at the top of blog.sml:
Labels { older: "Older posts" back: "All posts" }
A writing form for writers who never see a file
Some people want to write, but not to learn Codeberg: a colleague, a family member, the person behind the counter. For them, the blog has a writing form. Ask the AI:
Please set up the blog writing form: anna@example.org may write posts,
I approve them (my address: me@example.org).
Anna then opens the writing page, logs in with a link sent by email (no password), and fills in title, text, an optional picture or video link. You get an email, look at the post, correct it if needed and click Publish. Only then is it on the site.
This needs mail on your server (the AI sets it up) and works on sites whose content is on the server itself.
Pitfalls
- The post does not appear: a date in the future,
draft: "true", a duplicateid, or a typo inblog.sml(missing}or"). The log names the reason; ask the AI. - Upper case or spaces in the id:
id: "New Rye"does not work. Usenew-rye. - Huge photos from the phone: the list makes small preview pictures by itself, but the post page shows the full picture. Keep it around 1600 pixels wide.
- Share links point to the wrong address:
base_urlinapp.smlmust be your real domain.
What you learned
- The blog is free and part of the core.
Blog { path }inapp.smlswitches it on. - A post is a
Postblock inblog.smland a Markdown file; the newest is first. - A future date schedules a post,
draft: "true"hides it. - Rubrics, search, a feed, share buttons without tracking, and translations come built in.
- The writing form lets others write without ever seeing a file, with your approval.
