From 45b941f3272f5c9f4cfeebeff74b12e287c4f2f6 Mon Sep 17 00:00:00 2001 From: Colmaris Date: Tue, 1 Apr 2025 16:23:35 +0200 Subject: [PATCH] open comments in mastodon --- archetypes/default.md | 4 + themes/hugo-blog-awesome/i18n/fr-fr.yaml | 14 +++- .../layouts/_default/single.html | 1 + .../layouts/partials/masto-comments.html | 81 +++++++++++++++++++ 4 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 themes/hugo-blog-awesome/layouts/partials/masto-comments.html diff --git a/archetypes/default.md b/archetypes/default.md index 867e444..8dd43f9 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -9,4 +9,8 @@ description: "Jour 006/100 du défi 100DaysToOffLoad." categories: - cat1 toc: true +comments: + host: gts.colmaris.fr + username: colmaris + id: --- \ No newline at end of file diff --git a/themes/hugo-blog-awesome/i18n/fr-fr.yaml b/themes/hugo-blog-awesome/i18n/fr-fr.yaml index aaa96c9..15f01dd 100644 --- a/themes/hugo-blog-awesome/i18n/fr-fr.yaml +++ b/themes/hugo-blog-awesome/i18n/fr-fr.yaml @@ -24,4 +24,16 @@ translation: "404 PAGE NON TROUVÉE" - id: "errors.404_description" - translation: "Vous avez suivi une adresse qui n'existe pas." \ No newline at end of file + translation: "Vous avez suivi une adresse qui n'existe pas." + +- id: "Comments" + translation: "Commentaires" + +- id: "Use_fediverse_account" + translation: 'Vous pouvez répondre sur Mastodon !' + +- id: "Load_comments" + translation: "Charger les commentaires" + +- id: "No_comment" + translation: "Pas encore de commentaire, soyez le premier à réagir !" diff --git a/themes/hugo-blog-awesome/layouts/_default/single.html b/themes/hugo-blog-awesome/layouts/_default/single.html index 654596e..83a2c34 100644 --- a/themes/hugo-blog-awesome/layouts/_default/single.html +++ b/themes/hugo-blog-awesome/layouts/_default/single.html @@ -16,6 +16,7 @@
{{ .Content }}
+ {{ partial "masto-comments.html" . }} {{- partial "comments.html" . -}} diff --git a/themes/hugo-blog-awesome/layouts/partials/masto-comments.html b/themes/hugo-blog-awesome/layouts/partials/masto-comments.html new file mode 100644 index 0000000..95ea18c --- /dev/null +++ b/themes/hugo-blog-awesome/layouts/partials/masto-comments.html @@ -0,0 +1,81 @@ +{{ with .Params.comments }} +
+ {{ $icon := index $.Site.Data.fontawesome.icons "comments" }} + {{ $svg := $icon.svg.solid | default $icon.svg.regular | default $icon.svg.brands }} +

{{ safeHTML $svg.raw }} {{ i18n "Comments" . }}

+

+ {{ i18n "Use_fediverse_account" . | safeHTML }} +

+

+ + + +
+{{ end }} \ No newline at end of file