Permalink
Browse files

Add config option "summaryLength" (#600)

* Add config option "summaryLength"

*Updated to include "summaryLength" configuration option from
gohugoio/hugo#3924
*Took line about HTML loading in summary and updated it to clarify the user has options to show html or not instead of implying there are no options
*Fixed typos

@kaushalmodi moved the Org mode `# more` syntax sentence to a new paragraph.
  • Loading branch information...
brennanangel authored and kaushalmodi committed Sep 12, 2018
1 parent ced7f20 commit 96287a20a122aed704b33bfffcdb1100dcccebfa
Showing with 14 additions and 12 deletions.
  1. +14 −12 content/en/content-management/summaries.md
@@ -21,28 +21,30 @@ With the use of the `.Summary` [page variable][pagevariables], Hugo generates su
## Summary Splitting Options
* Hugo-defined Summary Split
* User-defined Summary Split
* Automatic Summary Split
* Manual Summary Split
It is natural to accompany the summary with links to the original content, and a common design pattern is to see this link in the form of a "Read More ..." button. See the `.RelPermalink`, `.Permalink`, and `.Truncated` [page variables][pagevariables].
### Hugo-defined: Automatic Summary Splitting
### Automatic Summary Splitting
By default, Hugo automatically takes the first 70 words of your content as its summary and stores it into the `.Summary` page variable for use in your templates. Taking the Hugo-defined approach to summaries may save time, but it has pros and cons:
By default, Hugo automatically takes the first 70 words of your content as its summary and stores it into the `.Summary` page variable for use in your templates. You may customize the summary length by setting `summaryLength` in your [site configuration](/getting-started/configuration/).
Pros
: Automatic, no additional work on your part.
Cons
: All HTML tags are stripped from the summary, and the first 70 words, whether they belong to a heading or to different paragraphs, are all put into one paragraph.
{{% note %}}
You can customize how HTML tags in the summary are loaded using functions such as `plainify` and `safeHTML`.
{{% /note %}}
{{% note %}}
The Hugo-defined summaries are set to use word count calculated by splitting the text by one or more consecutive white space characters. If you are creating content in a `CJK` language and want to use Hugo's automatic summary splitting, set `hasCJKLanguage` to `true` in you [site configuration](/getting-started/configuration/).
The Hugo-defined summaries are set to use word count calculated by splitting the text by one or more consecutive whitespace characters. If you are creating content in a `CJK` language and want to use Hugo's automatic summary splitting, set `hasCJKLanguage` to `true` in your [site configuration](/getting-started/configuration/).
{{% /note %}}
### User-defined: Manual Summary Splitting
### Manual Summary Splitting
Alternatively, you may add the <code>&#60;&#33;&#45;&#45;more&#45;&#45;&#62;</code> summary divider where you want to split the article.
For [Org mode content][org], use `# more` where you want to split the article.
Alternatively, you may add the <code>&#60;&#33;&#45;&#45;more&#45;&#45;&#62;</code> summary divider where you want to split the article. For [org content][org], use `# more` where you want to split the article. Content that comes before the summary divider will be used as that content's summary and stored in the `.Summary` page variable with all HTML formatting intact.
Content that comes before the summary divider will be used as that content's summary and stored in the `.Summary` page variable with all HTML formatting intact.
{{% note "Summary Divider"%}}
The concept of a *summary divider* is not unique to Hugo. It is also called the "more tag" or "excerpt separator" in other literature.

0 comments on commit 96287a2

Please sign in to comment.