layout: add a partial for blog post data
* NEW Adds a partial for blog post data. * NEW Displays date or publishdate, and lastmod if it exists. Co-Authored-by: Igor Milhit <igor@milhit.ch>pull/31/head
parent
38566ba106
commit
02d6d2f086
|
@ -2,27 +2,7 @@
|
|||
<main id="main" class="container">
|
||||
<header class="post-header">
|
||||
<h1 id="title">{{ .Title }}</h1>
|
||||
<ul class="post-info">
|
||||
<li>Publié le : {{ .Date.Format "2006-01-02" }}</li>
|
||||
{{ with .Params.categories }}
|
||||
<li>Catégories :
|
||||
<ul>
|
||||
{{ range . }}
|
||||
<li><a href="{{ "categories" | absURL}}/{{ . | urlize }}">{{ . }}</a> </li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ with .Params.tags }}
|
||||
<li>Tags :
|
||||
<ul>
|
||||
{{ range . }}
|
||||
<li> <a href="{{ "tags" | absURL }}/{{ . | urlize }}">{{ . }}</a> </li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{- partial "post-info.html" . -}}
|
||||
</header>
|
||||
<article id="content">
|
||||
{{ .Content }}
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
<ul class="post-info">
|
||||
<li>Publié le : {{ dateFormat "2006-01-02" (default .Date (.PublishDate)) }}</li>
|
||||
{{ if isset .Params "lastmod" }}
|
||||
<li>Dernière mise à jour : {{ .Lastmod.Format "2006-01-02" }}</li>
|
||||
{{ end }}
|
||||
{{ with .Params.categories }}
|
||||
<li>Catégories :
|
||||
<ul>
|
||||
{{ range . }}
|
||||
<li><a href="{{ "categories" | absURL}}/{{ . | urlize }}">{{ . }}</a> </li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ with .Params.tags }}
|
||||
<li>Tags :
|
||||
<ul>
|
||||
{{ range . }}
|
||||
<li> <a href="{{ "tags" | absURL }}/{{ . | urlize }}">{{ . }}</a> </li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
Loading…
Reference in New Issue