Skip to content

Commit

Permalink
Use hide_summary also for blogs list (#356)
Browse files Browse the repository at this point in the history
* Use hide_summary also for blogs list

Signed-off-by: Richard Leitner <[email protected]>

* README: add additional docu on recent_posts.hide_summary

Mention the fact that recent_posts.hide_summary affects recent posts as
well as blogs list.

Signed-off-by: Richard Leitner <[email protected]>
  • Loading branch information
g0hl1n authored May 5, 2022
1 parent 431e836 commit c5eef49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ summaryLength = 70
```

Recent posts use `.Summary` property and 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.
When setting the `hide_summary` configuration property to `true` the summary will be hidden on the recent posts as well as the blogs list page.

#### Footer

Expand Down
2 changes: 2 additions & 0 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ <h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
</p>
{{ end }}
</div>
{{ if not .Site.Params.recent_posts.hide_summary }}
<p class="intro">{{ .Summary }}</p>
<p class="read-more"><a href="{{ .Permalink }}" class="btn btn-template-main">{{ i18n "continueReading" }}</a>
</p>
{{ end }}
</div>
</div>
</section>
Expand Down

0 comments on commit c5eef49

Please sign in to comment.