From 3e6990c0193fb2b9b7b6f63ca5875449887d99d9 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 3dfda298..21f87e0e 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -3,6 +3,13 @@

{{ .Title }}

{{ with .Params.author }}

{{ . }}

{{ end }} {{ if .Params.date }}

{{ .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 0edd168b..9da89982 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; }