Skip to content
shopdepot.dev

Themes

File structure

The directories of a theme and the rules every file is checked against when it is saved.

View as Markdown

A theme is one folder. The same paths are used everywhere - in your repository, in the ZIP, in the code editor in the store admin and in the store's database - so a file has one identity from your editor to production.

example/
├── theme.json                       the manifest (name, handle, version, listing, menus, widgets)
├── layout/
│   └── theme.twig                   the HTML shell of every page
├── templates/                       JSON only - which sections each page shows
│   ├── index.json  product.json  category.json  page.json  blog.json  article.json
│   ├── search.json  cart.json  contact.json  terms.json  term.json  404.json
│   ├── product.mask.json            an alternate template (after the dot)
│   └── category.books.json          an alternate category template
├── sections/                        Twig + {% schema %}, folders allowed
│   ├── header-group.json            section groups sit at the top of sections/
│   ├── footer-group.json
│   ├── layout/    header.twig  footer.twig  announcement-bar.twig
│   ├── product/   main-product.twig  product-reviews.twig
│   └── content/   hero.twig  featured-products.twig
├── blocks/                          theme blocks: {% schema %} required
│   ├── shared/_group.twig           a leading underscore marks a system block
│   └── product/   price.twig  buy-buttons.twig  variant-picker.twig
├── snippets/                        partials: {% doc %}, no schema
│   └── product-card.twig  icon.twig  brand-tokens.twig
├── assets/                          CSS, JS, fonts, images - folders allowed
│   ├── css/  js/  fonts/  img/
├── config/
│   ├── settings_schema.json         theme settings (or config/settings/*.json)
│   └── settings_data.json           starting values of those settings
├── locales/
│   ├── en.default.json              storefront texts, the fallback language
│   └── pl.json
└── demo/                            data of the theme's demo store (theme store only)

The rules

Every file is checked when it is written - by an upload, the code editor or a package publish. A rule that fails stops the save with a message; nothing is checked later at render time.

Rule What it means
Ten names Only theme.json, layout/, templates/, sections/, blocks/, snippets/, assets/, config/, locales/ and demo/ are part of a theme. Everything else in your folder - README.md, package.json, src/, node_modules/ - stays local and is skipped by an upload. Build tools write their output to assets/.
Lowercase paths Letters a-z, digits, ., _ and -. A file name may start with _, a folder may not.
Four levels at most assets/img/icons/cart.svg is fine, assets/img/icons/ui/cart.svg is not.
Names, not paths Sections, blocks and snippets are referenced by file name without folder or extension - "type": "main-product", render('product-card'). Folders are for you; move a file between them and nothing breaks.
Unique names Because of that, a section, block or snippet name must be unique across the whole theme. Two card.twig in different folders is an error - name them by domain: product-card, article-card.
Blocks have schemas, snippets do not A file in blocks/ must declare {% schema %}. A file in snippets/ must not.
Templates are JSON templates/ and sections/*-group.json hold JSON only.
Valid JSON Templates, section groups, config/*, locales/*, theme.json and demo/*.json must parse.
Size 256 KB per text file, 2 MB per binary file.
Binaries in assets Images and fonts (png, jpg, jpeg, gif, webp, avif, ico, woff, woff2, ttf, otf, eot) only under assets/ or demo/assets/. SVG is text and may sit anywhere in assets/.

Warning

An upload does not fail on a file outside the contract - it skips it and lists it. A font in assets/Fonts/ or an image four folders deep silently goes missing and returns 404 in the store. Read the list after every upload.

Naming conventions

The platform does not enforce these, but the theme store review does:

  • English file names in kebab-case.
  • main-* for the section that renders the main object of a page: main-product, main-category, main-cart.
  • A leading underscore for system blocks the merchant does not add on their own: _group.
  • Snippets named by what they show: product-card, cart-line, price.

Settings split across files

A long settings schema can be split: instead of config/settings_schema.json, put one group per file in config/settings/ - 10-colors.json, 20-typography.json. Files are merged in name order, hence the numeric prefixes. Use one form or the other, not both.

settings_data.json is a starting point

config/settings_data.json in your package holds the values a store starts with when it installs your theme. After that the merchant's values live with their store: a new version of your theme keeps every value they set, adds new settings with your defaults and parks removed ones, so a rollback can bring them back. See Settings.