Hugo: How to get the tags set on the current page

Published: 2020-01-08 19:37:52 -0500 -0500

Reading time: 1 mins (73 words)

Tags: hugo

problem

I use Hugo to statically-generate my sites. In one of my templates, I want to be able to get the tags set on a current page. How can I get those?

solution

Here’s how you can get the tags of the current page:

{{ .Param "tags" }}

This will display the tags set on the current page (if they exist). Seriously, you can just pop that into a template and they’ll appear.

About the Ham

Hi I'm Hamilton and I wrote / built this! I like doing lots of things, but mostly I like to build (and then share those buildings). Some things I'm currently building: art, software, and prose. To stay up-to-date with my latest buildings, subscribe to my email list or follow one of my many other accounts. #buildit #shipit #justhamit

comments powered by Disqus