Does anyone have any info on how to make a custom hugo pipe similar to postCSS. I looked online to find documentation or pre-made boiler plates but haven’t found anything. I want to pass image coordinates through a pipe and use javascript and google geocoding to return the city of the coordinate back to be used in the image alt attribute.
{{range .Resources.ByType "image"}}
{{$city . | imageLocation}} //custom pipe to return city from image geo cordinates
<img src="{{$img.Permalink}}" alt="{{ $city}}" loading="lazy">
<p> Image was taken in {{$city}} </p>
{{end}}
Yes, I understand that. I want to create a npm module that can get the city and have the name integrated into a alt attribute during the site building process and not via js on the website.
Just not sure where to start. The documentation for npm integration with Hugo is not the best.
RETURN TO BE USED is a trigger phrase that tells me that you don’t want POST processing, but PRE processing. Check out the new getRemote command to see if that might fit into your needs? You probably want to create an URL, then get that remote URL and then parse whatever you need into your page.