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

github.com/zwbetz-gh/papercss-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Betz <zwbetz@gmail.com>2019-02-27 06:57:29 +0300
committerZachary Betz <zwbetz@gmail.com>2019-02-27 06:57:29 +0300
commitc9f3c49e6bc61f0066e883ed614221e1eeaf77a4 (patch)
tree67f5d4fb7ab93fade34c37b2c51732b512b67c7e
parentce016996c1f9a53df3811fa85d0117d5ef204710 (diff)
Add summary to blog post listing
-rw-r--r--README.md11
-rw-r--r--assets/css/custom.css3
-rw-r--r--exampleSite/content/post/hugoisforlovers.md1
-rw-r--r--exampleSite/content/post/migrate-from-jekyll.md1
-rw-r--r--exampleSite/content/post/papercss-shortcodes/index.md1
-rw-r--r--exampleSite/content/post/papercss-typography.md1
-rw-r--r--layouts/partials/post-list.html13
7 files changed, 26 insertions, 5 deletions
diff --git a/README.md b/README.md
index 3921ecc..fcb577b 100644
--- a/README.md
+++ b/README.md
@@ -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