From f1e3a90489ec61d903429a582a058b8a1b4d7093 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 b9992656..6f4f077c 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -13,6 +13,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; }