layout: improve taxonomies pages

* NEW Adds a templates for categories and tags lists.
* NEW Styles (not so well…) the categories and tags lists.
* BETTER Improves includes in the _default templates.

Co-Authored-by: Igor Milhit <igor@milhit.ch>
pull/31/head
iGor milhit 2019-09-01 08:32:49 +02:00
parent 09fbaa06f9
commit b5dc64935a
Signed by: igor
GPG Key ID: 692D97C3D0228A99
6 changed files with 59 additions and 33 deletions

View File

@ -3,7 +3,9 @@
{{- partial "head.html" . -}}
<body>
{{- partial "header.html" . -}}
{{- block "main" . }}{{- end }}
<main class="container">
{{- block "main" . }}{{- end }}
</main>
{{- partial "footer.html" . -}}
</body>
</html>

View File

@ -1,18 +1,18 @@
{{ define "main" }}
<main class="container">
<header>
<h1>{{.Title}}</h1>
</header>
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
{{.Content}}
<article>
<!-- Ranges through content/posts/*.md -->
<header>
<h1>{{.Title}}</h1>
</header>
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
{{.Content}}
<article>
<!-- Ranges through content/posts/*.md -->
{{ range .Pages }}
<article>
<a href="{{.Permalink}}">{{.Title}}</a>
&mdash; {{.PublishDate.Format "2006-01-02"}}
</article>
<article>
<a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a> &mdash;
{{ if isset .Params "publishdate" }}
{{.PublishDate.Format "2006-01-02"}}
{{ end }}
</article>
{{ end }}
</article>
</main>
</article>
{{ end }}

View File

@ -1,20 +1,22 @@
{{ define "main" }}
<main class="container">
{{ .Content }}
{{ range .Paginator.Pages }}
<article>
<a href="{{ .Permalink }}">
{{.Title}}
</a>
&mdash; {{ .PublishDate.Format "2006-01-02" }}
{{ with .Params.categories }}
{{ range . }}
&mdash; <a href="{{ "categories" | absURL}}/{{ . | urlize }}">{{ . }}</a>
{{ end }}
{{ end }}
</article>
<header>
<h1>{{.Title}}</h1>
</header>
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
{{.Content }}
{{ range .Paginator.Pages }}
<article>
<a href="{{ .Permalink }}">
{{.Title}}
</a>
&mdash; {{ .PublishDate.Format "2006-01-02" }}
{{ with .Params.categories }}
{{ range . }}
&mdash; <a href="{{ "categories" | absURL}}/{{ . | urlize }}">{{ . }}</a>
{{ end }}
{{ end }}
</ul>
</main>
</article>
{{ end }}
</ul>
{{ end }}

View File

@ -1,5 +1,4 @@
{{ define "main" }}
<main id="main" class="container">
<header class="post-header">
<h1 id="title">{{ .Title }}</h1>
{{- partial "post-info.html" . -}}
@ -7,6 +6,5 @@
<article id="content">
{{ .Content }}
</article>
</main>
{{ end }}

View File

@ -0,0 +1,15 @@
{{ define "main" }}
<header>
<h1>{{.Title}}</h1>
</header>
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
{{.Content}}
<article class="terms">
{{ range .Data.Terms.Alphabetical }}
<article class="term">
<p><a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a> ({{ .Count }})</p>
</article>
{{ end }}
</article>
{{ end }}

View File

@ -196,3 +196,12 @@ figure p {
text-align: center;
margin: .2rem 0;
}
.terms {
display: flex;
flex-wrap: wrap;
}
.term {
margin-right: 1rem;
}