Skip to content

Commit ee234c9

Browse files
authored
Create hugo shortcode for embedding external json files (#1521)
1 parent fb9b110 commit ee234c9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

layouts/shortcodes/external-json.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{{ $raw := resources.GetRemote (.Get 0) }}
2+
{{ $data := transform.Unmarshal $raw.Content }}
3+
{{ $prettyJson := $data | jsonify (dict "prefix" " " "indent" " ") }}
4+
{{ highlight $prettyJson "json" "" }}

0 commit comments

Comments
 (0)