Add custom template for taxonomy
This commit is contained in:
parent
24442c3f4c
commit
65ec26da81
55
layouts/_default/taxonomy.html
Normal file
55
layouts/_default/taxonomy.html
Normal file
@ -0,0 +1,55 @@
|
||||
{{ define "main" }}
|
||||
<div class="posts">
|
||||
{{ $currentTag := replaceRE ".*/(.*)/$" "$1" .Permalink }}
|
||||
{{ $postsWithTag := index .Site.Taxonomies.tags $currentTag }}
|
||||
{{ $paginator := .Paginate $postsWithTag }}
|
||||
|
||||
{{ range $paginator.Pages }}
|
||||
<div class="post on-list">
|
||||
<h1 class="post-title">
|
||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
|
||||
<div class="post-meta">
|
||||
<span class="post-date">
|
||||
{{ .Date.Format "2006-01-02" }}
|
||||
</span>
|
||||
{{ with .Params.Author }}<span class="post-author">::
|
||||
{{ . }}</span>{{ end }}
|
||||
</div>
|
||||
|
||||
{{ if .Params.tags }}
|
||||
<span class="post-tags">
|
||||
{{ range .Params.tags }}
|
||||
#<a href="{{ (urlize (printf "/tags/%s/" . )) | absLangURL }}">
|
||||
{{- . -}}
|
||||
</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ with .Params.Cover }}
|
||||
<img src="{{ . | absURL }}" class="post-cover" />
|
||||
{{ end }}
|
||||
|
||||
<div class="post-content">
|
||||
{{ if .Params.showFullContent }}
|
||||
{{ .Content | markdownify }}
|
||||
{{ else if .Description }}
|
||||
{{ .Description | markdownify }}
|
||||
{{ else }}
|
||||
{{ if .Truncated }}
|
||||
{{ .Summary | markdownify }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ if not .Params.showFullContent }}
|
||||
<div>
|
||||
<a class="read-more button"
|
||||
href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ partial "pagination.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
Loading…
x
Reference in New Issue
Block a user