mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
Merge commit '346b60358dd8ec2ca228e6635bff9d7914b398b7'
This commit is contained in:
39
docs/content/en/shortcodes/comment.md
Executable file
39
docs/content/en/shortcodes/comment.md
Executable file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
title: Comment
|
||||
description: Include hidden comments in your content with the comment shortcode.
|
||||
categories: [shortcodes]
|
||||
keywords: []
|
||||
menu:
|
||||
docs:
|
||||
identifier: shortcodes-comment
|
||||
parent: shortcodes
|
||||
weight:
|
||||
weight:
|
||||
expiryDate: 2025-01-22 # with v0.142.0 and later use HTML comments instead
|
||||
---
|
||||
|
||||
{{% 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 %}}
|
||||
|
||||
{{< new-in "0.137.1" >}}
|
||||
|
||||
Use the `comment` shortcode to include comments in your content. Hugo will ignore the text within these comments when rendering your site.
|
||||
|
||||
Use it inline:
|
||||
|
||||
```text
|
||||
{{%/* comment */%}} rewrite the paragraph below {{%/* /comment */%}}
|
||||
```
|
||||
|
||||
Or as a block comment:
|
||||
|
||||
```text
|
||||
{{%/* comment */%}}
|
||||
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.
|
Reference in New Issue
Block a user