chore: update site layout and styles
This commit is contained in:
@@ -1,84 +1,49 @@
|
||||
{{ define "main" }}
|
||||
{{ $authorName := .Params.author }}
|
||||
{{ $authorSlug := .Params.author_slug }}
|
||||
{{ $authorPosts := where .Site.RegularPages "Params.author" $authorName }}
|
||||
{{ $authors := site.Data.wordpress.authors }}
|
||||
|
||||
<div class="section-sm bg-gray-lighter">
|
||||
<div class="container text-center">
|
||||
<h3 class="font-family-playfair">{{ .Title }}</h3>
|
||||
<p class="mt-2">Tous les articles écrits par {{ $authorName }}</p>
|
||||
<p class="mt-2">Liste de tous les auteurs</p>
|
||||
</div><!-- end container -->
|
||||
</div>
|
||||
|
||||
<!-- Blog section -->
|
||||
<div class="section">
|
||||
<div class="container">
|
||||
<div class="row g-4">
|
||||
<div class="col-12 col-sm-10 offset-sm-1 col-md-8 offset-md-2">
|
||||
{{ $paginationLimit := 10 }}
|
||||
{{ if .Site.Params.paginationLimit }}{{ $paginationLimit = .Site.Params.paginationLimit }}{{ end }}
|
||||
{{ $paginator := .Paginate $authorPosts $paginationLimit }}
|
||||
|
||||
{{ if gt (len $authorPosts) 0 }}
|
||||
{{ range $paginator.Pages }}
|
||||
<!-- Blog Post box -->
|
||||
<div class="mb-5">
|
||||
<div class="img-link-box">
|
||||
<a href="{{ .RelPermalink }}">
|
||||
{{ if .Params.featured_image }}
|
||||
<img src="{{ .Params.featured_image }}" alt="{{ .Title }}">
|
||||
<div class="author-list">
|
||||
<div class="row">
|
||||
{{ range $author := $authors }}
|
||||
<div class="col-md-6 mb-4">
|
||||
<article class="author-card-item h-100 card" data-author-name="{{ $author.name }}">
|
||||
<div class="row g-0 align-items-center">
|
||||
<div class="author-card-image col-md-4 p-2">
|
||||
{{ with index $author.avatar_urls "96" }}
|
||||
<img decoding="async" src="{{ . }}" alt="{{ $author.name }}" class="author-image img-fluid" loading="lazy">
|
||||
{{ else }}
|
||||
<img src="/assets/images/col-1.jpg" alt="{{ .Title }}">
|
||||
<img decoding="async" src="/assets/images/img-avatar-md@2x.jpg" alt="{{ $author.name }}" class="author-image img-fluid" loading="lazy">
|
||||
{{ end }}
|
||||
</a>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<div class="d-flex justify-content-between mb-2">
|
||||
<div class="d-inline-flex">
|
||||
{{ if .Params.categories }}
|
||||
{{ range $index, $category := .Params.categories }}
|
||||
{{ if $index }}, {{ end }}
|
||||
{{ if and (eq (printf "%T" $category) "string") }}
|
||||
<a class="font-family-poppins font-small fw-medium uppercase" href="/categories/{{ $category | urlize }}">{{ $category }}</a>
|
||||
{{ else if and (eq (printf "%T" $category) "map") }}
|
||||
{{ if $category.name }}
|
||||
<a class="font-family-poppins font-small fw-medium uppercase" href="/categories/{{ $category.name | urlize }}">{{ $category.name }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="author-card-info col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title author-card-name">{{ $author.name }}</h5>
|
||||
{{ with $author.description }}
|
||||
<p class="card-text author-card-title">
|
||||
<small class="text-muted author-card-title-text">{{ . }}</small>
|
||||
</p>
|
||||
{{ end }}
|
||||
<div class="author-card-buttons mt-3">
|
||||
<div class="author-card-button">
|
||||
<a href="/author/{{ $author.slug | urlize }}" class="author-button-link" aria-label="Voir les articles de {{ $author.name }}">Voir les articles<svg class="uikit-icon" style="width: 1em;" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="var(--c-svg, currentColor)" d="M7.5 4.5V6h9.442L4.5 18.442 5.558 19.5 18 7.058V16.5h1.5v-12z"></path></svg></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-inline-flex">
|
||||
<span class="font-small">{{ .Date.Format "02/07/2006" }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<h4><a class="text-link-1" href="{{ .RelPermalink }}">{{ .Title }}</a></h4>
|
||||
{{ if .Params.excerpt }}
|
||||
<p>{{ .Params.excerpt }}</p>
|
||||
{{ else if .Summary }}
|
||||
<p>{{ .Summary }}</p>
|
||||
{{ else }}
|
||||
<p>{{ truncate 200 .Content }}</p>
|
||||
{{ end }}
|
||||
<div class="mt-3">
|
||||
<a class="button-text-1" href="{{ .RelPermalink }}">Lire la suite</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Blog Post box -->
|
||||
{{ end }}
|
||||
|
||||
<!-- Pagination -->
|
||||
{{ partial "pagination.html" (dict "Paginator" .Paginator "Page" .) }}
|
||||
{{ else }}
|
||||
<div class="text-center py-5">
|
||||
<h4>Aucun article trouvé</h4>
|
||||
<p>Aucun article n'a été trouvé pour cet auteur.</p>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div><!-- end row -->
|
||||
</div>
|
||||
</div><!-- end container -->
|
||||
</div>
|
||||
<!-- end Blog section -->
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user