knative / website

Hugo templates for the Knative website.
https://knative.dev
Other
23 stars 70 forks source link

Investigate nested shortcodes (how to use .Parent variables) #227

Open RichieEscarez opened 4 years ago

RichieEscarez commented 4 years ago

A PR from last Oct added this to the Hugo docs: https://gohugo.io/content-management/shortcodes/#nested-shortcodes

"You can call shortcodes within other shortcodes by creating your own templates that leverage the .Parent variable. .Parent allows you to check the context in which the shortcode is being called."

The example: https://gohugo.io/templates/shortcode-templates/#nested-shortcode-image-gallery

Action: Look into whether this fixes the issues with using our readfile shortcode to add README files (today, any shortcodes in the README.md files simply render the shortcode as text and fails to process the shortcode - for example dynamically add version numbers or branch names