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
parent
09fbaa06f9
commit
b5dc64935a
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
— {{.PublishDate.Format "2006-01-02"}}
|
||||
</article>
|
||||
<article>
|
||||
<a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a> —
|
||||
{{ if isset .Params "publishdate" }}
|
||||
{{.PublishDate.Format "2006-01-02"}}
|
||||
{{ end }}
|
||||
</article>
|
||||
{{ end }}
|
||||
</article>
|
||||
</main>
|
||||
</article>
|
||||
{{ end }}
|
||||
|
|
|
@ -1,20 +1,22 @@
|
|||
{{ define "main" }}
|
||||
<main class="container">
|
||||
{{ .Content }}
|
||||
{{ range .Paginator.Pages }}
|
||||
<article>
|
||||
<a href="{{ .Permalink }}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
— {{ .PublishDate.Format "2006-01-02" }}
|
||||
{{ with .Params.categories }}
|
||||
{{ range . }}
|
||||
— <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>
|
||||
— {{ .PublishDate.Format "2006-01-02" }}
|
||||
{{ with .Params.categories }}
|
||||
{{ range . }}
|
||||
— <a href="{{ "categories" | absURL}}/{{ . | urlize }}">{{ . }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</main>
|
||||
</article>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
||||
|
|
|
@ -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 }}
|
||||
|
||||
|
|
|
@ -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 }}
|
||||
|
|
@ -196,3 +196,12 @@ figure p {
|
|||
text-align: center;
|
||||
margin: .2rem 0;
|
||||
}
|
||||
|
||||
.terms {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.term {
|
||||
margin-right: 1rem;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue