From 6ab3a7bd5640623aeb7847f1eb2f1077d8e777f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Herg=C3=A8s?= Date: Fri, 16 Jan 2026 22:05:19 +0100 Subject: style(html): use prettier plugin for go html --- .prettierrc | 11 ++++ backend/templates/404.html | 18 +++---- backend/templates/admin.html | 102 ++++++++++++++++++------------------ backend/templates/base.html | 4 +- backend/templates/components.html | 62 +++++++++++++--------- backend/templates/data.html | 22 ++++---- backend/templates/home.html | 34 ++++++------ backend/templates/home_section.html | 21 ++++---- backend/templates/simple.html | 2 +- bun.lock | 5 ++ package.json | 3 +- 11 files changed, 156 insertions(+), 128 deletions(-) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..a141374 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,11 @@ +{ + "plugins": ["prettier-plugin-go-template"], + "overrides": [ + { + "files": ["*.html"], + "options": { + "parser": "go-template" + } + } + ] +} 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" }} -
-

Oh non, je crois que tu t'es perdu :(

-

Tu as des liens en haut pour retrouver ton chemin :3

-

- Si tu penses que c'est un bug, hésite pas à ouvrir une issue sur - GitHub :D -

-

(enfin, sauf si tu as un compte sur ma forge, mais ça m'étonnerait...)

-
+
+

Oh non, je crois que tu t'es perdu :(

+

Tu as des liens en haut pour retrouver ton chemin :3

+

+ Si tu penses que c'est un bug, hésite pas à ouvrir une issue sur + GitHub :D +

+

(enfin, sauf si tu as un compte sur ma forge, mais ça m'étonnerait...)

+
{{ 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"}} -
-
-

Administration

-

- Panel d'administration très simple. Il affiche les stats et possiblement les webmentions et autre contenu à - modérer. -

-
-
-

Stats

-

Visits

- - - - - - - - - {{ range .Visits }} - - - - - {{ end }} - -
TargetVisits
{{ .Target }}{{ .Visit }}
-

Origin

- - - - - - - - - - {{ range .Rows }} - - - - - - {{ end }} - -
OriginTargetVisits
{{ .Origin }}{{ .Target }}{{ .Visit }}
- -
-
-{{end}} +{{ define "body" }} +
+
+

Administration

+

+ Panel d'administration très simple. Il affiche les stats et possiblement les webmentions et autre contenu à + modérer. +

+
+
+

Stats

+

Visits

+ + + + + + + + + {{ range .Visits }} + + + + + {{ end }} + +
TargetVisits
{{ .Target }}{{ .Visit }}
+

Origin

+ + + + + + + + + + {{ range .Rows }} + + + + + + {{ end }} + +
OriginTargetVisits
{{ .Origin }}{{ .Target }}{{ .Visit }}
+ +
+
+{{ 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 @@ {{ if ne .PubDate "" }} - + {{ end }} @@ -32,7 +32,7 @@
Logo {{ $url := .URL }} - +
{{ template "body" . }}