aboutsummaryrefslogtreecommitdiff
path: root/backend/templates
diff options
context:
space:
mode:
authorWilliam Hergès <william@herges.fr>2026-01-16 22:05:19 +0100
committerWilliam Hergès <william@herges.fr>2026-01-16 22:05:19 +0100
commit6ab3a7bd5640623aeb7847f1eb2f1077d8e777f3 (patch)
tree87ace5305cbf4aefc67fdbe407ae94e673845c45 /backend/templates
parentf67c350197e1c46887baf67398445e2b47a8f067 (diff)
style(html): use prettier plugin for go html
Diffstat (limited to 'backend/templates')
-rw-r--r--backend/templates/404.html18
-rw-r--r--backend/templates/admin.html102
-rw-r--r--backend/templates/base.html4
-rw-r--r--backend/templates/components.html62
-rw-r--r--backend/templates/data.html22
-rw-r--r--backend/templates/home.html34
-rw-r--r--backend/templates/home_section.html21
-rw-r--r--backend/templates/simple.html2
8 files changed, 138 insertions, 127 deletions
diff --git a/backend/templates/404.html b/backend/templates/404.html
index e0bca68..52d3cc9 100644
--- a/backend/templates/404.html
+++ b/backend/templates/404.html
@@ -1,11 +1,11 @@
{{ define "body" }}
-<main id="content">
- <h1>Oh non, je crois que tu t'es perdu :(</h1>
- <p>Tu as des liens en haut pour retrouver ton chemin :3</p>
- <p>
- Si tu penses que c'est un bug, hésite pas à ouvrir une issue sur
- <a href="https://github.com/anhgelus/small-web/issues">GitHub</a> :D
- </p>
- <p>(enfin, sauf si tu as un compte sur ma forge, mais ça m'étonnerait...)</p>
-</main>
+ <main id="content">
+ <h1>Oh non, je crois que tu t'es perdu :(</h1>
+ <p>Tu as des liens en haut pour retrouver ton chemin :3</p>
+ <p>
+ Si tu penses que c'est un bug, hésite pas à ouvrir une issue sur
+ <a href="https://github.com/anhgelus/small-web/issues">GitHub</a> :D
+ </p>
+ <p>(enfin, sauf si tu as un compte sur ma forge, mais ça m'étonnerait...)</p>
+ </main>
{{ end }}
diff --git a/backend/templates/admin.html b/backend/templates/admin.html
index 008827f..c4c83c5 100644
--- a/backend/templates/admin.html
+++ b/backend/templates/admin.html
@@ -1,51 +1,51 @@
-{{define "body"}}
-<main id="content">
- <div class="introduction">
- <h1>Administration</h1>
- <p>
- Panel d'administration très simple. Il affiche les stats et possiblement les webmentions et autre contenu à
- modérer.
- </p>
- </div>
- <article>
- <h2>Stats</h2>
- <h3>Visits</h3>
- <table>
- <thead>
- <tr>
- <th>Target</th>
- <th>Visits</th>
- </tr>
- </thead>
- <tbody>
- {{ range .Visits }}
- <tr>
- <td>{{ .Target }}</td>
- <td>{{ .Visit }}</td>
- </tr>
- {{ end }}
- </tbody>
- </table>
- <h3>Origin</h3>
- <table>
- <thead>
- <tr>
- <th>Origin</th>
- <th>Target</th>
- <th>Visits</th>
- </tr>
- </thead>
- <tbody>
- {{ range .Rows }}
- <tr>
- <td>{{ .Origin }}</td>
- <td>{{ .Target }}</td>
- <td>{{ .Visit }}</td>
- </tr>
- {{ end }}
- </tbody>
- </table>
- <div class="pagination">{{ template "pagination" . }}</div>
- </article>
-</main>
-{{end}}
+{{ define "body" }}
+ <main id="content">
+ <div class="introduction">
+ <h1>Administration</h1>
+ <p>
+ Panel d'administration très simple. Il affiche les stats et possiblement les webmentions et autre contenu à
+ modérer.
+ </p>
+ </div>
+ <article>
+ <h2>Stats</h2>
+ <h3>Visits</h3>
+ <table>
+ <thead>
+ <tr>
+ <th>Target</th>
+ <th>Visits</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{ range .Visits }}
+ <tr>
+ <td>{{ .Target }}</td>
+ <td>{{ .Visit }}</td>
+ </tr>
+ {{ end }}
+ </tbody>
+ </table>
+ <h3>Origin</h3>
+ <table>
+ <thead>
+ <tr>
+ <th>Origin</th>
+ <th>Target</th>
+ <th>Visits</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{ range .Rows }}
+ <tr>
+ <td>{{ .Origin }}</td>
+ <td>{{ .Target }}</td>
+ <td>{{ .Visit }}</td>
+ </tr>
+ {{ end }}
+ </tbody>
+ </table>
+ <div class="pagination">{{ template "pagination" . }}</div>
+ </article>
+ </main>
+{{ end }}
diff --git a/backend/templates/base.html b/backend/templates/base.html
index 20abcd0..b2071b1 100644
--- a/backend/templates/base.html
+++ b/backend/templates/base.html
@@ -18,7 +18,7 @@
<meta property="og:local" content="fr_FR" />
<meta property="og:site_name" content="{{ .Name }}" />
{{ if ne .PubDate "" }}
- <meta property="article:published_time" content="{{ .PubDate }}" />
+ <meta property="article:published_time" content="{{ .PubDate }}" />
{{ end }}
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image" />
@@ -32,7 +32,7 @@
<header>
<img src="{{ static .Logo.Header }}" alt="Logo" />
{{ $url := .URL }}
- <nav>{{ range .Links }}{{ .Render $url }}{{end}}</nav>
+ <nav>{{ range .Links }}{{ .Render $url }}{{ end }}</nav>
</header>
{{ template "body" . }}
<footer>
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 }}
diff --git a/backend/templates/data.html b/backend/templates/data.html
index a384459..e548bef 100644
--- a/backend/templates/data.html
+++ b/backend/templates/data.html
@@ -1,11 +1,11 @@
-{{define "body"}}
-<article id="content">
- <h1>{{ .DataTitle }}</h1>
- <p>{{ .Description }}</p>
- <figure>
- <img src="{{ static .Img.Src }}" alt="{{ .Img.Alt }}" class="large" />
- <figcaption>{{ .Img.Legend }}</figcaption>
- </figure>
- {{ .Content }}
-</article>
-{{end}}
+{{ define "body" }}
+ <article id="content">
+ <h1>{{ .DataTitle }}</h1>
+ <p>{{ .Description }}</p>
+ <figure>
+ <img src="{{ static .Img.Src }}" alt="{{ .Img.Alt }}" class="large" />
+ <figcaption>{{ .Img.Legend }}</figcaption>
+ </figure>
+ {{ .Content }}
+ </article>
+{{ end }}
diff --git a/backend/templates/home.html b/backend/templates/home.html
index d574525..4d4271f 100644
--- a/backend/templates/home.html
+++ b/backend/templates/home.html
@@ -1,17 +1,17 @@
-{{define "body"}}
-<main id="content">
- <div class="introduction">
- <h1>{{ .Name }}</h1>
- <p>{{ .PageDescription }}</p>
- </div>
- <div class="sections">
- {{ range .Sections }}
- <section>
- <h2>{{ .Name }}</h2>
- <p>{{ .Description }}</p>
- {{ template "section_display" . }}
- </section>
- {{ end }}
- </div>
-</main>
-{{end}}
+{{ define "body" }}
+ <main id="content">
+ <div class="introduction">
+ <h1>{{ .Name }}</h1>
+ <p>{{ .PageDescription }}</p>
+ </div>
+ <div class="sections">
+ {{ range .Sections }}
+ <section>
+ <h2>{{ .Name }}</h2>
+ <p>{{ .Description }}</p>
+ {{ template "section_display" . }}
+ </section>
+ {{ end }}
+ </div>
+ </main>
+{{ end }}
diff --git a/backend/templates/home_section.html b/backend/templates/home_section.html
index cf7595d..1101843 100644
--- a/backend/templates/home_section.html
+++ b/backend/templates/home_section.html
@@ -1,10 +1,11 @@
-{{define "body"}}
-<main id="content">
- {{ range .Sections }}
- <div class="introduction">
- <h1>{{ .Name }}</h1>
- <p>{{ .Description }}</p>
- </div>
- {{ template "section_display" . }} {{ end }}
-</main>
-{{end}}
+{{ define "body" }}
+ <main id="content">
+ {{ range .Sections }}
+ <div class="introduction">
+ <h1>{{ .Name }}</h1>
+ <p>{{ .Description }}</p>
+ </div>
+ {{ template "section_display" . }}
+ {{ end }}
+ </main>
+{{ end }}
diff --git a/backend/templates/simple.html b/backend/templates/simple.html
index 94721df..44d79a9 100644
--- a/backend/templates/simple.html
+++ b/backend/templates/simple.html
@@ -1,3 +1,3 @@
{{ define "body" }}
-<main id="content">{{ .Content }}</main>
+ <main id="content">{{ .Content }}</main>
{{ end }}