diff options
author | Gyorgy Orban <o.gyorgy@gmail.com> | 2020-01-12 00:27:14 +0300 |
---|---|---|
committer | Gyorgy Orban <o.gyorgy@gmail.com> | 2020-01-12 02:26:43 +0300 |
commit | ded87b9583f43878f677568dc8149deb60fbbf6a (patch) | |
tree | 1154b65076c87b1e650fa4bf921f29d61e4b8a43 | |
parent | 5c7a69ce71cad91d3571e3f000e9b2e10b6348a2 (diff) |
show post categories and series
post categories and series are shown under each post
and in the post list
-rw-r--r-- | layouts/_default/li.html | 16 | ||||
-rw-r--r-- | layouts/partials/categories.html | 11 | ||||
-rw-r--r-- | layouts/partials/postfooter.html | 9 | ||||
-rw-r--r-- | layouts/partials/series.html | 11 | ||||
-rw-r--r-- | static/css/default-dark.css | 13 | ||||
-rw-r--r-- | static/css/layout.css | 85 |
6 files changed, 128 insertions, 17 deletions
diff --git a/layouts/_default/li.html b/layouts/_default/li.html index 0d50392..85fa63d 100644 --- a/layouts/_default/li.html +++ b/layouts/_default/li.html @@ -1,10 +1,16 @@ <div class="content-item"> <a href="{{ .Permalink }}"> - <div class="post-list"> <h3 class="title"> {{ .Title }} </h3> </div> - </a> - <div class="meta"> - {{ partial "tags.html" . }} + <div class="post-list"> <h3 class="title"> {{ .Title }} </h3> <div class="date"> {{ .Date.Format "2 Jan, 2006" }} </div> - </div> + + </div> + </a> + {{if or .Params.tags .Params.categories .Params.series}} + <div class="meta"> + {{ partial "tags.html" . }} + {{ partial "categories.html" . }} + {{ partial "series.html" . }} + </div> + {{end}} </div> diff --git a/layouts/partials/categories.html b/layouts/partials/categories.html new file mode 100644 index 0000000..bc2ea54 --- /dev/null +++ b/layouts/partials/categories.html @@ -0,0 +1,11 @@ + +<div class="categories"> + {{if .Params.categories}} + Published in: + {{ range .Params.categories }} + <div class="category"> + <a href="/categories/{{ . | urlize }}">{{.}}</a> + </div> + {{ end }} + {{ end }} +</div> diff --git a/layouts/partials/postfooter.html b/layouts/partials/postfooter.html index 02176de..479c411 100644 --- a/layouts/partials/postfooter.html +++ b/layouts/partials/postfooter.html @@ -1,8 +1,13 @@ <footer class="post-footer"> <div class="post-footer-data"> - {{ partial "tags.html" . }} - <div class="date"> {{ .Date.Format "2 Jan 2006" }} </div> + {{ partial "tags.html" . }} + <div class="date"> {{ .Date.Format "2006-01-01" }} </div> + {{if or .Params.categories .Params.series}} + <hr> + {{ partial "categories.html" . }} + {{ partial "series.html" . }} + {{end}} </div> </footer> diff --git a/layouts/partials/series.html b/layouts/partials/series.html new file mode 100644 index 0000000..3fa41c9 --- /dev/null +++ b/layouts/partials/series.html @@ -0,0 +1,11 @@ + +<div class="series"> + {{if .Params.series}} + Part of the series: + {{ range .Params.series }} + <div class="series-name"> + <a href="/series/{{ . | urlize }}">{{.}}</a> + </div> + {{ end }} + {{ end }} +</div> diff --git a/static/css/default-dark.css b/static/css/default-dark.css index 68b9186..e04f0b5 100644 --- a/static/css/default-dark.css +++ b/static/css/default-dark.css @@ -63,7 +63,9 @@ th { background: #101010; } .post { background: #202020; - border: 1px solid #303030; + border-left: 1px solid #303030; + border-right: 1px solid #303030; + border-top: 1px solid #303030; border-radius: 0.2em; box-shadow: 0 1px 2px 0 #000000, 0 2px 5px 0 #000000; } @@ -97,6 +99,15 @@ th { background: #101010; } color: var(--main-sec); } +.post-footer-data { + background-color: #101010; + border-bottom: 1px solid #303030; +} + +.post-footer hr { + color: #303030; +} + .content-item { background: #202020; border: 1px solid #303030; diff --git a/static/css/layout.css b/static/css/layout.css index 850c2ea..93c08a0 100644 --- a/static/css/layout.css +++ b/static/css/layout.css @@ -182,22 +182,39 @@ th, td { .post-footer-data { display: -webkit-flex; -webkit-flex-direction: column; - -webkit-align-items: flex-end; + -webkit-align-items: flex-start; display: flex; flex-direction: column; - align-items: flex-end; + align-items: flex-start; + padding: 1em; +} - margin: 1em; +.post-footer hr { + width: 100%; } .post-footer-data .date { font-weight: bold; - font-size: 0.9em; + text-align: right; + padding-top: 0.2em; + padding-bottom: 0.2em; } -.post-footer-data .tags { +.post-footer-data .tag { font-weight: bold; - font-size: 0.9em; +} + +.post-footer-data .categories { + padding-top: 0.5em; +} + +.post-footer-data .category { + font-weight: bold; +} + +.post-footer-data .series { + padding-top: 0.5em; + padding-bottom: 0.5em; } .content-item { @@ -211,12 +228,33 @@ th, td { display: -webkit-flex; display:flex; flex-wrap: wrap; - justify-content: space-between; + flex-direction: column; + font-size: 0.7em; } .content-item .tags { - margin-bottom: 0.2em; - font-size: 0.7em; + margin-bottom: 0.3em; + font-weight: bold; +} + +.content-item .categories { + margin-top: 0.3em; + margin-bottom: 0.3em; +} + +.content-item .category { + font-weight: bold; + display: inline-block; +} + +.content-item .series { + margin-top: 0.3em; + margin-bottom: 0.3em; +} + +.content-item .series-name { + font-weight: bold; + display: inline-block; } .content-item .date { @@ -335,6 +373,29 @@ th, td { margin: 0em; } +.post-list .date { + margin: 0em; + font-size: 0.9em; +} + +.post-footer-data .category { + font-weight: bold; + display: inline-block; +} + +.post-footer-data .category a { + text-decoration: none; +} + +.post-footer-data .series-name { + display: inline-block; +} + +.post-footer-data .series-name a { + font-weight: bold; + text-decoration: none; +} + .tag { display: inline-block; } @@ -397,6 +458,12 @@ th, td { text-align: left; } +.post-preview .categories { + font-weight: bold; + text-align: left; + display: inline-block; +} + .rmore { margin-top: 0.5em; white-space:nowrap; |