I'm looking for a command line tool that would watch a project directory and compile HTML files.
Use-case description:
Occasionally I'm building static HTML sites. But changing footer and header content on every page is tedious. I hope that there's some command line tool that would allow to include other HTML files (e.g. header and footer) and then compile them into final HTML files. And maybe do that automatically while watching a project directory.
Requirements:
It should use plain HTML mostly (i.e. it shouldn't use its own syntax like HAML to create HTML tags).
It should allow to include other HTML files. For example
header.html
andfooter.html
.It should have some conditional mechanism to handle menus (namely inserting class in
header.html
depending on what content page it is).It could possibly watch a project directory and compile the files OR it could be run as a command line tool. For example if
page.html
was to include externalheader.html
andfooter.html
templates in it, the resulting compiledpage.html
would have header and footer parts embedded in it.
Something similar: A similar workflow is with Zurb's "Foundation for Emails 2". It's installed with NPM. And then it is launched in a project folder using command line. It has variables that are 'global' across templates. It allows to include templates in other templates. After compilation I get a folder with static html files.
What I'm NOT looking for: I'm not looking for front-end on-the-fly compilation frameworks like React or VUE. I'm also not looking for a GUI HTML editor.
bash
orTerminal
? Is this what you are asking?