From 758212bc9025e878dc13058a4a35559d4825ef2c Mon Sep 17 00:00:00 2001 From: VaiTon Date: Tue, 5 Mar 2024 17:01:05 +0100 Subject: [PATCH] Updated March 7 2024 event, added alert shortcode --- content/news/2024-03-07/index.md | 12 ++++-- layouts/shortcodes/alert.html | 70 ++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 layouts/shortcodes/alert.html diff --git a/content/news/2024-03-07/index.md b/content/news/2024-03-07/index.md index 147173f..23a1320 100644 --- a/content/news/2024-03-07/index.md +++ b/content/news/2024-03-07/index.md @@ -1,14 +1,20 @@ +++ -title = "// 7 marzo 2024, Lab 3, Risorgimento //" +title = "// 7 marzo 2024, Lab 2, Risorgimento //" date = "2023-02-24" tags = ["incontri"] +++ **Data:** 7 marzo 2024 \ -**Ora:** TBD (da confermare, ricontrolla questo articolo più in là!) \ -**Luogo:** Laboratorio 3, Plesso Risorgimento \ +**Ora:** ~18:00 - ~22:30 \ +**Luogo:** Laboratorio 2, Plesso Risorgimento \ **Indirizzo:** Via Risorgimento 2, Bologna +{{< alert type="warning" title="Attenzione!" >}} + +Il volantino che potresti aver visto in giro è **sbagliato**. Il luogo è **Laboratorio 2** e non Laboratorio 3. + +{{}} + ![Banner](banner.png) **Programma:** diff --git a/layouts/shortcodes/alert.html b/layouts/shortcodes/alert.html new file mode 100644 index 0000000..16baac6 --- /dev/null +++ b/layouts/shortcodes/alert.html @@ -0,0 +1,70 @@ +{{ $isNamedParams := .IsNamedParams }} +{{ $type := "info" }} +{{ if and $isNamedParams (.Get "type") }} +{{ $type = .Get "type" }} +{{ end }} + +{{ $borderColor := "" }} +{{ if eq $type "info" }} +{{ $borderColor = "#5bc0de" }} +{{ else if eq $type "warning" }} +{{ $borderColor = "#f0ad4e" }} +{{ else if eq $type "danger" }} +{{ $borderColor = "#d9534f" }} +{{ else if eq $type "success" }} +{{ $borderColor = "#5cb85c" }} +{{ end }} + +{{ $color := ""}} +{{ if eq $type "info" }} +{{ $color = "#31708f" }} +{{ else if eq $type "warning" }} +{{ $color = "#8a6d3b" }} +{{ else if eq $type "danger" }} +{{ $color = "#a94442" }} +{{ else if eq $type "success" }} +{{ $color = "#3c763d" }} +{{ end }} + +{{ $icon := "" }} +{{ if and $isNamedParams (.Get "icon") }} +{{ $icon = .Get "icon" }} +{{ else }} +{{ if eq $type "info" }} +{{ $icon = ":information_source:" }} +{{ else if eq $type "warning" }} +{{ $icon = ":warning:" }} +{{ else if eq $type "danger" }} +{{ $icon = ":x:" }} +{{ else if eq $type "success" }} +{{ $icon = ":heavy_check_mark:" }} +{{ end }} +{{ end }} + +{{ $title := "" }} +{{ if and $isNamedParams (.Get "title") }} +{{ $title = .Get "title" }} +{{ else }} +{{ if eq $type "info" }} +{{ $title = "Information" }} +{{ else if eq $type "warning" }} +{{ $title = "Warning" }} +{{ else if eq $type "danger" }} +{{ $title = "Danger" }} +{{ else if eq $type "success" }} +{{ $title = "Success" }} +{{ end }} +{{ end }} + + +
+

+ {{ emojify $icon }} + + {{ $title }} + +

+

+ {{ markdownify .Inner }} +

+