在livereload开发环境中仅更改包含的markdown文件时,如何从jade文件自动生成html? [英] How to auto-generate html from jade file when only included markdown file has changed in livereload development environment?
问题描述
所以我有一个像这样的文件:
So I've got a file like this:
# index.html.jade
p Test
include content.md
因此如果我更改了content.md
out/index.html
的内容,则不会重新生成(因为index.html.jade
文件本身当然没有发生变化).
(我正在使用 livereload -
So if I change the content of content.md
out/index.html
is not regenerated (because the index.html.jade
file itself of course has not changed).
(I am using livereload - in the HTML 5 Boilerplate docpad template - and the so the browser does not refresh on a valid change :-( )
另一方面,先前版本和当前版本(在content.md
更改之后)的最终out/index.html
文件是不同的(很可能是在可见的更改上).
On the other hand the final out/index.html
file of the previous and current version (after the content.md
change) are different (most likely on visible changes).
我看到了如何/应该如何处理(也许已经可行)的方法:
I see ways how this could/should be treated (maybe it is already possible):
-
(玉器)更改检查还应考虑可能影响输出的相关文件(例如
include
d文件),从而在包含的文件发生更改时重新生成包含的文件
the (jade) change-checking should also consider dependent files that may influence the output (e.g.
include
d files) and thus regenerate the including files if the included ones changed
解决方法(如果在框架内上述操作应比较棘手):
workarounds (if the above should be tricky within the framework):
- 用于在对某些其他文件进行更改时重新生成全部或某些文件的选项(或至少重新生成所有文件以便于开发)
- 如果项目不是很大,那没什么大不了的
- option to regenerate all or some files on changes to certain other ones (or at least a re-generation of all files for ease of development)
- if the project is not too big this should be no big deal
推荐答案
Ha ...发现了简单的内置解决方案:在元数据区域中添加
referencesOthers: true
可以做到这一点:-)Ha ... easy built-in solution discovered: adding
referencesOthers: true
in the meta data area does it :-)--- title: my cool page layout: default referencesOthers: true --- include some.markdown.file.md
更多详细信息此处.
这篇关于在livereload开发环境中仅更改包含的markdown文件时,如何从jade文件自动生成html?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!