Skip to content

Commit

Permalink
Document the comment shortcode
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring committed Nov 5, 2024
1 parent 63d9dd8 commit 111db4d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions content/en/content-management/shortcodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,24 @@ You can call shortcodes within other shortcodes by creating your own templates t

Use these embedded shortcodes as needed.

### comment

{{% 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 %}}
Expand Down
1 change: 1 addition & 0 deletions data/embedded_template_urls.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 111db4d

Please sign in to comment.