diff options
| author | William Hergès <william@herges.fr> | 2026-01-16 22:05:19 +0100 |
|---|---|---|
| committer | William Hergès <william@herges.fr> | 2026-01-16 22:05:19 +0100 |
| commit | 6ab3a7bd5640623aeb7847f1eb2f1077d8e777f3 (patch) | |
| tree | 87ace5305cbf4aefc67fdbe407ae94e673845c45 /backend/templates/components.html | |
| parent | f67c350197e1c46887baf67398445e2b47a8f067 (diff) | |
style(html): use prettier plugin for go html
Diffstat (limited to 'backend/templates/components.html')
| -rw-r--r-- | backend/templates/components.html | 62 |
1 files changed, 36 insertions, 26 deletions
diff --git a/backend/templates/components.html b/backend/templates/components.html index b180123..e49a8c4 100644 --- a/backend/templates/components.html +++ b/backend/templates/components.html @@ -1,29 +1,39 @@ {{ define "pagination" }} -<nav> - {{ if ne .CurrentPage 1 }}<a href="?page={{ before .CurrentPage }}">Précédent</a>{{else}} - <p></p> - {{end}} - <p>{{ .CurrentPage }}/{{ .PagesNumber }}</p> - {{ if ne .CurrentPage .PagesNumber }}<a href="?page={{ next .CurrentPage }}">Suivant</a>{{else}} - <p></p> - {{end}} -</nav> -{{ end }} {{define "section_display"}} -<article> - {{ $uri := .URI }} {{ range .Data }} + <nav> + {{ if ne .CurrentPage 1 }} + <a href="?page={{ before .CurrentPage }}">Précédent</a> + {{ else }} + <p></p> + {{ end }} + <p>{{ .CurrentPage }}/{{ .PagesNumber }}</p> + {{ if ne .CurrentPage .PagesNumber }} + <a href="?page={{ next .CurrentPage }}">Suivant</a> + {{ else }} + <p></p> + {{ end }} + </nav> +{{ end }} +{{ define "section_display" }} <article> - <h3><a href="/{{ $uri }}/{{ .Slug }}">{{ .DataTitle }}</a></h3> - <figure> - <a href="/{{ $uri }}/{{ .Slug }}"><img src="{{ static .Img.Src }}" alt="{{ .Img.Alt }}" /></a> - <figcaption>{{ .Img.Legend }}</figcaption> - </figure> - <p>{{ .Description }}</p> + {{ $uri := .URI }} + {{ range .Data }} + <article> + <h3><a href="/{{ $uri }}/{{ .Slug }}">{{ .DataTitle }}</a></h3> + <figure> + <a href="/{{ $uri }}/{{ .Slug }}"><img src="{{ static .Img.Src }}" alt="{{ .Img.Alt }}" /></a> + <figcaption>{{ .Img.Legend }}</figcaption> + </figure> + <p>{{ .Description }}</p> + </article> + {{ end }} + <div class="pagination"> + {{ if .Paginate }} + {{ template "pagination" . }} + {{ else }} + {{ if eq (len .Data) .LenMax }} + <a href="/{{ $uri }}/">Voir plus</a> + {{ end }} + {{ end }} + </div> </article> - {{ end }} - <div class="pagination"> - {{ if .Paginate }} {{ template "pagination" . }} {{ else }} {{ if eq (len .Data) .LenMax }} - <a href="/{{ $uri }}/">Voir plus</a> - {{ end }} {{ end }} - </div> -</article> -{{end}} +{{ end }} |
