Theme structure
The folders of an in1s theme, the files every theme needs, JSON templates, template names and suffixes, and section groups.
An in1s theme is a set of folders with Liquid, JSON and asset files. The layout follows Shopify's, with extra folders for the content a theme brings with it: data lists, forms, routes, menus and workflows. The Blank theme in the gallery is the smallest complete example; read its files alongside this page.
Folders
layout/ theme.liquid (required), password.liquid
config/ settings_schema.json, settings_data.json (both required)
locales/ en.default.json, en.default.schema.json, ar.json, ar.schema.json ...
templates/ index.json, 404.json (required), entry.json, data-list.json, route.json, search.json ...
sections/ section files (.liquid) and section groups (header-group.json, footer-group.json)
blocks/ theme blocks (.liquid), usable in any section that accepts them
snippets/ reusable partials for {% render %}
assets/ CSS, SCSS, JavaScript, images, fonts
data-lists/ data list presets (.json)
forms/ form presets (.json)
routes/ page presets (.json)
link-lists/ menu presets (.json)
workflows/ workflow presets (.json)
section-icons/ .svg icons for sections in the editor
block-icons/ .svg icons for blocks in the editor
site-files/ default files such as robots.txt
| Folder | What goes in it | File types |
|---|---|---|
layout/ |
The page shell every template renders inside. password.liquid is used while your site is password protected. |
.liquid |
config/ |
The theme's global settings and their values. See Theme settings and translations. | .json |
locales/ |
Translations of the theme's own text and of its editor labels. | .json |
templates/ |
Which sections a page shows, in which order, with which settings. | .json |
sections/ |
Sections (.liquid) and section groups (.json). |
.liquid, .json |
blocks/ |
Theme blocks. A file starting with _ is private: only sections that name it can use it. |
.liquid |
snippets/ |
Partials you render from other files. | .liquid |
assets/ |
Static files, up to three folders deep. A .css.liquid, .scss.liquid, .js.liquid or .svg.liquid file is rendered with Liquid first. |
.css, .scss, .js, .liquid, .svg, .png, .jpg, .jpeg, .webp, .gif, .woff, .woff2, .ico, .json, .txt |
data-lists/, forms/, routes/, link-lists/, workflows/ |
Presets: content the theme needs, created on your website when the theme is made live. | .json |
section-icons/, block-icons/ |
Icons the editor shows next to a section or block, named after it. | .svg |
site-files/ |
Files served at your domain's root, such as robots.txt, used only when you have not added your own in Site files. |
as in Site files |
Outside assets/ and site-files/, files sit directly in their folder: there are no subfolders. Nothing outside
these folders belongs to a theme, so a ZIP with other files is refused on import.
Required files
These files must exist. You can edit them, but not delete or rename them:
layout/theme.liquidtemplates/index.jsonandtemplates/404.jsonconfig/settings_schema.jsonandconfig/settings_data.json- the default locale files, for example
locales/en.default.jsonandlocales/en.default.schema.json
Limits
- A text file can be up to 1 MB, an image or font up to 10 MB.
- A theme can hold up to 2,000 files and 50 MB in all.
The layout
layout/theme.liquid holds <html>, <head> and <body>. It must print {{ content_for_header }} inside <head>
and {{ content_for_layout }} where the page's template goes. Header and footer usually come from section groups.
Without {{ content_for_layout }}, written exactly so and outside any comment, every page would render without its content, so the file is refused as an error. layout/password.liquid does not need it.
<!doctype html>
<html lang="{{ request.locale.iso_code | default: 'en' }}" dir="{{ request.locale.text_direction | default: 'ltr' }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ page_title | escape }}</title>
{{ content_for_header }}
{{ 'base.css' | asset_url | stylesheet_tag }}
</head>
<body>
{% sections 'header-group' %}
<main id="main">{{ content_for_layout }}</main>
{% sections 'footer-group' %}
<script src="{{ 'theme.js' | asset_url }}" defer></script>
</body>
</html>
Place {{ content_for_header }} before your first stylesheet. Give layout/password.liquid the same lang and dir
attributes, since it is the first page visitors see before launch.
JSON templates
A template is a JSON file that lists sections by key (sections) and the order they render in (order). Each
section names its file in type and carries its settings, and, if it has blocks, its blocks and block_order.
{
"sections": {
"intro": {
"type": "content",
"settings": { "color_scheme": "scheme-1" },
"blocks": {
"heading": { "type": "text", "settings": { "text": "<h1>Welcome</h1>" } },
"row": {
"type": "group",
"settings": { "direction": "row" },
"blocks": {
"image": { "type": "image", "settings": {} },
"text": { "type": "text", "settings": { "text": "<p>Side by side.</p>" } }
},
"block_order": ["image", "text"]
}
},
"block_order": ["heading", "row"]
}
},
"order": ["intro"]
}
- A template or section group can hold up to 25 sections.
- A section or block may carry a
name, the name you give it in the theme editor (up to 100 characters). - A setting with no value uses the schema's
default. - Text can be stored per language:
{ "l10n": true, "en": "Welcome", "ar": "أهلاً" }. See Theme settings and translations.
Most templates are edited in the theme editor; editing the JSON directly is the same thing.
Template names
| File | Used for |
|---|---|
index.json |
The home page |
404.json |
The page shown when nothing matches |
search.json |
The search page, /search?q= |
route.json |
Any page without a template of its own |
route.{path}.json |
One page, for example route.pricing.json for /pricing |
data-list.json |
Any data list listing page |
data-list.{handle}.json |
One list's listing page, for example data-list.posts.json |
entry.json |
Any entry page |
entry.{handle}.json |
One list's entry pages, for example entry.posts.json |
entry.{handle}.{suffix}.json |
An alternate entry template, for example entry.pages.contact.json |
A page uses the most specific template that exists. For an entry of the posts list with the suffix featured, that
is entry.posts.featured.json, then entry.posts.json, then entry.json.
Template suffixes
A suffix gives some entries or pages a different design from the rest of their kind. An entry picks its alternate
template in its settings; a page picks it on the Routes page. A page can also have alternates of its own
(route.{path}.{suffix}.json). You can create an alternate template from the theme editor, based on an existing one.
When an entry chooses a suffix the theme has no file for, one is created for it from the list's entry template.
Section groups
A section group is a JSON file in sections/, such as header-group.json, holding sections in the same shape as a
template, plus a name. The layout renders it with {% sections 'header-group' %}. The group's type comes from its
file name, and a section's schema can restrict it to a group (see Sections and blocks).
{
"name": "Header group",
"sections": {
"header": { "type": "header", "settings": { "menu": "main-menu", "color_scheme": "scheme-1" } }
},
"order": ["header"]
}
Sections in a group appear on every page that uses the layout, and the 25-section limit applies to each group on its own.
Content presets
The JSON files in data-lists/, forms/, routes/, link-lists/ and workflows/ describe content the theme
expects: a list of blog posts with its fields, a contact form, an About page, a main menu. When the theme is made live
on a website, anything missing is created. Existing content and your data are never removed, and a field you deleted
from a list is not added back.
{
"path": "about",
"title": { "en": "About", "ar": "من نحن" }
}
A setting that picks a menu by default (a link_list setting's default) should name a menu the theme ships in
link-lists/, otherwise a new website shows an empty menu.