mirror of
https://github.com/adulau/sillon-fictionnel.git
synced 2024-11-22 18:17:11 +00:00
Compare commits
No commits in common. "7829b6c15a5166a602b1152a569cc7fb24c837f8" and "7f57f45eeb5fe643f0e11581de395f14153b90dc" have entirely different histories.
7829b6c15a
...
7f57f45eeb
7 changed files with 6 additions and 104 deletions
|
@ -5,14 +5,11 @@
|
||||||
{{ $pagination := .Paginate .Pages }}
|
{{ $pagination := .Paginate .Pages }}
|
||||||
{{ range $pagination.Pages }}
|
{{ range $pagination.Pages }}
|
||||||
{{ partial "shared/post-item.html" . }}
|
{{ partial "shared/post-item.html" . }}
|
||||||
<div class="lead text-center py-2">
|
|
||||||
<a href='{{ .Page.Permalink }}' ><i class="fa-solid fa-book-open-reader"></i> Feuilleter le sillon...</a>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{{ partial "shared/pagination.html" . }}
|
{{ template "_internal/pagination.html" . }}
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<div class="col-12 mw-md mh-100">
|
<div class="col-12 mw-md mh-100">
|
||||||
<div class="py-4">
|
<div class="py-4">
|
||||||
<div class="py-2">
|
<div class="py-2">
|
||||||
<h1 class="display-1 text-center fw-bold text-primary">
|
<h1 class="display-1 text-center text-uppercase fw-bold text-primary">
|
||||||
{{ .Title }}
|
{{ .Title }}
|
||||||
</h1>
|
</h1>
|
||||||
{{ partial "shared/post-meta" . }}
|
{{ partial "shared/post-meta" . }}
|
||||||
|
|
|
@ -6,14 +6,11 @@
|
||||||
{{ $pagination := .Paginate $mainPages }}
|
{{ $pagination := .Paginate $mainPages }}
|
||||||
{{ range $pagination.Pages }}
|
{{ range $pagination.Pages }}
|
||||||
{{ partial "shared/post-item.html" . }}
|
{{ partial "shared/post-item.html" . }}
|
||||||
<div class="lead text-center py-2">
|
{{ end }}
|
||||||
<a href='{{ .Page.Permalink }}' ><i class="fa-solid fa-book-open-reader"></i> Feuilleter le sillon...</a>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{{ partial "shared/pagination.html" . }}
|
{{ template "_internal/pagination.html" . }}
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -1,87 +0,0 @@
|
||||||
{{ $paginator := $.Paginator }}
|
|
||||||
<!-- Number of links either side of the current page. -->
|
|
||||||
{{ $adjacent_links := 2 }}
|
|
||||||
<!-- $max_links = ($adjacent_links * 2) + 1 -->
|
|
||||||
{{ $max_links := (add (mul $adjacent_links 2) 1) }}
|
|
||||||
<!-- $lower_limit = $adjacent_links + 1 -->
|
|
||||||
{{ $lower_limit := (add $adjacent_links 1) }}
|
|
||||||
<!-- $upper_limit = $paginator.TotalPages - $adjacent_links -->
|
|
||||||
{{ $upper_limit := (sub $paginator.TotalPages $adjacent_links) }}
|
|
||||||
|
|
||||||
{{ if gt $paginator.TotalPages 1 }}
|
|
||||||
<nav aria-label="Page navigation" class="w-100">
|
|
||||||
<ul class="pagination justify-content-center pagination-lg">
|
|
||||||
<!-- First page. -->
|
|
||||||
{{ if ne $paginator.PageNumber 1 }}
|
|
||||||
<li class="page-item">
|
|
||||||
<a class="page-link" href="{{ $paginator.First.URL }}">
|
|
||||||
Début
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{{ end }}
|
|
||||||
<!-- Previous page. -->
|
|
||||||
{{ if $paginator.HasPrev }}
|
|
||||||
<li class="page-item">
|
|
||||||
<a class="page-link" href="{{ $paginator.Prev.URL }}" rel="next">
|
|
||||||
←
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{{ end }}
|
|
||||||
<!-- Page numbers. -->
|
|
||||||
{{ range $paginator.Pagers }}
|
|
||||||
{{ $.Scratch.Set "page_number_flag" false }}
|
|
||||||
<!-- Advanced page numbers. -->
|
|
||||||
{{ if gt $paginator.TotalPages $max_links }}
|
|
||||||
<!-- Lower limit pages. -->
|
|
||||||
<!-- If the user is on a page which is in the lower limit. -->
|
|
||||||
{{ if le $paginator.PageNumber $lower_limit }}
|
|
||||||
<!-- If the current loop page is less than max_links. -->
|
|
||||||
{{ if le .PageNumber $max_links }}
|
|
||||||
{{ $.Scratch.Set "page_number_flag" true }}
|
|
||||||
{{ end }}
|
|
||||||
<!-- Upper limit pages. -->
|
|
||||||
<!-- If the user is on a page which is in the upper limit. -->
|
|
||||||
{{ else if ge $paginator.PageNumber $upper_limit }}
|
|
||||||
<!-- If the current loop page is greater than total pages minus $max_links -->
|
|
||||||
{{ if gt .PageNumber (sub $paginator.TotalPages $max_links) }}
|
|
||||||
{{ $.Scratch.Set "page_number_flag" true }}
|
|
||||||
{{ end }}
|
|
||||||
<!-- Middle pages. -->
|
|
||||||
{{ else }}
|
|
||||||
{{ if and ( ge .PageNumber (sub $paginator.PageNumber $adjacent_links) ) ( le .PageNumber (add $paginator.PageNumber $adjacent_links) ) }}
|
|
||||||
{{ $.Scratch.Set "page_number_flag" true }}
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
<!-- Simple page numbers. -->
|
|
||||||
{{ else }}
|
|
||||||
{{ $.Scratch.Set "page_number_flag" true }}
|
|
||||||
{{ end }}
|
|
||||||
<!-- Output page numbers. -->
|
|
||||||
{{ if eq ($.Scratch.Get "page_number_flag") true }}
|
|
||||||
<li class="page-item{{ if eq . $paginator }} active{{ end }}">
|
|
||||||
<a class="page-link" href="{{ .URL }}" >
|
|
||||||
{{ .PageNumber }}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
<!-- Next page. -->
|
|
||||||
{{ if $paginator.HasNext }}
|
|
||||||
<li class="page-item">
|
|
||||||
<a class="page-link" href="{{ $paginator.Next.URL }}" >
|
|
||||||
→
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{{ end }}
|
|
||||||
<!-- Last page. -->
|
|
||||||
{{ if ne $paginator.PageNumber $paginator.TotalPages }}
|
|
||||||
<li class="page-item">
|
|
||||||
<a class="page-link" href="{{ $paginator.Last.URL }}">
|
|
||||||
Fin
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{{ end }}
|
|
||||||
</ul>
|
|
||||||
<!-- </nav> -->
|
|
||||||
</nav>
|
|
||||||
{{ end }}
|
|
|
@ -8,7 +8,7 @@
|
||||||
<path d="M1.293 7.793A1 1 0 0 1 1 7.086V2a1 1 0 0 0-1 1v4.586a1 1 0 0 0 .293.707l7 7a1 1 0 0 0 1.414 0l.043-.043-7.457-7.457z"/>
|
<path d="M1.293 7.793A1 1 0 0 1 1 7.086V2a1 1 0 0 0-1 1v4.586a1 1 0 0 0 .293.707l7 7a1 1 0 0 0 1.414 0l.043-.043-7.457-7.457z"/>
|
||||||
</svg>
|
</svg>
|
||||||
{{ . }}
|
{{ . }}
|
||||||
</a>
|
</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</span>
|
</span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<article class="py-4">
|
<article class="py-4">
|
||||||
<div class="py-2">
|
<div class="py-2">
|
||||||
<h1 class="display-1 text-center fw-bold text-primary">
|
<h1 class="display-1 text-center text-uppercase fw-bold text-primary">
|
||||||
<a class="text-decoration-none" href="{{ .Permalink }}">
|
<a class="text-decoration-none" href="{{ .Permalink }}">
|
||||||
{{ .Title }}
|
{{ .Title }}
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -38,9 +38,4 @@
|
||||||
{{ range .Params.tags }}
|
{{ range .Params.tags }}
|
||||||
<a href="/tags/{{ . }}">{{ . }}</a>
|
<a href="/tags/{{ . }}">{{ . }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if .IsPage }}
|
|
||||||
{{ with .Page.File.Path }}
|
|
||||||
  <a href='https://github.com/adulau/sillon-fictionnel/edit/main/content/{{ . }}' class="btn"><i class="fa-solid fa-pencil"></i></a>
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue