layout: display basic taxonomies information

* NEW Adds a list template.
* NEW Displays the categories and tags of a blog post.

Co-Authored-by: Igor Milhit <igor@milhit.ch>
pull/31/head
iGor milhit 2019-07-30 12:56:41 +02:00
parent 498a724195
commit 4477b3033e
Signed by: igor
GPG Key ID: 692D97C3D0228A99
2 changed files with 38 additions and 33 deletions

View File

@ -0,0 +1,19 @@
{{ define "main" }}
<main>
<article>
<header>
<h1>{{.Title}}</h1>
</header>
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
{{.Content}}
</article>
<ul>
<!-- Ranges through content/posts/*.md -->
{{ range .Pages }}
<li>
<a href="{{.Permalink}}">{{.Date.Format "2006-01-02"}} | {{.Title}}</a>
</li>
{{ end }}
</ul>
</main>
{{ end }}

View File

@ -2,43 +2,29 @@
<section id="main"> <section id="main">
<header> <header>
<h1 id="title">{{ .Title }}</h1> <h1 id="title">{{ .Title }}</h1>
<h4 id="date">{{ .Date.Format "2006-01-02" }}</h4> <ul class="post-info">
<li>Publié le&#x202F;: {{ .Date.Format "2006-01-02" }}</li>
{{ with .Params.categories }}
<li>Catégories&#x202F;:</li>
<ul>
{{ range . }}
<li><a href="{{ "categories" | absURL}}/{{ . | urlize }}">{{ . }}</a> </li>
{{ end }}
</ul>
{{ end }}
{{ with .Params.tags }}
<li>Tags&#x202F;:</li>
<ul>
{{ range . }}
<li> <a href="{{ "tags" | absURL }}/{{ . | urlize }}">{{ . }}</a> </li>
{{ end }}
</ul>
{{ end }}
</ul>
</header> </header>
<article id="content"> <article id="content">
{{ .Content }} {{ .Content }}
</article> </article>
</section> </section>
{{/*
<aside id="meta">
<div>
<section>
</section>
{{ with .Params.topics }}
<ul id="topics">
{{ range . }}
<li><a href="{{ "topics" | absURL}}{{ . | urlize }}">{{ . }}</a> </li>
{{ end }}
</ul>
{{ end }}
{{ with .Params.tags }}
<ul id="tags">
{{ range . }}
<li> <a href="{{ "tags" | absURL }}{{ . | urlize }}">{{ . }}</a> </li>
{{ end }}
</ul>
{{ end }}
</div>
<div>
{{ with .PrevInSection }}
<a class="previous" href="{{.Permalink}}"> {{.Title}}</a>
{{ end }}
{{ with .NextInSection }}
<a class="next" href="{{.Permalink}}"> {{.Title}}</a>
{{ end }}
</div>
</aside>
*/}}
{{ end }} {{ end }}