Basker Docs

Set up your theme directory

Scaffold the directories a Basker theme needs, initialise version control, and get a local dev server running

You'll start by creating the empty directory structure a theme needs, putting it under version control, and running the LocalStage CLI so you can see changes in a browser as you work.

Step 1 — Create the theme folder

Pick a name for your theme directory. The folder name is what Basker calls the theme key — keep it lowercase and hyphen-separated.

mkdir my-theme
cd my-theme

Step 2 — Scaffold the directories

A classic theme needs three required folders and a few common-but-optional ones. Create them now so the layout, template, block, and settings work in later steps has a place to land.

mkdir -p layouts templates blocks components assets config
FolderWhat goes in it
layouts/The HTML shell that wraps every page.
templates/Per-content-type renderers — pages, events, posts, etc.
blocks/Reusable composable units editors place inside pages.
components/Larger shared partials like global headers and footers.
assets/CSS, JavaScript, images, fonts.
config/Theme-wide settings schema.

The full list of supported directories, what's required, and what gets validated is on Theme directory structure.

Step 3 — Initialise version control

A theme is just files, so Git works the same way it does for any other project. Initialise a repository now and add a .gitignore for the things you don't want to commit:

git init

Create .gitignore at the theme root:

.DS_Store
node_modules/
*.zip
.localstage-session.json

The .localstage-session.json file is created by the dev server to cache your sign-in. It's per-machine and shouldn't be committed.

Make your first commit when the directories are in place:

git add .
git commit -m "Scaffold theme directories"

Step 4 — Install the LocalStage CLI

The CLI gives you a local dev server that renders your theme files against your live Basker site. If you haven't already installed it, follow LocalStage CLI and come back when the install is verified.

A quick sanity check from inside my-theme:

basker --version

Step 5 — Start the dev server

From the theme directory:

basker theme dev

The first run prompts for your Basker email, password, and the workspace you want to preview. After signing in, the CLI prints a summary box with http://localhost:9292 and opens it in your browser.

You'll see an error or a blank page right now — that's expected. There are no layouts or templates yet for the renderer to use. You'll fix that on the next page.

Keep this terminal running. As you add files in the next steps, the dev server picks them up and live-reloads the browser.

Next

Head to Build the default layout to give the renderer something to render.

On this page