Search code examples
pugmarkdowndocpad

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

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

Solution

  • 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.