1 个不稳定版本
0.1.0 | 2024年4月9日 |
---|
#206 在 模板引擎
8KB
157 行
梧桐模板生成器
启动一个 sycamore 项目
安装
cargo install sycamore-template
使用
此命令在 ex-project
目录下生成名为 "ex-project" 的梧桐项目
sycamore-template --name=ex-project
以下命令生成一个实现了 sycamore-router 的梧桐项目。首页的头部将包含 copy-dir 和 css 的内容。示例结果在 ex-router-project
目录中。
sycamore-template
--name=ex-router-project
--router=true
--copy-dir="/assets"
--css="/assets/style.css"
选项
完整示例
sycamore-template
--name=project-name
--router=false
--copy-dir="/assets"
--css="/style.css"
--favicon="/favicon.svg"
- 名称
- 项目的名称。这是必需的。
- 路由器
- 布尔值。默认:false。
- 是否使用 sycamore-router
- 复制目录
- 可选。在首页
index.html
文件中添加带有给定 href 的头部 <链接数据-主干 rel="复制目录"href="{copy-dir}"/>
- 这不会创建实际的目录。
- 可选。在首页
- css
- 可选。在
index.html
文件中添加带有给定 href 的头部 <链接数据-主干 rel="css"href="{x}"/>
- 这不会创建实际的文件。
- 可选。在
- favicon
- 可选。在
index.html
中添加带有给定 href 的 favicon 头部 <链接 rel="图标" 类型="image/x-icon"href="{x}">
- 可选。在
依赖
~1.2–1.7MB
~33K SLoC