archetypes/hugo-release-notes.md
+++
title = '{{ replace .Name "-" " " | title }}'
date = {{ .Date }}
draft = false
+++
{{ with data.GetJSON (os.Getenv "HUGO_REMOTE_URL") }}
{{ .body }}
{{ end }}
command
HUGO_REMOTE_URL="https://api.github.com/repos/gohugoio/hugo/releases/tags/v0.92.0" hugo new hugo-release-notes/v0.92.0.md
The resulting page is static. If the remote data changes and you rebuild the site, the page will not change.
If you want the page to get the current remote data when you rebuild the site, store the env value in a page param, and use a shortcode to retrieve the data.
archetypes/hugo-release-notes.md
+++
title = '{{ replace .Name "-" " " | title }}'
date = {{ .Date }}
draft = false
remote_url = "{{ os.Getenv "HUGO_REMOTE_URL" }}"
+++
{{< shortcode-that-retrieves-data >}}
This works because the shortcode is not evaluated when creating the page with hugo new
.