Hi there, I would like to ask if there is something similar to ref (https://gohugo.io/functions/ref/) working with tags?
Thanks in advance
Can you show an example of how’d you like to use it? Like, if it worked as you want, what would the reference code look like?
Also, what is your goal? I ask, because ref
and relref
are used in a couple different contexts, but I am not sure how it worked for tags.
Hi maiki and thanks for your reply,
I would like to use it similar to ref. For example, if I want to add a reference in a page to a tag (i.e. news) use it like:
{{ reftag “news” }}
Thanks in advance
I don’t think there is anything like that, I haven’t seen it. ref
is an internal shortcode, though, so you can look and see if it can be adapted for your purposes. But it might not, because it requires the name of a file, and tags either don’t have files, or they are named _index.html
, in which case you will need to reference the full content
path, and if you are already doing that, you can just reference the tag by URL, ya know?