Build your Zid theme for deployment effortlessly.Description#
The build
command compiles and packages your Zid theme into a deployable .zip
file. By default, it assumes the current directory contains the theme and uses the root directory name for the output .zip
file.Usage#
Options#
Option | Description |
---|
--path <directory> | Specify the path to the theme directory. Default: current directory. |
--name <name> | Set a custom name for the output zip file. Default: root folder name. |
Theme Structure Requirements#
The following structure is required for a valid Zid theme SDK. All mentioned files and folders are mandatory, though some folders (e.g., modules
, locals
, assets
) can be empty.$ root
.
ā
āāāā query.json
āāāā layout.twig
āāāā header.twig
āāāā footer.twig
ā
āāāā templates (accepted extensions: [ '.twig' ])
ā āāāā 404.twig
ā āāāā home.twig
ā āāāā search.twig
ā āāāā products.twig
ā āāāā product.twig
ā āāāā categories.twig
ā āāāā category.twig
ā āāāā blogs.twig
ā āāāā blog.twig
ā āāāā faqs.twig
ā āāāā cart.twig
ā āāāā shipping-and-payments.twig
ā āāāā account-addresses.twig
ā āāāā account-orders.twig
ā āāāā account-profile.twig
ā
āāāā modules (accepted extensions: ['.twig'])
ā
āāāā common (accepted extensions: ['.twig'])
ā
āāāā locals (accepted extensions: ['.json'])
ā
āāāā assets
Directory Specifications#
Directory | Purpose | Accepted Extensions |
---|
templates/ | Contains Twig template files. | .twig |
modules/ | Holds reusable module templates. | .twig |
common/ | Common template parts. | .twig |
locals/ | Localization files. | .json |
assets/ | Theme assets. | See Assets Accepted Extensions below. |
Assets Accepted Extensions#
Extension Types | Examples |
---|
JavaScript | .js , .ts |
CSS/SCSS | .css , .scss , .map |
Images | .png , .jpg , .jpeg , .gif , .svg |
Fonts | .woff , .woff2 , .otf , .ttf , .eot |
Examples#
Build the theme in the current directory#
Build the theme from a specific path#
Build the theme with a custom output name#
Full command with custom path and name#
Important Notes#
Ensure your theme follows the required structure before building.
The build process validates your theme structure and throws an error if it's invalid.
If no --name
is specified, the output .zip
file will be named after the root directory.
Always verify the contents of the generated .zip
file before deployment.
Modified atĀ 2025-01-23 10:56:46