How to auto-generate html from jade file when only included markdown file has changed in livereload development environment?

大兔子大兔子 提交于 2019-12-06 17:04:24

问题


So I've got a file like this:

# index.html.jade
p Test
include content.md

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 :-( )

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):

  • the (jade) change-checking should also consider dependent files that may influence the output (e.g. included 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

回答1:


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

More details here.



来源:https://stackoverflow.com/questions/25591806/how-to-auto-generate-html-from-jade-file-when-only-included-markdown-file-has-ch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!