Skip to content

Commit

Permalink
Documentation: add docs for the unsafe view option
Browse files Browse the repository at this point in the history
See also #73
  • Loading branch information
mzeinstra authored Aug 17, 2023
1 parent dcf2dae commit db38f9c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ The following view should generate a file for each result and use the `qid` SPAR
template: "work.html"
```

HTML templates are automatic, context-sensitive escaping, safe against code injection. When you need to create templates for JS, JSON, etc. add the ```unsafe: true``` option in order to render the file as text.

```yaml
- output: "works/{{qid}}.json"
query: "works.rq"
template: "work.json"
unsafe: true
```

Now you can generate the site by running `snowman build`. Your static site should appear in the `site` directory in the root directory of your project. To start the server and view your site, run the `snowman server` command.

## Documentation
Expand Down

0 comments on commit db38f9c

Please sign in to comment.