diff options
author | Robert Austin <rob@jugglerdigital.com> | 2019-08-06 07:40:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-06 07:40:35 +0300 |
commit | f7bbb030ca9b124e4321736bbaa8f1f7b7761432 (patch) | |
tree | 32c782cb876d5e1b1122ce8c451b26a60c26891f | |
parent | 306a4bb3bc41563d5370f22f55527b8899b0bf77 (diff) | |
parent | fecd9243b93ff7a86496ff8b8a8e9b38adc79acb (diff) |
Merge pull request #20 from remeika/summary
Use Hugo's content summary feature for documentation overview
-rw-r--r-- | exampleSite/config.toml | 4 | ||||
-rw-r--r-- | exampleSite/content/docs/configure/index.md | 1 | ||||
-rw-r--r-- | exampleSite/content/docs/example/index.md | 4 | ||||
-rw-r--r-- | layouts/_default/summary.html | 2 |
4 files changed, 9 insertions, 2 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index d1de74c..3265bc5 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -8,6 +8,10 @@ pygmentsCodeFences = true pygmentsCodefencesGuessSyntax = true pygmentsUseClasses = true +# Controls how many words are printed in the content summary on the docs homepage. +# See https://gohugo.io/content-management/summaries/ +summaryLength = 30 + [[menu.main]] name = "Home" url = "/" diff --git a/exampleSite/content/docs/configure/index.md b/exampleSite/content/docs/configure/index.md index d8cfb4c..48d9e60 100644 --- a/exampleSite/content/docs/configure/index.md +++ b/exampleSite/content/docs/configure/index.md @@ -3,6 +3,7 @@ title: 'Configuration' date: 2019-02-11T19:30:08+10:00 draft: false weight: 4 +summary: Syntax highlighting and menus can be configured via `config.toml`. --- ## Syntax Highlighting diff --git a/exampleSite/content/docs/example/index.md b/exampleSite/content/docs/example/index.md index 7cb254c..2b95de0 100644 --- a/exampleSite/content/docs/example/index.md +++ b/exampleSite/content/docs/example/index.md @@ -4,7 +4,9 @@ date: 2019-02-11T19:27:37+10:00 weight: 7 --- -Whisper is a minimal documentation theme built for Hugo. The design and functionality is intentionally minimal. +Whisper is a minimal documentation theme built for Hugo. The design & functionality is intentionally minimal. + +<!--more--> ## Quickstart diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 9cfe8f2..1231103 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -3,5 +3,5 @@ <img alt="{{ .Title }}" src="{{ .Params.image }}" /> {{ end}} <h2 class="title-summary"><a href="{{ .Permalink }}">{{ .Title }}</a></h2> - <p>{{ htmlUnescape .Content | plainify | truncate 140 }}</p> + <p>{{ .Summary }}</p> </div> |