From 87b2d4a3dd26e5cac72e67631d4ee60b705d8f00 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 4dc3ae45..4a2a82ae 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; }