- Add test for JSON output creation - Add single.json in bare_min layouts/_default for this testing purpose - Update debugprint.html partial to pretty-print the outputs Parammaster
parent
55e396454c
commit
fd7eb84947
6 changed files with 73 additions and 12 deletions
@ -0,0 +1,9 @@ |
||||
+++ |
||||
title = "Setting empty outputs is fine" |
||||
tags = ["outputs", "empty"] |
||||
draft = false |
||||
+++ |
||||
|
||||
If the `EXPORT_HUGO_OUTPUTS` property is left empty/unset, `ox-hugo` |
||||
will not set the `outputs` variable in the front-matter at all. So |
||||
only the HTML output will be created (default). |
||||
@ -0,0 +1,11 @@ |
||||
+++ |
||||
title = "Output HTML and JSON" |
||||
outputs = ["html", "json"] |
||||
tags = ["outputs", "json"] |
||||
draft = false |
||||
+++ |
||||
|
||||
**Note**: A `single.json` is required to be at a valid location in the |
||||
template lookup hierarchy for the JSON outputs to be created. |
||||
|
||||
[Here's the JSON output version of this page](./index.json). |
||||
@ -0,0 +1,7 @@ |
||||
{ |
||||
"uri": "{{ .Permalink }}", |
||||
"title": "{{ .Title | htmlEscape }}", |
||||
"tags": [{{ range $tindex, $tag := .Params.tags }}{{ if $tindex }}, {{ end }}"{{ $tag| htmlEscape }}"{{ end }}], |
||||
"description": "{{ .Description | htmlEscape }}", |
||||
"content": "{{ range $i, $words := .PlainWords }}{{ $words | htmlEscape }} {{ end }}" |
||||
} |
||||
Loading…
Reference in new issue