Dynamic parameter on deploy

Hi there,

I’d like to display the temperature of a particular river on my Hugo website. There’s a simple API call I can make which returns me some JSON with this information. So what I’m looking for is a way to make this HTTP request once the website is deployed. I guess this would have to be saved as some of dynamic parameter which I could then just print on the header template file.

Would this be possible? Thanks!

You can obtain a static value (updated on each Hugo build) with resources.GetRemote or getJSON.

To obtain the value dynamically (each time a page is refreshed) you’ll need to use JS.


Thank you! I will just set the blog to be deployed periodically, so getJSON works just fine.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.