From b2905782913ec79a6f2f027d139414c4be9eed4a Mon Sep 17 00:00:00 2001 From: amreo Date: Mon, 9 Sep 2024 00:55:30 +0200 Subject: [PATCH] Spostato la configurazione dell'avviso da config in data --- config.yml | 6 ------ data/en/homepage.yml | 4 ++++ data/it/homepage.yml | 4 ++++ layouts/partials/head/important-warning.html | 14 +++++++++----- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/config.yml b/config.yml index b677cdf..7e1b87d 100644 --- a/config.yml +++ b/config.yml @@ -12,8 +12,6 @@ timeout: 1800s enableRobotsTXT: true params: description: Bergamo Linux Users Group - enableImportantWarning: false - importantWarningLink: dove-siamo social: - title: Mattermost icon: fa-comments @@ -62,8 +60,6 @@ languages: languageCode: it-IT languageDirection: ltr languageName: Italiano - params: - importantWarningMessage: "Il BGLUG è chiuso il 10 ottobre" permalinks: page: posts: /posts/:year/:month/:slug/ @@ -131,8 +127,6 @@ languages: languageCode: en-US languageDirection: ltr languageName: English - params: - importantWarningMessage: "BGLUG is closed il 11 ottobre" permalinks: page: posts: /posts/:year/:month/:slug/ diff --git a/data/en/homepage.yml b/data/en/homepage.yml index ac1d045..45c49af 100644 --- a/data/en/homepage.yml +++ b/data/en/homepage.yml @@ -1,4 +1,8 @@ --- +importantWarning: + enabled: true + link: /en/where + message: "BGLUG is closed on 10 october" banner: enable: true image: homepage_banner.jpg diff --git a/data/it/homepage.yml b/data/it/homepage.yml index 93ed582..b1910dd 100644 --- a/data/it/homepage.yml +++ b/data/it/homepage.yml @@ -1,4 +1,8 @@ --- +importantWarning: + enabled: true + link: /it/dove-siamo + message: "Il BGLUG è chiuso il 10 ottobre" banner: enable: true image: homepage_banner.jpg diff --git a/layouts/partials/head/important-warning.html b/layouts/partials/head/important-warning.html index 811b1cd..f589a1c 100644 --- a/layouts/partials/head/important-warning.html +++ b/layouts/partials/head/important-warning.html @@ -1,5 +1,9 @@ -{{ if .Site.Params.enableImportantWarning }} -
- ⚠️⚠️⚠️ {{ .Site.Params.importantWarningMessage }} ⚠️⚠️⚠️ -
-{{- end -}} \ No newline at end of file +
+ {{ 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