我正在尝试使用 Assemble 使用一个模板从多个数据文件生成多个静态文件。
更详细地说,我有 12 个 JSON 文件表示烹饪食谱的数据,还有一个 Handlebars 文件 recipe.hbs,其布局文件为 default.hbs。
我想根据每个 JSON 文件输出一个 HTML 文件。
文件结构:
/templates
/data
recipe1.json
recipe2.json, etc.
/layouts
default.hbs
/pages
recipe.hbs
输出:
/output
recipe1.html (based on recipe1.json)
recipe2.html (based on recipe2.json), etc.
听起来这应该可以使用集合来实现,但我似乎无法理解如何设置 Grunt 文件。
谢谢。