Skip to content

Commit

Permalink
Add some doc
Browse files Browse the repository at this point in the history
  • Loading branch information
chevdor committed Nov 12, 2021
1 parent f266212 commit 9f1bf57
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@ The **tera** engine allows way more than the simple replacements shown above. Yo

cargo install --git https://github.com/chevdor/tera-cli

## Hot reload

You may find it useful to watch a folder with your templates and run `tera` if a template changes. For this to work, it is recommended to
name you template as `foobar.md.tera` if your template expands into a markdown file for instance.
You may then use [fswatch](https://github.com/emcrisostomo/fswatch) and watch a `templates` folder using:

fswatch templates -e ".*\.md$" | \
xargs -n1 -I{} \
tera --include-path templates \
--template templates/template.md.tera context.json

## Execute as Docker container

You can find a `tera` Docker image at `chevdor/tera`. The image is very small and should be less than 8MB.
Expand Down
13 changes: 13 additions & 0 deletions README_src.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ The **tera** engine allows way more than the simple replacements shown above. Yo

cargo install --git https://github.com/chevdor/tera-cli

== Hot reload

You may find it useful to watch a folder with your templates and run `tera` if a template changes. For this to work, it is recommended to
name you template as `foobar.md.tera` if your template expands into a markdown file for instance.
You may then use https://github.com/emcrisostomo/fswatch[fswatch] and watch a `templates` folder using:

```
fswatch templates -e ".*\.md$" | \
xargs -n1 -I{} \
tera --include-path templates \
--template templates/template.md.tera context.json
```

== Execute as Docker container

You can find a `tera` Docker image at `chevdor/tera`. The image is very small and should be less than 8MB.
Expand Down

0 comments on commit 9f1bf57

Please sign in to comment.