Document the comment shortcode

This commit is contained in:
Joe Mooring 2024-11-05 05:23:03 -08:00 committed by GitHub
parent 83d7d3005a
commit 109efe3ebb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 0 deletions

View File

@ -74,6 +74,26 @@ You can call shortcodes within other shortcodes by creating your own templates t
Use these embedded shortcodes as needed.
### comment
{{< new-in "0.137.1" >}}
{{% note %}}
To override Hugo's embedded `comment` shortcode, copy the [source code] to a file with the same name in the layouts/shortcodes directory.
[source code]: {{% eturl comment %}}
{{% /note %}}
Use the `comment` shortcode to include comments in your Markdown. Hugo excludes the encapsulated text when rendering your site.
Example usage:
```text
{{%/* comment */%}} TODO: rewrite the paragraph below. {{%/* /comment */%}}
```
Although you can call this shortcode using the `{{</* */>}}` notation, computationally it is more efficient to call it using the `{{%/* */%}}` notation as shown above.
### figure
{{% note %}}

View File

@ -24,6 +24,7 @@
'render-codeblock-goat' = '_default/_markup/render-codeblock-goat.html'
# Shortcodes
'comment' = 'shortcodes/comment.html'
'figure' = 'shortcodes/figure.html'
'gist' = 'shortcodes/gist.html'
'highlight' = 'shortcodes/highlight.html'