From 9e586f088b58b96f4afa403bc4002f6e1a97a005 Mon Sep 17 00:00:00 2001 From: paspo Date: Wed, 11 Sep 2024 21:34:49 +0200 Subject: [PATCH] prova warning banner alternativo --- assets/sass/custom.scss | 54 +++++++++++++++++++ data/en/homepage.yml | 10 ++-- data/it/homepage.yml | 10 ++-- layouts/partials/head/important-warning.html | 9 ---- layouts/partials/header.html | 2 - .../homepage/blocks/important-warning.html | 13 +++++ 6 files changed, 79 insertions(+), 19 deletions(-) delete mode 100644 layouts/partials/head/important-warning.html create mode 100644 layouts/partials/homepage/blocks/important-warning.html diff --git a/assets/sass/custom.scss b/assets/sass/custom.scss index 2cb15c0..c8ec809 100644 --- a/assets/sass/custom.scss +++ b/assets/sass/custom.scss @@ -120,3 +120,57 @@ div.highlight pre code > span::before { display: inline-block; padding-right: 0.2em; } + + +/* important warning */ + +#importantwarning { + text-align: center; + padding: 3.5em 0; + + header { + h2 { + display: inline-block; + vertical-align: middle; + margin: 0; + } + + .button { + vertical-align: middle; + margin-left: 1em; + } + } +} + +.wrapper.style4 { + + .warningicon { + float:left; + padding-left: 1em; + padding-right: 1em; + font-size: 3em; + text-align: left; + } + + .container { + background-color: _palette(accent, bg); + @include vendor('background-image', ('linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0,0.15))', 'url("images/bg01.png")')); + border-radius: 12px; + color: _palette(accent, fg); + padding-top: 2em; + padding-bottom: 2em; + text-align: left; + } + background: _palette(bg); + + .button { + background: _palette(accent, fg); + color: _palette(fg); + float: right; + margin-right: 1em; + + &:hover { + color: _palette(accent, bg) !important; + } + } +} diff --git a/data/en/homepage.yml b/data/en/homepage.yml index 88b614f..8126071 100644 --- a/data/en/homepage.yml +++ b/data/en/homepage.yml @@ -1,8 +1,4 @@ --- -importantWarning: - enabled: false - link: /en/where - message: "BGLUG is closed on 10 october" banner: enable: true image: homepage_banner.jpg @@ -11,6 +7,12 @@ banner: contents: "Learn more..." url: who items: + - type: important-warning + enabled: true + link: + url: /en/where + title: More info + contents: "BGLUG is closed on 10 october" - heading: Latest posts type: posts content_type: posts diff --git a/data/it/homepage.yml b/data/it/homepage.yml index 026685e..8a9b1d1 100644 --- a/data/it/homepage.yml +++ b/data/it/homepage.yml @@ -1,8 +1,4 @@ --- -importantWarning: - enabled: false - link: /it/dove-siamo - message: "Il BGLUG è chiuso il 10 ottobre" banner: enable: true image: homepage_banner.jpg @@ -11,6 +7,12 @@ banner: contents: "Scopri di più..." url: chi-siamo items: + - type: important-warning + enabled: true + link: + url: /it/dove-siamo + title: Ulteriori informazioni + contents: "Il BGLUG è chiuso il 10 ottobre" - heading: Ultimi post type: posts content_type: posts diff --git a/layouts/partials/head/important-warning.html b/layouts/partials/head/important-warning.html deleted file mode 100644 index f589a1c..0000000 --- a/layouts/partials/head/important-warning.html +++ /dev/null @@ -1,9 +0,0 @@ -
- {{ with index ( index .Site.Data .Site.Language.Lang | default .Site.Data ) (.Param "homepage_data" | default "homepage") }} - {{ if .importantWarning.enabled}} -
- ⚠️⚠️⚠️ {{ .importantWarning.message }} ⚠️⚠️⚠️ -
- {{- end -}} - {{ end }} -
\ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index b160d73..5194d2a 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -43,5 +43,3 @@ - -{{- partial "head/important-warning.html" . }} diff --git a/layouts/partials/homepage/blocks/important-warning.html b/layouts/partials/homepage/blocks/important-warning.html new file mode 100644 index 0000000..398d526 --- /dev/null +++ b/layouts/partials/homepage/blocks/important-warning.html @@ -0,0 +1,13 @@ +{{- if .item.enabled -}} +
+
+
+ +

{{ .item.contents | markdownify }}

+ {{- with .item.link }} + {{ .title }} + {{- end }} +
+
+
+{{- end -}}