Skip to content

Commit

Permalink
Updated March 7 2024 event, added alert shortcode
Browse files Browse the repository at this point in the history
  • Loading branch information
VaiTon committed Mar 5, 2024
1 parent 86301be commit 758212b
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 3 deletions.
12 changes: 9 additions & 3 deletions content/news/2024-03-07/index.md
Original file line number Diff line number Diff line change
@@ -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.

{{</ alert >}}

![Banner](banner.png)

**Programma:**
Expand Down
70 changes: 70 additions & 0 deletions layouts/shortcodes/alert.html
Original file line number Diff line number Diff line change
@@ -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 }}


<blockquote style="border-color: {{ $borderColor }}; background-color: ">
<p style="color: {{$color}}; margin-bottom: 0.2rem">
<span style="margin-inline-end: .5rem;"> {{ emojify $icon }} </span>
<strong>
{{ $title }}
</strong>
</p>
<p>
{{ markdownify .Inner }}
</p>
</blockquote>

0 comments on commit 758212b

Please sign in to comment.