I am trying to create a shortcode that outputs the value of the .Site.BaseUrl variable. My goal was to confirm templates worked with a simple test.
I created a template called layotus/shortcodes/footest.html
I riffed on the simple example from the documentation
{{ .Get “title” }}
I called the template from Markdown.
{{% footest %}}
In the generated page, all I get is an empty <p></p>. So something is happening but there is no output. What am I doing wrong?
BTW, it appears that a template must have a .html extension which isn’t mentioned really in the docs. I’ll fix the docs once I get my own shortcode working.
Thank you @lotrfan that sorted me out. Also, your examples were super clear…I’ll move those to the docs too.
And looking at the code it looks like it looks like the variables have to be .Page also. This wasn’t immediately obvious to me. Anyway, I’ll take a stab at a page rewrite to clarify this stuff.