Theme Create
Create a new Zid theme effortlessly using our starter template.
Description
The new
command initializes a new Zid theme project with the specified name. It sets up the required file structure and installs dependencies, allowing you to start quickly.
Usage
$ zid-theme new <theme-name>
Arguments
Argument | Description | Required |
---|---|---|
<theme-name> |
The name of your new theme | Yes |
Theme Structure
A newly created theme will have the following structure:
$ 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 Descriptions
Directory | Purpose | Accepted Extensions |
---|---|---|
templates/ |
Contains Twig template files for various pages. | .twig |
modules/ |
Holds reusable module templates. | .twig |
common/ |
Common template parts for repeated elements. | .twig |
locals/ |
Localization files for supporting multiple languages. | .json |
assets/ |
Theme assets, such as images, styles, and scripts. | .js , .css , .jpg , etc. |
Examples
Create a new theme with default options
$ zid-theme new my-awesome-theme
Post-Creation Steps
After creating your theme:
Navigate to the theme directory:
$ cd <theme-name>
Start customizing your theme:
- Edit Twig templates in the
templates/
directory. - Add custom styles and scripts in the
assets/
directory.
- Edit Twig templates in the
Use other Zid Theme commands:
- Use commands like
build
andpreview
to test and develop your theme.
- Use commands like
:::note[]
Important Notes
- Permissions: Ensure you have the necessary permissions to create directories in the chosen location.
- Theme Name: The theme name should be unique and follow naming conventions (e.g., lowercase, no spaces, use hyphens or underscores).
- Version Control: After creation, use version control tools like Git to manage your theme development.
:::
:::info[]
Learn More
For more information on theme development and deployment, refer to the Zid Theme Development Documentation.
:::
Last modified: a month ago