prova warning banner alternativo
All checks were successful
Linting markdown on PR / unicode-check (pull_request) Successful in 46s

This commit is contained in:
Paolo Asperti 2024-09-11 21:34:49 +02:00
parent 5e41d042b1
commit 9e586f088b
Signed by: paspo
GPG Key ID: 06D46905D19D5182
6 changed files with 79 additions and 19 deletions

View File

@ -120,3 +120,57 @@ div.highlight pre code > span::before {
display: inline-block; display: inline-block;
padding-right: 0.2em; 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;
}
}
}

View File

@ -1,8 +1,4 @@
--- ---
importantWarning:
enabled: false
link: /en/where
message: "BGLUG is closed on 10 october"
banner: banner:
enable: true enable: true
image: homepage_banner.jpg image: homepage_banner.jpg
@ -11,6 +7,12 @@ banner:
contents: "Learn more..." contents: "Learn more..."
url: who url: who
items: items:
- type: important-warning
enabled: true
link:
url: /en/where
title: More info
contents: "BGLUG is closed on 10 october"
- heading: Latest posts - heading: Latest posts
type: posts type: posts
content_type: posts content_type: posts

View File

@ -1,8 +1,4 @@
--- ---
importantWarning:
enabled: false
link: /it/dove-siamo
message: "Il BGLUG è chiuso il 10 ottobre"
banner: banner:
enable: true enable: true
image: homepage_banner.jpg image: homepage_banner.jpg
@ -11,6 +7,12 @@ banner:
contents: "Scopri di più..." contents: "Scopri di più..."
url: chi-siamo url: chi-siamo
items: items:
- type: important-warning
enabled: true
link:
url: /it/dove-siamo
title: Ulteriori informazioni
contents: "Il BGLUG è chiuso il 10 ottobre"
- heading: Ultimi post - heading: Ultimi post
type: posts type: posts
content_type: posts content_type: posts

View File

@ -1,9 +0,0 @@
<div>
{{ with index ( index .Site.Data .Site.Language.Lang | default .Site.Data ) (.Param "homepage_data" | default "homepage") }}
{{ if .importantWarning.enabled}}
<div style="text-align: center; background-color: yellow; font-weight: bold; font-size: xx-large; padding-top: 10px; padding-bottom: 10px;">
<a href="{{ urls.AbsURL .importantWarning.link }}" style="color: blue; text-decoration: underline;">⚠️⚠️⚠️ {{ .importantWarning.message }} ⚠️⚠️⚠️</a>
</div>
{{- end -}}
{{ end }}
</div>

View File

@ -43,5 +43,3 @@
</ul> </ul>
</nav> </nav>
</div> </div>
{{- partial "head/important-warning.html" . }}

View File

@ -0,0 +1,13 @@
{{- if .item.enabled -}}
<section id="importantwarning" class="wrapper style4">
<div class="container">
<header>
<i class="warningicon fa-solid fa-triangle-exclamation"></i>
<h2>{{ .item.contents | markdownify }}</h2>
{{- with .item.link }}
<a href="{{ .url }}" class="button">{{ .title }}</a>
{{- end }}
</header>
</div>
</section>
{{- end -}}