iNaturalist shortcode for Hugo
For my recent post about the Alta Via 1, I wanted to integrate iNaturalist observations. To make this easier, I made a Hugo shortcode that calls the iNaturalist API and renders an observation in detail automatically.
This turns
{{< inat "https://www.inaturalist.org/observations/50674264" >}}
into
The source code for this shortcode is below. It can be placed in /layouts/shortcodes/
.
To look nice, it will also require some CSS integration into the theme that is used. A sample set of CSS rules is here: