create_theme
Generate a complete, previewable Ghost theme on disk with custom CSS and optional Handlebars template overrides.
Instructions
Generate a complete, valid, previewable Ghost theme on disk.
Writes a ready-to-use theme (layout, home/post/page templates, page
handling, the Koenig CSS classes Ghost requires, and package.json) to a
local directory. Supply styles (CSS) to design the look; the site's brand
accent colour is available in CSS as var(--ghost-accent-color), so the
theme respects the user's existing branding.
Width convention: the base stylesheet keeps the structural chrome classes
(.site-header/.site-footer/.post-feed/.post/.page) at full
width and centres their contents with an inner .gh-inner wrapper. So in a
custom layout, cap a region by wrapping its content in your own inner element
(or reuse .gh-inner) and set max-width there -- setting it on a child
of an un-capped region works, but a child can't widen past a capped parent.
Optionally override the home/post/page templates, and the default.hbs
layout itself, with your own Handlebars. Stay within the previewable helper
subset: {{#if}}/{{#unless}}, {{#foreach}} (with limit=/to=,
but not from=), {{#post}}, partials, and bare fields like {{title}}
and {{content}}. Avoid block params (as |x|) and the helpers Ghost
evaluates server-side ({{#get}}, {{#match}}, {{#is}},
{{date}}) -- block params and from= are rejected outright, and the
rest render blank in the local preview.
For content templates (index/post/page), layout inheritance is handled for
you: the {{!< default}} directive is injected if an override omits it.
A default_template override replaces the whole layout, so it MUST include
{{{body}}} (where child templates inject) -- a layout without it is
rejected, since every page would render empty. The stylesheet <link> and
{{ghost_head}}/{{ghost_foot}} are auto-injected before </head> /
</body> if you omit them, so styling, SEO, the accent colour, and members
keep working. Note {{asset "built/screen.css"}} only emits the URL -- to
load the CSS it must sit inside a real
<link rel="stylesheet" href="{{asset "built/screen.css"}}">. See
docs/theme-conventions.md for the full contract.
After generating, call preview_theme with the returned path to view it,
then upload_theme to install it (activation stays manual).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Human-readable theme name (slugified for the package name). | |
| styles | No | CSS appended to the base stylesheet to design the theme. | |
| description | No | Optional theme description. | |
| page_template | No | Optional Handlebars override for the page template. | |
| post_template | No | Optional Handlebars override for the single-post template. | |
| index_template | No | Optional Handlebars override for the home template. | |
| default_template | No | Optional Handlebars override for the ``default.hbs`` layout. Must contain ``{{{body}}}``. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||