Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/EmielH/tale-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmiel Hollander <EmielH@users.noreply.github.com>2018-10-07 11:32:34 +0300
committerEmiel Hollander <EmielH@users.noreply.github.com>2018-10-07 11:32:34 +0300
commitb22abdc7f43ef26a63e28e67c7045d73b1ec6a8a (patch)
treebdf73e4d65f0609b6fc07070a9ff09536576f199
parent5d20e1cae14ed1c025c536ecfbbb21cc2d7efbe6 (diff)
Add manually setting the summary in page frontmatter
-rw-r--r--README.md6
-rw-r--r--layouts/index.html2
2 files changed, 6 insertions, 2 deletions
diff --git a/README.md b/README.md
index 069e9b4..f12c6fb 100644
--- a/README.md
+++ b/README.md
@@ -52,7 +52,7 @@ If you have cloned the theme, you can run `git pull` inside the theme folder.
### Internationalisation (i18n)
-Tale supports using other languages than English. Language files for the texts Tale uses are provided in the `i18n` directory. The default language is English. To swith languages, add the key `defaultContentLanguage` to your `config.toml` file. For example:
+Tale supports using other languages than English. Language files for the texts Tale uses are provided in the `i18n` directory. The default language is English. To switch languages, add the key `defaultContentLanguage` to your `config.toml` file. For example:
```
defaultContentLanguage = "nl"
@@ -64,6 +64,10 @@ Feel free to submit pull requests for other translations of Tale's texts.
[Hugo documentation for multilingual sites](//gohugo.io/content-management/multilingual/)
+### Custom summaries
+
+Tale allows for writing the summary of your posts manually by setting the `summary` variable in the page frontmatter. If this variable is not set, the summary that Hugo automatically generates will be used.
+
## Acknowledgments
Thanks
diff --git a/layouts/index.html b/layouts/index.html
index 5d946f5..918ca5c 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -10,7 +10,7 @@
<div class="catalogue-line"></div>
<p>
- {{ .Summary }}
+ {{ if isset .Params "summary" }}{{ .Params.Summary }}{{ else }}{{ .Summary }}{{ end }}
</p>
</div>