From df27c088081004d1ed4489e708328367a15b3fc5 Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Mon, 19 Jun 2017 22:59:02 -0500 Subject: [PATCH] close #1: this is how you may display categories and tags on a page --- layouts/_default/single.html | 7 +++++++ static/css/style.css | 1 + 2 files changed, 8 insertions(+) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index de3f1218..fcbf6d2c 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -3,6 +3,13 @@

{{ .Title | markdownify }}

{{ with .Params.author }}

{{ . }}

{{ end }} {{ if (gt .Params.date 0) }}

{{ .Date.Format "2006/01/02" }}

{{ end }} +

+ {{ range $i := (slice "categories" "tags") }} + {{ with ($.Param $i) }} + {{ $i | title }}: {{ range $k := . }}{{$k}} {{ end }} + {{ end }} + {{ end }} +

diff --git a/static/css/style.css b/static/css/style.css index 0b51cd65..9cd3732f 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; }