Displays tags on single (using header)

Display tags list when clicking on tag
This commit is contained in:
Delaby Pierre 2018-10-16 12:08:58 +02:00
parent b28c7d7064
commit 79a9777e9a
4 changed files with 76 additions and 3 deletions

View file

@ -1,6 +1,16 @@
{{ partial "header.html" . }} {{ partial "header.html" . }}
{{ if eq .Kind "section" }}
{{ .Content }} {{ .Content }}
{{end}}
{{ if eq .Kind "taxonomy" }}
<ul>
{{ range .Pages }}
<li><a href="{{.URL}}">{{.Title}}</a></li>
{{ end }}
</ul>
{{end}}
<footer class=" footline" > <footer class=" footline" >
{{with .Params.LastModifierDisplayName}} {{with .Params.LastModifierDisplayName}}

View file

@ -75,13 +75,20 @@
</div> </div>
</div> </div>
{{ end }} {{ end }}
<div id="head-tags">
{{ partial "tags.html" . }}
</div>
{{ if .Params.chapter }} {{ if .Params.chapter }}
<div id="chapter"> <div id="chapter">
{{ end }} {{ end }}
<div id="body-inner"> <div id="body-inner">
{{if and (not .IsHome) (not .Params.chapter) }} {{if and (not .IsHome) (not .Params.chapter) }}
<h1>{{.Title}}</h1> <h1>
{{ if eq .Kind "taxonomy" }}
{{.Kind}} :
{{ end }}
{{.Title}}
</h1>
{{end}} {{end}}
{{define "breadcrumb"}} {{define "breadcrumb"}}
@ -93,3 +100,4 @@
{{.value|safeHTML}} {{.value|safeHTML}}
{{end}} {{end}}
{{end}} {{end}}

View file

@ -0,0 +1,7 @@
<div class="tags">
{{ if .Params.tags }}
{{range .Params.tags}}
<a class="tag-link" href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }} </a>
{{end}}
{{end}}
</div>

View file

@ -1127,4 +1127,52 @@ pre .copy-to-clipboard:hover {
text-align: left; text-align: left;
} }
#head-tags{
margin-left:1em;
margin-top:1em;
}
#body .tags a.tag-link {
display: inline-block;
height: 2em;
line-height: 2em;
position: relative;
margin: 0 16px 8px 0;
padding: 0 10px 0 12px;
background: #777;
-webkit-border-bottom-right-radius: 3px;
border-bottom-right-radius: 3px;
-webkit-border-top-right-radius: 3px;
border-top-right-radius: 3px;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.2);
box-shadow: 0 1px 2px rgba(0,0,0,0.2);
color: #fff;
font-size: 0.8em;
}
#body .tags a.tag-link:before {
content: "";
position: absolute;
top:0;
left: -1em;
width: 0;
height: 0;
border-color: transparent #777 transparent transparent;
border-style: solid;
border-width: 1em 1em 1em 0;
}
#body .tags a.tag-link:after {
content: "";
position: absolute;
top: 10px;
left: 1px;
float: left;
width: 5px;
height: 5px;
-webkit-border-radius: 50%;
border-radius: 50%;
background: #fff;
}
/*# sourceMappingURL=theme.css.map */ /*# sourceMappingURL=theme.css.map */