diff options
author | Yihui Xie <xie@yihui.name> | 2017-06-20 06:59:02 +0300 |
---|---|---|
committer | Yihui Xie <xie@yihui.name> | 2022-06-15 06:53:29 +0300 |
commit | df27c088081004d1ed4489e708328367a15b3fc5 (patch) | |
tree | 9c06b61a6f83bbb01294df9e61b7ebb522a75159 | |
parent | ae0bdbeb103133c15936fd15d77f9bba6119e59d (diff) |
close #1: this is how you may display categories and tags on a pagefeature/show-tags
-rw-r--r-- | layouts/_default/single.html | 7 | ||||
-rw-r--r-- | static/css/style.css | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index de3f121..fcbf6d2 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -3,6 +3,13 @@ <h1><span class="title">{{ .Title | markdownify }}</span></h1> {{ with .Params.author }}<h2 class="author">{{ . }}</h2>{{ end }} {{ if (gt .Params.date 0) }}<h2 class="date">{{ .Date.Format "2006/01/02" }}</h2>{{ end }} +<p class="terms"> + {{ range $i := (slice "categories" "tags") }} + {{ with ($.Param $i) }} + {{ $i | title }}: {{ range $k := . }}<a href="{{ relURL (print "/" $i "/" $k | urlize) }}">{{$k}}</a> {{ end }} + {{ end }} + {{ end }} +</p> </div> <main> diff --git a/static/css/style.css b/static/css/style.css index 0b51cd6..9cd3732 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -14,6 +14,7 @@ body { padding: 5px; border-radius: 5px; } +.terms { font-size: .9em; } .menu, .article-meta, footer { text-align: center; } .title { font-size: 1.1em; } footer a { text-decoration: none; } |