vmems-website/themes/vmems-theme/layouts/authors/list.html

134 lines
3.4 KiB
HTML
Raw Normal View History

{{ define "main" }}
{{ if (eq .Page.RelPermalink "/authors/") }}
<h1>Nos rédacteurs:</h1>
{{ else }}
{{ $page := . }}
{{ $prevauthordata := index .Site.Data.employees "0" }}
{{ range .Site.Data.employees}}
{{ if eq (lower $page.Name ) .writername }}
{{ $prevauthordata = . }}
{{ end }}
{{ end }}
{{ $authorname := $prevauthordata.name }}
{{ $authorpost :=$prevauthordata.post }}
{{ if eq $prevauthordata.name "NODATA"}}
{{ $authorname = $page.Name }}
{{ $authorpost = "Nous n'avons pour l'instant pas entré de données sur cet employé" }}
{{ end }}
<h1>Les articles par {{$authorname}}:</h1>
<div class=authorinfos>
<div class=authorinfos-l>
<p>Poste: {{ $authorpost }}</p>
{{ if $prevauthordata.description }}
<div class=desc> <p>Description:</p> <div>{{$prevauthordata.description |safeHTML}}</div></div>
{{end}}
</div>
<div class=authorinfos-r>
{{ if $prevauthordata.img}} <img src="{{$prevauthordata.img}}"/>{{end}}
</div>
</div>
<style>
.authorinfos{
display:flex;
flex-direction:row;
justify-content:center;
align-items:center;
align-content:center;
text-align:center;
}
.authorinfos .authorinfos-l .desc{
display:flex;
flex-direction:row;
justify-content:center;
align-items:center;
align-content:center;
text-align:center;
}
.authorinfos .authorinfos-r img{
border-radius:100%;
height:100px!important;
width:100px!important;
}
</style>
{{ end }}
<ul class="articles-list list-style-none">
{{ if (eq .Page.RelPermalink "/authors/") }}
{{ range .Pages }}
{{ $page := . }}
{{ $curauthordata := index .Site.Data.employees "0" }}
{{ range .Site.Data.employees}}
{{ if eq (lower $page.Name ) .writername }}
{{ $curauthordata = . }}
{{ end }}
{{ end }}
{{ $authorname := $curauthordata.name }}
{{ $authorpost :=$curauthordata.post }}
{{ if eq $curauthordata.name "NODATA"}}
{{ $authorname = $page.Name }}
{{ $authorpost = "Nous n'avons pour l'instant pas entré de données sur cet employé" }}
{{ end }}
<li class=article-item>
<a class=article-item-main href="{{ .Permalink }}">
{{ if $curauthordata.img }}
<img src="{{ $curauthordata.img }}" class=baneer>
{{ end }}
<p class=title >{{ $authorname }}</p>
<p class=description>{{ $authorpost }}</p>
</a>
</li>
{{ end }}
{{ else }}
{{ range .Pages }}
<li class=article-item>
{{ if .Params.categories }}
<div class=categories>
{{ $lencat := (len .Params.categories) }}
{{ if (gt $lencat 1) }}
Dans les catégories
{{ else if (eq $lencat 1) }}
Dans la catégorie
{{ else }}
{{ end }}
{{ range $index, $element := .Params.categories }}
<span class=categorie>{{ $element }}</span>
{{ if (not (eq (add $index 1) $lencat)) }}
et
{{ end }}
{{ end }}
</div>
{{ end }}
<div class=infos>
{{ if isset .Params "authors" }}
<span class=authors>
Fait par
{{ $len := (len .Params.authors) }}
{{ range $index, $element := .Params.authors }}
<span class=author>{{ $element }}</span>
{{ if (not (eq (add $index 1) $len)) }}
et
{{ end }}
{{ end }}
</span>
<span name=separator> - </span>
{{ end }}
<time class=date>
{{.Date.Format "2006-01-02"}}
</time>
</div>
<a class=article-item-main href="{{ .Permalink }}">
{{ if .Params.baneer }}
<img src="{{ .Params.baneer }}" class=baneer>
{{ end }}
<p class=title >{{.Title}}</p>
<p class=description></p>
</a>
</li>
{{ end }}
{{ end }}
</ul>
{{ end }}