From 43b181fd91cd80738fff9f89189a687216af1544 Mon Sep 17 00:00:00 2001 From: amreo Date: Tue, 4 Feb 2025 22:27:30 +0100 Subject: [PATCH 1/4] Aggiunto shortcode img e sistemato un articolo per immagine --- .../index.en.md | 2 +- .../index.it.md | 2 +- layouts/shortcodes/img.html | 23 +++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 layouts/shortcodes/img.html diff --git a/content/events/2025/lettura-ada-zangemann-bergamo-tiraboschi/index.en.md b/content/events/2025/lettura-ada-zangemann-bergamo-tiraboschi/index.en.md index ff880b1..3b0fa0a 100644 --- a/content/events/2025/lettura-ada-zangemann-bergamo-tiraboschi/index.en.md +++ b/content/events/2025/lettura-ada-zangemann-bergamo-tiraboschi/index.en.md @@ -48,7 +48,7 @@ The library does not have an internal car park. Click below on the openstreetmap 🪧 **Official poster** -![Official event poster](locandina-evento-2025-02-15.png) +{{< img src="locandina-evento-2025-02-15.png" alt="Official event poster" author="Tiraboschi Library" license-text="CC0" license-url="creativecommons.org/publicdomain/zero/1.0/deed.en" >}} [Also in PDF format](locandina-evento-2025-02-15.pdf) 📒 **Contacts** diff --git a/content/events/2025/lettura-ada-zangemann-bergamo-tiraboschi/index.it.md b/content/events/2025/lettura-ada-zangemann-bergamo-tiraboschi/index.it.md index 8301da8..aa0ebee 100644 --- a/content/events/2025/lettura-ada-zangemann-bergamo-tiraboschi/index.it.md +++ b/content/events/2025/lettura-ada-zangemann-bergamo-tiraboschi/index.it.md @@ -47,7 +47,7 @@ La biblioteca non dispone di un parcheggio interno. Clicca qui sotto la mappa di 🪧 **Locandina ufficiale** -![Locandina ufficiale dell'evento](locandina-evento-2025-02-15.png) +{{< img src="locandina-evento-2025-02-15.png" alt="Locandina ufficiale dell'evento" author="Biblioteca Tiraboschi" license-text="CC0" license-url="creativecommons.org/publicdomain/zero/1.0/deed.it" >}} [Anche in formato PDF](locandina-evento-2025-02-15.pdf) 📒 **Contatti** diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html new file mode 100644 index 0000000..525457a --- /dev/null +++ b/layouts/shortcodes/img.html @@ -0,0 +1,23 @@ +
+ {{ .Get + + {{ if strings.HasPrefix (.Get "source") "http" }} + 🛈 Fonte: {{ .Get "source" }} + {{ else if ne (.Get "source") "" }} + 🛈 Fonte: {{ .Get "source" }} + {{ end }} + + + {{ if ne (.Get "author") "" }} + 🧑‍🎨 Autore: {{ .Get "author" }} + {{ end }} + + + {{ if ne (.Get "license-text") "" }} + {{ if strings.HasPrefix (.Get "license-url") "http" }} + 📄 Licenza: {{ .Get "license-text" }} + {{ else }} + 📄 Licenza: {{ .Get "license-text" }} + {{ end }} + {{ end }} +
\ No newline at end of file -- 2.47.2 From 8d3f758755db282cfc9d02998ec6c2629e3b0ec5 Mon Sep 17 00:00:00 2001 From: amreo Date: Tue, 4 Feb 2025 22:34:34 +0100 Subject: [PATCH 2/4] Aggiunta traduzione in italiano e inglese --- i18n/en.yaml | 2 ++ i18n/it.yaml | 2 ++ layouts/shortcodes/img.html | 10 +++++----- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/i18n/en.yaml b/i18n/en.yaml index 77de4f7..1b68c31 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -11,3 +11,5 @@ come_and_see_us: Come and see us where: Where more_tags: "...more" editions: Editions +source: Source +author: Author \ No newline at end of file diff --git a/i18n/it.yaml b/i18n/it.yaml index 46104af..e75651e 100644 --- a/i18n/it.yaml +++ b/i18n/it.yaml @@ -11,3 +11,5 @@ come_and_see_us: Vieni a trovarci where: Dove siamo more_tags: "...altro" editions: Edizioni +source: Fonte +author: Autore \ No newline at end of file diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index 525457a..5a72726 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -2,22 +2,22 @@ {{ .Get {{ if strings.HasPrefix (.Get "source") "http" }} - 🛈 Fonte: {{ .Get "source" }} + 🛈 {{ T "source" }}: {{ .Get "source" }} {{ else if ne (.Get "source") "" }} - 🛈 Fonte: {{ .Get "source" }} + 🛈 {{ T "source" }}: {{ .Get "source" }} {{ end }} {{ if ne (.Get "author") "" }} - 🧑‍🎨 Autore: {{ .Get "author" }} + 🧑‍🎨 {{ T "author" }}: {{ .Get "author" }} {{ end }} {{ if ne (.Get "license-text") "" }} {{ if strings.HasPrefix (.Get "license-url") "http" }} - 📄 Licenza: {{ .Get "license-text" }} + 📄 {{ T "license" }}: {{ .Get "license-text" }} {{ else }} - 📄 Licenza: {{ .Get "license-text" }} + 📄 {{ T "license" }}: {{ .Get "license-text" }} {{ end }} {{ end }} \ No newline at end of file -- 2.47.2 From 2b9362aef6a0fca3b782b850d2302737dae2f506 Mon Sep 17 00:00:00 2001 From: amreo Date: Tue, 4 Feb 2025 22:45:00 +0100 Subject: [PATCH 3/4] Piccoli fi --- layouts/shortcodes/img.html | 41 +++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index 5a72726..2316130 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -1,23 +1,24 @@ -
+
{{ .Get - {{ if strings.HasPrefix (.Get "source") "http" }} - 🛈 {{ T "source" }}: {{ .Get "source" }} - {{ else if ne (.Get "source") "" }} - 🛈 {{ T "source" }}: {{ .Get "source" }} - {{ end }} - - - {{ if ne (.Get "author") "" }} - 🧑‍🎨 {{ T "author" }}: {{ .Get "author" }} - {{ end }} - - - {{ if ne (.Get "license-text") "" }} - {{ if strings.HasPrefix (.Get "license-url") "http" }} - 📄 {{ T "license" }}: {{ .Get "license-text" }} - {{ else }} - 📄 {{ T "license" }}: {{ .Get "license-text" }} +
+ {{ if strings.HasPrefix (.Get "source") "http" }} + 🛈 {{ T "source" }}: {{ .Get "source" }} + {{ else if ne (.Get "source") "" }} + 🛈 {{ T "source" }}: {{ .Get "source" }} {{ end }} - {{ end }} -
\ No newline at end of file + + {{ if ne (.Get "author") "" }} + 🧑‍🎨 {{ T "author" }}: {{ .Get "author" }} + {{ end }} + + + {{ if ne (.Get "license-text") "" }} + {{ if strings.HasPrefix (.Get "license-url") "http" }} + 📄 {{ T "license" }}: {{ .Get "license-text" }} + {{ else }} + 📄 {{ T "license" }}: {{ .Get "license-text" }} + {{ end }} + {{ end }} +
+ \ No newline at end of file -- 2.47.2 From 38de79944751a4a7d017630fdb89e1f3e55c06e5 Mon Sep 17 00:00:00 2001 From: paspo Date: Tue, 8 Apr 2025 21:50:28 +0200 Subject: [PATCH 4/4] fix img --- layouts/shortcodes/img.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index 2316130..332cd1c 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -1,5 +1,7 @@
- {{ .Get + + {{- $imgsrc := .Page.Resources.GetMatch (.Get "src") -}} + {{ .Get
{{ if strings.HasPrefix (.Get "source") "http" }} -- 2.47.2