How to add site parameter into url in html file?

Hi there,

I want to add Vimeo video into /layout/index.html, so tried the followings:

  1. {{< vimeo 782787897 >}}, this failed, seems this shortcode can not work in html;
<!-- vimeo -->
{{ if .Site.Params.vimeo.enable }}
<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
  <iframe src="https://player.vimeo.com/video/344519650" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="vimeo video" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>
{{ end }}
<!-- /vimeo -->

The option 2 works but it’s not good to hardcoded the video id, so want to change https://player.vimeo.com/video/344519650 into https://player.vimeo.com/video/{{ .Site.Params.vimeo.id }}

I setup the parameters in config.toml as below:

####################### hero video #######################################
[params.vimeo]
enable = true
id = “344519650”

But this change doesn’t work, I will appreciate if any ideas. Thanks.

All right, I find the following works.

https://player.vimeo.com/video/{{ $.Site.Params.vimeo.id }}

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.