diff options
author | Zachary Betz <zwbetz@gmail.com> | 2019-02-27 06:57:29 +0300 |
---|---|---|
committer | Zachary Betz <zwbetz@gmail.com> | 2019-02-27 06:57:29 +0300 |
commit | c9f3c49e6bc61f0066e883ed614221e1eeaf77a4 (patch) | |
tree | 67f5d4fb7ab93fade34c37b2c51732b512b67c7e | |
parent | ce016996c1f9a53df3811fa85d0117d5ef204710 (diff) |
Add summary to blog post listing
-rw-r--r-- | README.md | 11 | ||||
-rw-r--r-- | assets/css/custom.css | 3 | ||||
-rw-r--r-- | exampleSite/content/post/hugoisforlovers.md | 1 | ||||
-rw-r--r-- | exampleSite/content/post/migrate-from-jekyll.md | 1 | ||||
-rw-r--r-- | exampleSite/content/post/papercss-shortcodes/index.md | 1 | ||||
-rw-r--r-- | exampleSite/content/post/papercss-typography.md | 1 | ||||
-rw-r--r-- | layouts/partials/post-list.html | 13 |
7 files changed, 26 insertions, 5 deletions
@@ -15,6 +15,7 @@ A Hugo theme made with PaperCSS, the less formal CSS framework. - [Favicons](#favicons) - [Shortcodes](#shortcodes) - [Disable toc for a blog post](#disable-toc-for-a-blog-post) +- [Disable summary for a blog post](#disable-summary-for-a-blog-post) - [Getting help](#getting-help) - [Credits](#credits) @@ -73,6 +74,16 @@ toc: false --- ``` +## Disable summary for a blog post + +The homepage blog post listing shows a summary for each post. To disable this for an individual post set `summary` to `false`. For example: + +``` +--- +title: "My page with some stellar content" +summary: false +--- +``` ## Getting help diff --git a/assets/css/custom.css b/assets/css/custom.css index 3ca5e3f..fdef350 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -30,6 +30,9 @@ blockquote { .post-list { font-size: 2em; } +.summary { + margin-bottom: 0.1em; +} /* post single */ .post-title { diff --git a/exampleSite/content/post/hugoisforlovers.md b/exampleSite/content/post/hugoisforlovers.md index 6ff860f..c216902 100644 --- a/exampleSite/content/post/hugoisforlovers.md +++ b/exampleSite/content/post/hugoisforlovers.md @@ -14,6 +14,7 @@ categories = [ ] series = ["Hugo 101"] author = "Hugo Authors" +summary = false +++ ## Step 1. Install Hugo diff --git a/exampleSite/content/post/migrate-from-jekyll.md b/exampleSite/content/post/migrate-from-jekyll.md index 7c1b1f0..c238114 100644 --- a/exampleSite/content/post/migrate-from-jekyll.md +++ b/exampleSite/content/post/migrate-from-jekyll.md @@ -8,6 +8,7 @@ series: - Hugo 101 aliases: - /blog/migrate-from-jekyll/ +summary: false --- ## Move static content to `static` diff --git a/exampleSite/content/post/papercss-shortcodes/index.md b/exampleSite/content/post/papercss-shortcodes/index.md index a61fe7d..50b12b4 100644 --- a/exampleSite/content/post/papercss-shortcodes/index.md +++ b/exampleSite/content/post/papercss-shortcodes/index.md @@ -2,6 +2,7 @@ title: "Papercss Shortcodes" date: 2019-02-26T13:50:01-06:00 tags: [shortcodes] +summary: false --- ## border diff --git a/exampleSite/content/post/papercss-typography.md b/exampleSite/content/post/papercss-typography.md index 2557187..3e39d16 100644 --- a/exampleSite/content/post/papercss-typography.md +++ b/exampleSite/content/post/papercss-typography.md @@ -2,6 +2,7 @@ title: "PaperCSS Typography" date: 2019-02-22T20:53:58-06:00 tags: [typography, markdown] +summary: false --- ## Headings diff --git a/layouts/partials/post-list.html b/layouts/partials/post-list.html index 2ee64b7..9301122 100644 --- a/layouts/partials/post-list.html +++ b/layouts/partials/post-list.html @@ -1,8 +1,11 @@ <h1>{{ .Title }}</h1> {{ range where .Pages.ByPublishDate.Reverse "Section" "post" }} -<h2 class="post-list"> - <a href="{{ .Permalink }}"> - {{ .Title }} - </a> -</h2> + <h2 class="post-list {{ if ne .Params.summary false }}summary{{ end }}"> + <a href="{{ .Permalink }}"> + {{ .Title }} + </a> + </h2> + {{ if ne .Params.summary false }} + {{ .Summary }} + {{ end }} {{ end }}
\ No newline at end of file |