Skip to content

Commit

Permalink
Summary example. (#315)
Browse files Browse the repository at this point in the history
* Summary example.

* Update README.md
  • Loading branch information
ryanfox1985 authored Aug 18, 2021
1 parent fce0ad3 commit 38f4944
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -524,13 +524,17 @@ The recent posts sections shows the four latest published blog posts, with their
You can enable it in the configuration file.

```toml
summaryLength = 70
[params.recent_posts]
enable = true
title = "From our blog"
subtitle = "Pellen
hide_summary = false
```

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.

#### Footer

In the footer there are three blocks customizables: `About us`, `Recent posts` and `contact`. Each block can be set via parameters.
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ disqusShortname = "devcows"
# Enable Google Analytics by entering your tracking code
googleAnalytics = ""

# number of words of summarized post content (default 70)
summaryLength = 70

# Define the number of posts per page
paginate = 10
Expand Down
1 change: 1 addition & 0 deletions exampleSite/content/blog/hugo-is-for-lovers.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ date = "2015-08-03T13:39:46+02:00"
tags = ["hugo"]
categories = ["pseudo"]
banner = "img/banners/banner-3.jpg"
summary="This is the summary Goto [hugo releases](https://github.com/spf13/hugo/releases) and download the appropriate version for your os and architecture. Save it somewhere specific as we will be using it in the next step. More complete instructions are available at [installing hugo](/overview/installing/)"
+++

## Step 1. Install Hugo
Expand Down

0 comments on commit 38f4944

Please sign in to comment.