构建并发布主题
本教程脚手架一个主题、用实时重载预览、再推送到店铺。主题命令是以 + 为前缀的快捷命令。
前置条件
1. 基于 Nova 2023 脚手架
shell
shoplazza themes init --name my-theme
cd my-theme
这会克隆 Nova 2023 模板作为起点。
2. 实时重载预览
把主题上传到店铺,并作为开发主题预览:
shell
shoplazza themes serve
命令会返回一个可分享的预览链接和后台主题编辑器链接。CSS 与 section 改动会热重载;其他改动会刷新页面。
备注
请在符合默认主题结构的目录下运行 themes serve。
3. 拉取与推送
从店铺下载文件,或用本地文件覆盖远端版本:
shell
shoplazza themes pull --theme-id <THEME_ID>
shoplazza themes push --theme-id <THEME_ID>
运行 shoplazza themes list 查询主题 ID。
4. 分享或打包
作为一个新的未发布主题上传,并获得可分享的预览链接:
shell
shoplazza themes share
或把主题打包成 ZIP 用于分发:
shell
shoplazza themes package
发布
要正式发布主题,使用主题 API 命令——见 themes(API) 的 publish 与文件管理,以及主题 CLI 指南。