Hi - a general question about
getJSON 's data. I understand that:
- getJSON will store its data under
$TMPDIR/hugo_cache/projectname/filecache/getjson/in a file with a uuid name like
- you can force a re-download of this data by using the switch
hugocommand, so taking that off will re-use whatever is there.
Instead of manually downloading some json file to
data under the project, I converted to use
When you use it in an index where the resulting files are few, running without
--ignoreCache is not a problem. But when you put it in a
single.html template, especially when there’s a lot of pages, you are looking at lots of API calls to re-get the same file.
What I’m wondering about is, while I can assign the
getJSON result into a variable and use it on that page, can I “re-use” that variable on the
single.html in some way? If I can, I can leave off
--ignoreCache, let the data be downloaded newly by the
index and then re-use it in the
If I could specify the location exactly without a random uuid, I could call it consistently across local and CI environments perhaps. It also looks like I can use
getJSON on a local file so, that should be possible. However, is that uuid going to be referenceable between, say, local and a CI.
Is there a strategy for this? I hope someone might have wrestled with this previously.