diff --git a/docs/content/en/about/features.md b/docs/content/en/about/features.md index 835384723..58d324853 100644 --- a/docs/content/en/about/features.md +++ b/docs/content/en/about/features.md @@ -49,7 +49,7 @@ toc: true : Leverage the embedded Markdown extensions to create tables, definition lists, footnotes, task lists, inserted text, mark text, subscripts, superscripts, and more. [Markdown render hooks] -: Override the conversion of Markdown to HTML when rendering blockquotes, fenced code blocks, headings, images, and links. For example, render every standalone image as an HTML `figure` element. +: Override the conversion of Markdown to HTML when rendering blockquotes, fenced code blocks, headings, images, links, and tables. For example, render every standalone image as an HTML `figure` element. [Diagrams] : Use fenced code blocks and Markdown render hooks to include diagrams in your content. diff --git a/docs/content/en/content-management/summaries.md b/docs/content/en/content-management/summaries.md index 7b81cf0a0..e0b2c9590 100644 --- a/docs/content/en/content-management/summaries.md +++ b/docs/content/en/content-management/summaries.md @@ -92,11 +92,11 @@ Note that the `summaryLength` is an approximate number of words. Each summary type has different characteristics: -Type|Precedence|Renders markdown|Renders shortcodes|Strips HTML tags|Wraps single lines with `
` -:--|:-:|:-:|:-:|:-:|:-: -Manual|1|:heavy_check_mark:|:heavy_check_mark:|:x:|:heavy_check_mark: -Front matter|2|:heavy_check_mark:|:x:|:x:|:x: -Automatic|3|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:x: +Type|Precedence|Renders markdown|Renders shortcodes|Wraps single lines with `
` +:--|:-:|:-:|:-:|:-: +Manual|1|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark: +Front matter|2|:heavy_check_mark:|:x:|:x: +Automatic|3|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark: ## Rendering diff --git a/docs/content/en/methods/page/Content.md b/docs/content/en/methods/page/Content.md index a9d38367c..373c6590a 100644 --- a/docs/content/en/methods/page/Content.md +++ b/docs/content/en/methods/page/Content.md @@ -5,6 +5,8 @@ categories: [] keywords: [] action: related: + - methods/page/Summary + - methods/page/ContentWithoutSummary - methods/page/RawContent - methods/page/Plain - methods/page/PlainWords @@ -13,9 +15,7 @@ action: signatures: [PAGE.Content] --- -The `Content` method on a `Page` object renders Markdown and shortcodes to HTML. The content does not include front matter. - -[shortcodes]: /getting-started/glossary/#shortcode +The `Content` method on a `Page` object renders Markdown and shortcodes to HTML. ```go-html-template {{ .Content }} diff --git a/docs/content/en/methods/page/ContentWithoutSummary.md b/docs/content/en/methods/page/ContentWithoutSummary.md new file mode 100644 index 000000000..5080f6717 --- /dev/null +++ b/docs/content/en/methods/page/ContentWithoutSummary.md @@ -0,0 +1,28 @@ +--- +title: ContentWithoutSummary +description: Returns the rendered content of the given page, excluding the content summary. +categories: [] +keywords: [] +action: + related: + - methods/page/Content + - methods/page/Summary + - methods/page/RawContent + - methods/page/Plain + - methods/page/PlainWords + - methods/page/RenderShortcodes + returnType: template.HTML + signatures: [PAGE.ContentWithoutSummary] +--- + +{{< new-in 0.134.0 >}} + +Applicable when using manual or automatic [content summaries], the `ContentWithoutSummary` method on a `Page` object renders Markdown and shortcodes to HTML, excluding the content summary from the result. + +[content summaries]: /content-management/summaries/#manual-summary + +```go-html-template +{{ .ContentWithoutSummary }} +``` + +The `ContentWithoutSummary` method returns an empty string if you define the content summary in front matter. diff --git a/docs/content/en/methods/page/Plain.md b/docs/content/en/methods/page/Plain.md index 3aae1ed61..06d2bde48 100644 --- a/docs/content/en/methods/page/Plain.md +++ b/docs/content/en/methods/page/Plain.md @@ -6,6 +6,8 @@ keywords: [] action: related: - methods/page/Content + - methods/page/Summary + - methods/page/ContentWithoutSummary - methods/page/RawContent - methods/page/PlainWords - methods/page/RenderShortcodes @@ -13,7 +15,7 @@ action: signatures: [PAGE.Plain] --- -The `Plain` method on a `Page` object renders Markdown and [shortcodes] to HTML, then strips the HTML [tags]. It does not strip HTML [entities]. The plain content does not include front matter. +The `Plain` method on a `Page` object renders Markdown and [shortcodes] to HTML, then strips the HTML [tags]. It does not strip HTML [entities]. To prevent Go's [html/template] package from escaping HTML entities, pass the result through the [`htmlUnescape`] function. diff --git a/docs/content/en/methods/page/PlainWords.md b/docs/content/en/methods/page/PlainWords.md index 4f70193fe..221fd741b 100644 --- a/docs/content/en/methods/page/PlainWords.md +++ b/docs/content/en/methods/page/PlainWords.md @@ -6,8 +6,11 @@ keywords: [] action: related: - methods/page/Content + - methods/page/Summary + - methods/page/ContentWithoutSummary - methods/page/RawContent - methods/page/Plain + - methods/page/RenderShortcodes returnType: '[]string' signatures: [PAGE.PlainWords] --- diff --git a/docs/content/en/methods/page/RawContent.md b/docs/content/en/methods/page/RawContent.md index 12686c695..e4ab8a28e 100644 --- a/docs/content/en/methods/page/RawContent.md +++ b/docs/content/en/methods/page/RawContent.md @@ -6,6 +6,8 @@ keywords: [] action: related: - methods/page/Content + - methods/page/Summary + - methods/page/ContentWithoutSummary - methods/page/Plain - methods/page/PlainWords - methods/page/RenderShortcodes diff --git a/docs/content/en/methods/page/RenderShortcodes.md b/docs/content/en/methods/page/RenderShortcodes.md index a4120f69a..9679fc8d5 100644 --- a/docs/content/en/methods/page/RenderShortcodes.md +++ b/docs/content/en/methods/page/RenderShortcodes.md @@ -5,11 +5,13 @@ categories: [] keywords: [] action: related: - - methods/page/RenderString - methods/page/Content + - methods/page/Summary + - methods/page/ContentWithoutSummary - methods/page/RawContent - methods/page/Plain - methods/page/PlainWords + - methods/page/RenderString returnType: template.HTML signatures: [PAGE.RenderShortcodes] toc: true diff --git a/docs/content/en/render-hooks/blockquotes.md b/docs/content/en/render-hooks/blockquotes.md index 607514f04..143c536d1 100755 --- a/docs/content/en/render-hooks/blockquotes.md +++ b/docs/content/en/render-hooks/blockquotes.md @@ -28,15 +28,13 @@ Blockquote render hook templates receive the following [context]: {{< new-in 0.134.0 >}} -(`hstring.HTML`) Applicable when [`Type`](#type) is `alert` when using [Obsidian callouts] syntax, this is the alert title converted to HTML. +(`template.HTML`) Applicable when [`Type`](#type) is `alert`, this is the alert title. See the [alerts](#alerts) section below. ###### AlertSign {{< new-in 0.134.0 >}} -(`string`) Applicable when [`Type`](#type) is `alert` when using [Obsidian callouts] syntax, this is one of "+", "-" or "" (empty string) to indicate the presence of a foldable sign. - -[Obsidian callouts]: https://help.obsidian.md/Editing+and+formatting/Callouts +(`string`) Applicable when [`Type`](#type) is `alert`, this is the alert sign. Typically used to indicate whether an alert is graphically foldable, this is one of `+`, `-`, or an empty string. See the [alerts](#alerts) section below. ###### Attributes @@ -59,7 +57,7 @@ block = true ###### PageInner -(`page`) A reference to a page nested via the [`RenderShortcodes`] method. +(`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details). [`RenderShortcodes`]: /methods/page/rendershortcodes @@ -68,7 +66,7 @@ block = true (`string`) The position of the blockquote within the page content. ###### Text -(`string`) The blockquote text, excluding the alert designator if present. See the [alerts](#alerts) section below. +(`template.HTML`) The blockquote text, excluding the first line if [`Type`](#type) is `alert`. See the [alerts](#alerts) section below. ###### Type @@ -82,7 +80,7 @@ In its default configuration, Hugo renders Markdown blockquotes according to the {{< code file=layouts/_default/_markup/render-blockquote.html copy=true >}}
- {{ .Text | safeHTML }} + {{ .Text }}{{< /code >}} @@ -91,7 +89,7 @@ To render a blockquote as an HTML `figure` element with an optional citation and {{< code file=layouts/_default/_markup/render-blockquote.html copy=true >}}
- {{ .Text | safeHTML }} + {{ .Text }}{{ with .Attributes.caption }}
{{ else }}{{ transform.Emojify (index $emojis .AlertType) }} - {{ or (i18n .AlertType) (title .AlertType) }} + {{ with .AlertTitle }} + {{ . }} + {{ else }} + {{ or (i18n .AlertType) (title .AlertType) }} + {{ end }}
- {{ .Text | safeHTML }} + {{ .Text }}
- {{ .Text | safeHTML }} + {{ .Text }}{{ end }} {{< /code >}} @@ -173,7 +194,6 @@ tip = 'Tip' warning = 'Warning' {{< /code-toggle >}} - Although you can use one template with conditional logic as shown above, you can also create separate templates for each [`Type`](#type) of blockquote: ```text @@ -183,3 +203,5 @@ layouts/ ├── render-blockquote-alert.html └── render-blockquote-regular.html ``` + +{{% include "/render-hooks/_common/pageinner.md" %}} diff --git a/docs/content/en/render-hooks/headings.md b/docs/content/en/render-hooks/headings.md index 8ae3b808a..dc64296ea 100755 --- a/docs/content/en/render-hooks/headings.md +++ b/docs/content/en/render-hooks/headings.md @@ -55,7 +55,7 @@ title = true ###### Text -(`string`) The heading text. +(`template.HTML`) The heading text. ## Examples @@ -65,7 +65,7 @@ In its default configuration, Hugo renders Markdown headings according to the [C {{< code file=layouts/_default/_markup/render-heading.html copy=true >}}
+ {{- .Text -}} + | + {{- end }} +
---|
+ {{- .Text -}} + | + {{- end }} +