Docs menu

Getting started

IntroductionInstallationProject structure

Building pages

RoutingPagesLayoutsStylingMarkdownContent and dataIslands

Going live

SEO and headDeployingForms

Guides

Build a brochure site

Advanced

Running as a server

Reference

Reference

Getting started

Project structure

Which folder holds what, and which names are special.

my-site/
├─ src/
│  ├─ site.imba          site settings: url, default meta, <head> extras, global css
│  ├─ pages/             one file per URL (.imba or .md)
│  ├─ layouts/           default.imba wraps every page; others can be picked by name
│  ├─ components/        your own tags (no special meaning)
│  ├─ islands/           tags that also run in the browser
│  └─ content/           collections (folders) and data modules (files)
├─ public/               copied as-is to the site root: images, icons, robots.txt
└─ package.json

Special names

Path Meaning
src/pages/ Every .imba and .md file is a page. See Routing
src/pages/404.imba The not-found page (also written to dist/404.html)
src/layouts/default.imba Wraps every page, unless a page says otherwise
src/islands/ Every tag exported from here is an island
src/content/<folder>/ A collection named after the folder
src/content/config.imba Optional checks and sort order for collections
src/site.imba Site-wide settings. See SEO and head
public/ Served from the site root: public/images/a.png is /images/a.png

Names starting with _ are ignored in src/pages and src/content, so _drafts/ is a safe place for work in progress.

Everything else is up to you: src/components/, a src/data.imba file, a src/email.imba helper. Import them like any Imba module.

Generated folders

Both are safe to delete, and belong in .gitignore:

  • .pages/: files imba-pages generates (the server entry, compiled Markdown, the server bundle).
  • dist/: the built site.

What happens when it runs

  1. imba-pages scans src/pages, src/islands and src/content, compiles Markdown to HTML, and writes .pages/entry.imba, which imports every page.
  2. Imba's bundler builds that into a server, plus a small browser script per island.
  3. dev runs the server; build runs it once, fetches every page and writes the HTML to dist/.