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