Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Last active April 29, 2022 04:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save miguelmota/9ae24ecbcc647a0717cdb1b28a8371f9 to your computer and use it in GitHub Desktop.
Save miguelmota/9ae24ecbcc647a0717cdb1b28a8371f9 to your computer and use it in GitHub Desktop.
Hugo render from JSON file data
<!-- posts.json must be at root level -->
{{ $items := getJSON "posts.json" }}
{{ range $item := $items }}
<a href="{{ $item.url }}">{{ $item.name }}</a>
{{ end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment