Skip to content

Commit

Permalink
Document ContentWithoutSummary
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring authored Sep 3, 2024
1 parent de3c756 commit 39dac58
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 10 deletions.
10 changes: 5 additions & 5 deletions content/en/content-management/summaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<p>`
:--|:-:|:-:|:-:|:-:|:-:
Manual|1|:heavy_check_mark:|:heavy_check_mark:|:x:|:heavy_check_mark:
Front&nbsp;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 `<p>`
:--|:-:|:-:|:-:|:-:
Manual|1|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:
Front&nbsp;matter|2|:heavy_check_mark:|:x:|:x:
Automatic|3|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:

## Rendering

Expand Down
6 changes: 3 additions & 3 deletions content/en/methods/page/Content.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ categories: []
keywords: []
action:
related:
- methods/page/Summary
- methods/page/ContentWithoutSummary
- methods/page/RawContent
- methods/page/Plain
- methods/page/PlainWords
Expand All @@ -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 }}
Expand Down
26 changes: 26 additions & 0 deletions content/en/methods/page/ContentWithoutSummary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
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]
---

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.
4 changes: 3 additions & 1 deletion content/en/methods/page/Plain.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ keywords: []
action:
related:
- methods/page/Content
- methods/page/Summary
- methods/page/ContentWithoutSummary
- methods/page/RawContent
- methods/page/PlainWords
- methods/page/RenderShortcodes
returnType: string
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.

Expand Down
3 changes: 3 additions & 0 deletions content/en/methods/page/PlainWords.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
---
Expand Down
2 changes: 2 additions & 0 deletions content/en/methods/page/RawContent.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion content/en/methods/page/RenderShortcodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 39dac58

Please sign in to comment.