Skip to content

Commit 000316e

Browse files
authored
Merge pull request knadh#19 from cgiacomi/feature/posttags
feat: add tag list to post
2 parents 76710a9 + cf632eb commit 000316e

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

layouts/_default/single.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ <h1 class="title">{{ .Title }}</h1>
1414
{{ .Content }}
1515
</div>
1616

17+
<div class="post-tags">
18+
{{ if ne .Type "page" }}
19+
{{ if gt .Params.tags 0 }}
20+
<nav class="nav tags">
21+
<ul class="flat">
22+
{{ range .Params.tags }}
23+
<li><a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></li>
24+
{{ end }}
25+
</ul>
26+
</nav>
27+
{{ end }}
28+
{{ end }}
29+
</div>
30+
1731
{{- $.Scratch.Set "isDisqus" true -}}
1832

1933
{{- if and (isset .Params "type") (in .Site.Params.disableDisqusTypes .Params.type) -}}

static/css/dark.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ a:hover {
3434
opacity: 0.8;
3535
}
3636

37+
.post-tags .tags a {
38+
border: 1px solid #fff;
39+
color: #fff;
40+
}
41+
3742
.header nav,
3843
.footer {
3944
border-color: #333;

static/css/main.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ ul {
283283
margin: 0;
284284
}
285285

286+
.post-tags a {
287+
margin-right: 5px;
288+
}
289+
286290
.post .post-header .meta {
287291
padding-left: 5px;
288292
margin-top: 10px;
@@ -297,6 +301,23 @@ ul {
297301
background-color: #f9f2f4;
298302
}
299303

304+
.post-tags .tags li {
305+
margin-bottom: 0;
306+
margin-top: 20px;
307+
}
308+
309+
.post-tags .tags a {
310+
display: inline-block;
311+
border: 1px solid #a00;
312+
border-radius: 4px;
313+
padding: 0px 6px;
314+
color: #a00;
315+
line-height: 20px;
316+
font-size: 12px;
317+
text-decoration: none;
318+
margin: 0 1px;
319+
}
320+
300321
.list .posts .post .meta {
301322
margin-bottom: 0;
302323
margin-left: 5px;

0 commit comments

Comments
 (0)