mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Merge commit 'f96384a3b596f9bc0a3a035970b09b2c601f0ccb'
This commit is contained in:
@@ -1,19 +1,13 @@
|
||||
---
|
||||
title: Shortcode Variables
|
||||
linktitle: Shortcode Variables
|
||||
description: Shortcodes can access page variables and also have their own specific built-in variables.
|
||||
date: 2017-03-12
|
||||
publishdate: 2017-03-12
|
||||
categories: [variables and params]
|
||||
keywords: [shortcodes]
|
||||
menu:
|
||||
docs:
|
||||
parent: "variables"
|
||||
parent: variables
|
||||
weight: 20
|
||||
weight: 20
|
||||
sections_weight: 20
|
||||
aliases: []
|
||||
toc: false
|
||||
---
|
||||
|
||||
[Shortcodes][shortcodes] have access to parameters delimited in the shortcode declaration via [`.Get`][getfunction], page- and site-level variables, and also the following shortcode-specific fields:
|
||||
@@ -39,9 +33,13 @@ toc: false
|
||||
.Inner
|
||||
: represents the content between the opening and closing shortcode tags when a [closing shortcode][markdownshortcode] is used
|
||||
|
||||
[getfunction]: /functions/get/
|
||||
[markdownshortcode]: /content-management/shortcodes/#shortcodes-with-markdown
|
||||
[shortcodes]: /templates/shortcode-templates/
|
||||
.Scratch
|
||||
: returns a writable [`Scratch`][scratch] to store and manipulate data which will be attached to the shortcode context. This scratch is reset on server rebuilds.
|
||||
|
||||
.InnerDeindent {{< new-in "0.100.0" >}}
|
||||
: Gets the `.Inner` with any indentation removed. This is what's used in the built-in `{{</* highlight */>}}` shortcode.
|
||||
|
||||
[getfunction]: /functions/get/
|
||||
[markdownshortcode]: /content-management/shortcodes/#shortcodes-with-markdown
|
||||
[shortcodes]: /templates/shortcode-templates/
|
||||
[scratch]: /functions/scratch
|
||||
|
Reference in New Issue
Block a user