From eeaf343a148dc1a0585fc63b8f9789add57bd0ab Mon Sep 17 00:00:00 2001 From: Jorin Vogel Date: Wed, 1 Oct 2014 14:51:25 +0700 Subject: [PATCH] Mention .Params and .Page variables in shortcode docs. Also `highlight` variables. --- docs/content/extras/shortcodes.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/content/extras/shortcodes.md b/docs/content/extras/shortcodes.md index 3d0c7d92a..4579a77dd 100644 --- a/docs/content/extras/shortcodes.md +++ b/docs/content/extras/shortcodes.md @@ -128,11 +128,11 @@ parameters named parameters work best. **Inside the template** -To access a parameter by position the .Get method can be used. +To access a parameter by position the `.Get` method can be used. {{ .Get 0 }} -To access a parameter by name the .Get method should be utilized +To access a parameter by name the `.Get` method should be utilized {{ .Get "class" }} @@ -147,11 +147,15 @@ or both. {{ or .Get "title" | .Get "alt" | if }} alt="{{ with .Get "alt"}}{{.}}{{else}}{{.Get "title"}}{{end}}"{{ end }} -If a closing shortcode is used, the variable .Inner will be populated with all +If a closing shortcode is used, the variable `.Inner` will be populated with all of the content between the opening and closing shortcodes. If a closing -shortcode is required, you can check the length of .Inner and provide a warning +shortcode is required, you can check the length of `.Inner` and provide a warning to the user. +The variable `.Params` contains the list of parameters in case you need to do more complicated things than `.Get`. + +You can also use the variable `.Page` to access all the normal [Page Variables](/templates/variables/). + ## Single Positional Example: youtube {{% youtube 09jf3ow9jfw %}}