Skip to content

Developing

Adam Kostarelas edited this page Jul 18, 2022 · 2 revisions

Info on developing HuTasker

Handy Hugo related items

Force Hugo to download new data when developing

Adding the flag --ignoreCache forces Hugo do re-download the JSON. Handy if you're making changes to an API and want to see changes. Warning, can make you go over your API limits, so use sparingly.

Pass environment variables to hugo command:

Using the following will allow you to overwrite params or other configs within Hugo: env HUGOxPARAMSxAPIxKEY="Secret Key" Overwrites the params.toml API key="" to "Secret Key" Good if you don't want to commit sensitive info to a pubic repo

Pass data to a partial.

When loading a partial, it won't have the same scope as the page that the data is coming from. You can pass data by adding it at the end of the partial. e.g.: {{ partial "foo.html" (dict "context" .) }}. You can then call this with {{ $context := .context }}

Clone this wiki locally