Skip to content

Commit 6192536

Browse files
committed
close #1: this is how you may display categories and tags on a page
1 parent 8530964 commit 6192536

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

layouts/_default/single.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
<h1><span class="title">{{ .Title }}</span></h1>
44
{{ with .Params.author }}<h2 class="author">{{ . }}</h2>{{ end }}
55
{{ if .Params.date }}<h2 class="date">{{ .Date.Format "2006/01/02" }}</h2>{{ end }}
6+
<p class="terms">
7+
{{ range $i := (slice "categories" "tags") }}
8+
{{ with ($.Param $i) }}
9+
{{ $i | title }}: {{ range $k := . }}<a href="{{ relURL (print "/" $i "/" $k | urlize) }}">{{$k}}</a> {{ end }}
10+
{{ end }}
11+
{{ end }}
12+
</p>
613
</div>
714

815
<main>

static/css/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ body {
1313
padding: 5px;
1414
border-radius: 5px;
1515
}
16+
.terms { font-size: .9em; }
1617
.menu, .article-meta, footer { text-align: center; }
1718
.title { font-size: 1.1em; }
1819
footer a { text-decoration: none; }

0 commit comments

Comments
 (0)