Skip to content

Commit

Permalink
Merge pull request vividvilla#19 from cgiacomi/feature/posttags
Browse files Browse the repository at this point in the history
feat: add tag list to post
  • Loading branch information
vividvilla authored Oct 19, 2019
2 parents edf7470 + 28c2f28 commit 4f0c28a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
14 changes: 14 additions & 0 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ <h1 class="title">{{ .Title }}</h1>
{{ .Content }}
</div>

<div class="post-tags">
{{ if ne .Type "page" }}
{{ if gt .Params.tags 0 }}
<nav class="nav tags">
<ul class="flat">
{{ range .Params.tags }}
<li><a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></li>
{{ end }}
</ul>
</nav>
{{ end }}
{{ end }}
</div>

{{- $.Scratch.Set "isDisqus" true -}}

{{- if and (isset .Params "type") (in .Site.Params.disableDisqusTypes .Params.type) -}}
Expand Down
5 changes: 5 additions & 0 deletions static/css/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ a:hover {
opacity: 0.8;
}

.post-tags .tags a {
border: 1px solid #fff;
color: #fff;
}

.header nav,
.footer {
border-color: #333;
Expand Down
21 changes: 21 additions & 0 deletions static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ ul {
margin: 0;
}

.post-tags a {
margin-right: 5px;
}

.post .post-header .meta {
padding-left: 5px;
margin-top: 10px;
Expand All @@ -297,6 +301,23 @@ ul {
background-color: #f9f2f4;
}

.post-tags .tags li {
margin-bottom: 0;
margin-top: 20px;
}

.post-tags .tags a {
display: inline-block;
border: 1px solid #a00;
border-radius: 4px;
padding: 0px 6px;
color: #a00;
line-height: 20px;
font-size: 12px;
text-decoration: none;
margin: 0 1px;
}

.list .posts .post .meta {
margin-bottom: 0;
margin-left: 5px;
Expand Down

0 comments on commit 4f0c28a

Please sign in to comment.