Use variable inside Hugo content -
i'm trying use variable within content of hugo statically generated site. example, content looks following:
- go site's url ({{ .site.baseurl }})
- enter credentials
- .....(blah blah blah)
when gets rendered, {{ .... }} part doesn't processed...it stays same put above. i've tried '$' in front well. variables within templates seem work fine. need create shortcode use within content pages?
so looks shortcode way this. it's worth, changed document following:
- go site's url ({{< siteurl >}})
in layouts/shortcodes
, created file siteurl.html
. looks following:
{{ .page.site.baseurl }}
i needed add .page in there access site variables. see issue report more details.
Comments
Post a Comment