Use variable inside Hugo content -


i'm trying use variable within content of hugo statically generated site. example, content looks following:

  1. go site's url ({{ .site.baseurl }})
  2. enter credentials
  3. .....(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:

  1. 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

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -