Skip to content

Commit e39c323

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

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 | markdownify }}</span></h1>
44
{{ with .Params.author }}<h2 class="author">{{ . }}</h2>{{ end }}
55
{{ if (gt .Params.date 0) }}<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
@@ -14,6 +14,7 @@ body {
1414
padding: 5px;
1515
border-radius: 5px;
1616
}
17+
.terms { font-size: .9em; }
1718
.menu, .article-meta, footer { text-align: center; }
1819
.title { font-size: 1.1em; }
1920
footer a { text-decoration: none; }

0 commit comments

Comments
 (0)