Tags v0.4.0
in Go, we always use template.ParseGlob
for parsing multiple files at once, it's a very useful function, but it can't support mulit path; we also use fsnotify
a Go library to provide cross-platform filesystem notifications on Windows, Linux, macOS, BSD, and illumos to watch template / media / assets / config file change, and it can't support mulit path too.
there are some ways to choose, one is filepath.Walk
, to get all of the dir under the target dir, another is add an seeting option in the config.toml
.
we think the second is the best, if your have few templates, you don't need to use it, but if your have many templates, you can add multiple dir or deep dir by your self, this can parse by template
lib and watch by fsnotify
lib.
USE
1# add template option to config.toml
2[[template]]
3name = "templates"
4subtree = ["x", "customize"]
1// editor tailwind.config.js to multiple path
2content: ["./templates/**/*.html"],
ADD
- add multi path for template