As we know, hugo is pretty annoying sometimes. I wanted to add a new shortcode on the following premise:
Front matter:
|
|
Code in post
{{< download random_name >}}
The Problem
The problem was that I didn’t know how to tell that I want the (.Get 0) part of the shortcode to be pulled out of the $.Page.Params
variable.
The Solution
Instead of trying all possible variations of with various ticks and quotes, I found this better and more elegant solution: $.Page.Params.$(Get 0)
{{ $download := index $.Page.Params (.Get 0) }}/
|
|
Ez pz.