Maintenance

For developers

Build commands, file map, design tokens, and the locales workflow for developers customizing Miyus from source.

This page is the short reference for developers customizing Miyus from source. Most site editors won't need anything here — uploading the pre-built miyus.zip is enough. If you want to fork the theme, change design tokens, or rebuild after edits, read on.

Custom code is overwritten on theme update

If you modify theme files directly and then upload an updated miyus.zip through Ghost Admin, your changes are erased. Fork the repo, commit your changes to your fork, and rebuild your own zip — don't edit files in place on a production install. For small CSS tweaks, prefer Ghost's Settings → Code injection, which survives theme updates — see Code injections for the CSS variables Miyus exposes for exactly this.


Build requirements

  • Node.js (a current LTS release)
  • npm or Yarn
  • Ghost v5.0.0 or later for the running site that will host the built theme

Build commands

All commands run from the theme root. The build is Rollup-based: JavaScript is bundled from assets/js/index.js (Babel + Terser) and CSS is compiled through PostCSS (postcss-import + postcss-preset-env), both into assets/built/.

CommandWhat it does
npm installInstall dependencies.
npm run devRollup in watch mode with livereload — rebuilds on every CSS/JS/Handlebars change. Pair it with a local Ghost install pointed at the theme directory.
npm run buildProduction build to assets/built/ (minified, with sourcemaps).
npm run zipBuild, then package miyus.zip (assets, partials, locales, templates, package.json, license, readme) for upload.
npm run testRuns a production build, then GScan — Ghost's official theme compatibility checker.

File map

Templates (root)

FilePurpose
default.hbsMaster layout — head, Google Fonts preloads, header/footer partials, dark-mode bootstrapping.
index.hbsHomepage: hero, featured links, Editor's Picks, tag sections, latest posts.
post.hbsArticle page: feature image, content, member CTA, related posts.
page.hbsStandard page template.
custom-contact.hbsThe selectable Contact template (Formspree form + custom-form mode).
custom-authors.hbsThe selectable Authors directory template.
tag.hbs, author.hbsTag / author archives — both use the tag accent color / author cover as a hero backdrop.
error.hbsError pages.

Key partials

PartialPurpose
partials/header.hbsLogo (light + dark), primary nav with the -- dropdown convention, search, theme toggle, Subscribe/Account button.
partials/footer.hbsSecondary nav, social links (9 networks), copyright.
partials/hero.hbsHomepage hero — title/description fallbacks and the members signup form.
partials/card.hbs, partials/featured-card.hbsPost cards.
partials/featured-links.hbsThe featured pages/tags row under the hero.
partials/featured.hbsEditor's Picks (3 most recent featured posts).
partials/tag-sections.hbsTag-based homepage sections.
partials/content-cta.hbsGated-content upgrade box for members content.
partials/author-card.hbsAuthor directory card (image, bio, location, socials).

Assets

PathPurpose
assets/css/index.cssPostCSS entry — imports everything below.
assets/css/vars.cssDesign tokens: --body-font, --title-font, --global-border-radius, sizes, colors.
assets/css/color-scheme.cssDark-mode palette (fixed dark values, including the dark secondary background).
assets/css/components/, assets/css/ghost/Component and per-surface styles.
assets/js/index.jsJS entry (Rollup input).
assets/js/color-scheme.jsDark-mode toggle + prefers-color-scheme detection and persistence.
assets/js/lightense.jsClick-to-zoom lightbox for content images.
assets/js/menuOpen.jsMobile menu.
rollup.config.jsBuild configuration.

Locales workflow

Translations live in locales/ as flat JSON files (en.json, de.json), consumed by Ghost's {{t}} helper. Unlike some of our other themes, Miyus has no automated parity check — keep the files in sync by hand:

  1. When you add a {{t "..."}} call to a template, add the same English phrase as a key to locales/en.json (the key doubles as the fallback text).
  2. Add the translated value for the same key to every other locale file (de.json, and any you've added).
  3. A key missing from a locale silently falls back to the English text — easy to miss, so diff the key sets of en.json and the other files before zipping.

To add a new language, copy en.json to locales/<code>.json and translate the values, then set the matching code as the site's Publication Language — see Translation.