@@ -63,7 +63,7 @@ definition lists.
63
63
64
64
## Shortcodes
65
65
66
- Shortcodes are simple snippets of code that can be used to modify a markdown
66
+ Shortcodes are simple snippets of code that can be used to modify a Markdown
67
67
page by adding content or changing the appearance of content in a page. See
68
68
Hugo's [ shortcode documentation] ( https://gohugo.io/content-management/shortcodes/ )
69
69
for general information about shortcodes.
@@ -82,11 +82,29 @@ to a shortcode file located in `chef-web-docs/layouts/shortcodes`.
82
82
83
83
To add that shortcode to a page in ` chef-web-docs/content ` , add the file name,
84
84
minus the .md suffix, wrapped in double curly braces and percent symbols to
85
- the location in the markdown page where you want that text included. For example,
85
+ the location in the Markdown page where you want that text included. For example,
86
86
if you want to add the text in ` shortcode_file_name.md ` to a page, add
87
87
` {{% shortcode_file_name %}} ` to the text of that page and it will appear when
88
88
Hugo rebuilds the documentation.
89
89
90
+ ** Shortcodes in lists**
91
+
92
+ Hugo doesn't handle shortcodes that are indented in a list item properly. It intereprets
93
+ the text of the shortcode as a code block. More complicated shortcodes with
94
+ code blocks, notes, additional list items, or other formatting look pretty
95
+ bad. We've created a simple shortcode for handling shortcodes in lists or definition
96
+ lists called ` shortcode_indent ` .
97
+
98
+ To include a shortcode in a list or definition list, just add its file name
99
+ to the ` shortcode ` parameter of ` shortcode_indent ` without the .md suffix.
100
+
101
+ For example, if you wanted to add ` shortcode_file_name.md ` to a list:
102
+ ``` md
103
+ 1. Here is some text introducing the shortcode, but it's not necessary.
104
+
105
+ {{< shortcode_indent shortcode="shortcode_file_name" >}}
106
+ ```
107
+
90
108
### Highlighting blocks of text
91
109
92
110
We also use shortcodes to highlight text in notes, warnings or danger notices.
@@ -99,12 +117,36 @@ that you want in a note using opening and closing shortcode notation. For exampl
99
117
Note text that gives the user additional important information.
100
118
101
119
{{< /note >}}
102
-
103
120
```
104
121
105
122
To add a warning or danger, replace the word ` note ` with ` warning ` or ` danger ` in the
106
123
example above.
107
124
125
+ ** Notes in lists**
126
+
127
+ Hugo doesn't handle shortcodes that are indented in lists very well, that includes the Note,
128
+ Warning, and Danger shortcodes. It interprets the indented text that's inside
129
+ the Note as a code block when it should be interpreted as Markdown.
130
+
131
+ To resolve this problem, there's a ` spaces ` parameter that can be added to the Note,
132
+ Warning, and Danger shortcodes. The value of spaces should be set to the number
133
+ of spaces that the note is indented.
134
+
135
+ For example:
136
+ ```
137
+ This is a list:
138
+
139
+ - List item.
140
+
141
+ {{< note spaces=4 >}}
142
+
143
+ Text that gives the user additional important information about that list item.
144
+
145
+ {{< /note >}}
146
+ ```
147
+
148
+ This parameter also works on Danger and Warning shortcodes.
149
+
108
150
## Sending feedback
109
151
110
152
We love getting feedback. You can use:
0 commit comments