Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gruntjs 如何使用grunt任务生成html格式的文件列表?_Gruntjs - Fatal编程技术网

Gruntjs 如何使用grunt任务生成html格式的文件列表?

Gruntjs 如何使用grunt任务生成html格式的文件列表?,gruntjs,Gruntjs,我正在使用yeoman、grunt和angularjs,我是grunt的新手 我有一些内容生成,生成类似的内容,已经复制到dist文件夹 /dist/whatever/x/a.html /dist/whatever/y/b.html /dist/whatever/x/c.html 我想使用grunt任务创建另一个html文件: /dist/whatever/index.html 其中包括: ... <a href="x/a.html">x</x> <a href

我正在使用yeoman、grunt和angularjs,我是grunt的新手

我有一些内容生成,生成类似的内容,已经复制到dist文件夹

/dist/whatever/x/a.html
/dist/whatever/y/b.html
/dist/whatever/x/c.html
我想使用grunt任务创建另一个html文件:

/dist/whatever/index.html
其中包括:

...
<a href="x/a.html">x</x>
<a href="y/b.html">x</x>
<a href="x/c.html">x</x>
...
。。。
'
}
}
},
whateverIndex:{
档案:{
'dist/whater/index.html':'app/whater/index.template.html'
}
}
},
app/whatever/index.template.html

<ul>
<!-- include: "type": "link", "files": "*/index.html" -->
</ul>

grunt include source
可用于在HTML中构建引用目录中的css、js和HTML文件的节,或与glob匹配的节

可以很好地概括任务的配置和工作方式


另外,对于另一个问题,我提供了更多的信息。

对css和js做了类似的事情,但我不知道它是否会像那样注入锚标记。对于新的搜索来说,这可能是一个开始,也可能是一个很好的术语。这太完美了!你应该回答我,我会接受的。
<ul>
<!-- include: "type": "link", "files": "*/index.html" -->
</ul>