I have a shortcode that inserts structured data on my page for SEO.
I’m wondering how I can reference a static image file and return the URL.
Currently, I’m doing this:
“logo”: {{ print .Site.BaseURL “icons/favicon.svg” }},
“image”: [
{{ print .Site.BaseURL “icons/favicon.svg” }},
{{ print .Site.BaseURL “icons/logo_text_blue.svg” }}
],
However I would like to do something like {{ ref . “/icons/favicon.svg” }}, but that doesn’t work. I think it only works for pages.
By that doesn’t work, I mean that I get an error saying page not found.
But, I have the image in /static/icons/favicon.svg.
Does ref only work with content pages?
ERROR [en] REF_NOT_FOUND: Ref “/icons/favicon.svg”: “/Users/ntenpas/Desktop/presence-site/hugo/content/_index.md:11:1”: page not found
ERROR Rebuild failed: logged 1 error(s)