ForgeCrowdBookWe don't sell the fish – we give you the rod.

Menu, Footer, Routes and Languages

A website grows. You add a page, the menu needs a new entry, and one day a visitor asks whether there is a German version. In ForgeCMS all of this lives in one small file in your content repo, site.sml, and in a folder per language.

Goal

By the end of this chapter you can:

  • read and change site.sml: menu, footer and the list of pages,
  • add a new page yourself,
  • make your site speak a second language.

The file site.sml

When app.sml on your server says layout: "site.sml" in its Site { } block (the AI set this up in the last chapter), ForgeCMS takes menu, footer and pages from this file on Codeberg. Here is the one of the bakery:

Site {
    Menu {
        Item { label: "Home"          label_de: "Start"          href: "/" }
        Item { label: "Our bread"     label_de: "Unser Brot"     href: "/bread" }
        Item { label: "Opening hours" label_de: "Öffnungszeiten" href: "/hours" }
    }
    Footer {
        text:    "© 2026 Our Bakery · Market Street 3 · Wittenberg"
        text_de: "© 2026 Unsere Bäckerei · Marktstraße 3 · Wittenberg"
        Link { label: "Legal notice"  label_de: "Impressum"  href: "/legal" }
    }
    Routing {
        Route { path: "/"       page: "index.sml" }
        Route { path: "/bread"  page: "bread.sml" }
        Route { path: "/hours"  page: "hours.sml" }
        Route { path: "/legal"  page: "legal.sml" }
    }
}

Three blocks:

  • Menu: one Item per menu entry, in the order they appear. label is the text, href where it leads.
  • Footer: the line at the bottom of every page, and links such as the legal notice.
  • Routing: which address shows which page. path is what visitors see in the address bar, page is the .sml file.

label_de and text_de are the German versions. More about that below.

Adding a page

Say the bakery starts catering. A new page takes three small steps, all on Codeberg:

1. The text. Create a file catering.md (Add file → New file):

# Catering

Bread, rolls and cakes for your party, office or wedding.
Order at least three days ahead.

2. The page. Create catering.sml:

Page {
    title: "Catering"
    Markdown { src: "catering.md" }
}

3. The route and the menu entry. In site.sml, add a line to Routing:

        Route { path: "/catering"  page: "catering.sml" }

and, if the page should be in the menu, a line to Menu where it should appear:

        Item { label: "Catering"  href: "/catering" }

Commit, wait a few minutes, reload. The page is there.

Why does ForgeCMS not simply show every .sml file it finds? Because then every random address a bot tries would become a question to Codeberg. With routes, only the pages you list exist. Everything else is a clean "not found".

When site.sml has a typo

A missing } or " in site.sml does not break your site. ForgeCMS keeps using the last version that worked and writes a warning to its log. If your change does not appear, compare it closely with the lines around it: every { needs its }, every text needs quotes at both ends. Or ask the AI to look.

A second language

ForgeCMS can show every page in several languages. Visitors get the language their browser asks for, and a switcher in the menu lets them change it.

The language switcher

Setting it up takes one request to the AI, because it starts in app.sml on the server:

Please make my site bilingual: English as the main language, German as the
second one. Set up the language switcher and create German versions of the
home page and the opening hours. I will translate the rest myself.

What the AI does, so you know where to find it:

In app.sml it adds the languages:

Languages {
    default:   "en"
    supported: "en de"
}

In the content repo it creates a folder for the second language, named after its code: de/. In it go the German versions of pages and texts, with the same file names as the originals:

index.sml        home.md        hours.md        bread.md
de/index.sml     de/home.md     de/hours.md     de/bread.md

In site.sml every visible text gets a German twin with _de at the end: label_de, text_de.

The rule is simple: for a German visitor, ForgeCMS looks in de/ first. If a file is not there, it uses the one from the main folder. So you can translate step by step: a page without a translation simply appears in English until you add one.

A page and its text are separate files, so often you only need to translate the text. bread.sml says Markdown { src: "bread.md" }; with a de/bread.md the German visitor gets the German price list, while the page itself is shared.

Language codes are the usual two letters: de German, fr French, es Spanish, it Italian, pt Portuguese, nl Dutch.

Pitfalls

  • A page exists but shows "not found": its Route is missing in site.sml, or path and the link in the menu do not match exactly (/catering is not /Catering).
  • The translation does not appear: the file in de/ must have exactly the same name as the original. de/Home.md is not de/home.md.
  • Menu labels stay English for German visitors: the label_de is missing on that Item.
  • You wanted a page only in German: put it in the main folder anyway (as the fallback) or ask the AI how to hide it from the English menu.

What you learned

  • site.sml on Codeberg holds menu, footer and routes.
  • A new page is a text, a page file, a route, and maybe a menu entry.
  • A second language: Languages { } in app.sml, a folder de/ with the same file names, and _de twins for menu and footer texts.
  • Missing translations fall back to the main language, so you can translate step by step.

Next: colours, fonts, pictures and videos.