small fixes

This commit is contained in:
teldra 2022-06-12 21:14:14 +02:00
parent d0ae5c0466
commit a71e15aba5
2 changed files with 28 additions and 8 deletions

View File

@ -9,10 +9,26 @@
background-attachment: fixed;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
h1 {
word-break: break-all;
justify-content: flex-end;
.title_index {
word-break: break-all;
align-self: center;
justify-self: center;
color: var(--text-main);
background: var(--background-body);
border-radius: 10px;
text-shadow: 0px 4px 3px rgba(0,0,0,0.4),
0px 8px 13px rgba(0,0,0,0.1),
0px 18px 23px rgba(0,0,0,0.1);
}
.title {
background: var(--background-body);
word-break: break-all;
color: var(--text-main);
margin-bottom: 0;
text-shadow: 0px 4px 3px rgba(0,0,0,0.4),
0px 8px 13px rgba(0,0,0,0.1),
0px 18px 23px rgba(0,0,0,0.1);
}
}

View File

@ -17,13 +17,17 @@
{{ $what = .File.ContentBaseName }}
{{ end }}
{{ end }}
{{ $title_class := safeCSS "title" }}
{{ if .IsHome }}
{{ $title_class = safeCSS "title_index" }}
{{ end }}
{{ $banner := printf "/images/banner/%s*" $what }}
{{ if resources.GetMatch $banner }}
{{ $img = (resources.GetMatch $banner).Fill $fill }}
{{ end }}
{{ if and (resources.GetMatch $banner) (ne .Params.banner false) }}
<div style="background-image: url({{- $img.Permalink -}})" class="banner">
<h1>{{ $title }}</h1>
<h1 class="{{ $title_class }}">{{ $title }}</h1>
{{ if eq hugo.Environment "development" }}
<div>
{{ $w := (resources.GetMatch $banner).Width }}
@ -52,7 +56,7 @@
{{ else if and (.Resources.Match "banner*") (ne .Params.banner false) }}
{{ $img = (.Resources.GetMatch "banner*").Fill $fill }}
<div style="background-image:url({{- $img.Permalink -}})" class="banner">
<h1>{{ $title }}</h1>
<h1 class="{{ $title_class }}">{{ $title }}</h1>
{{ if eq hugo.Environment "development" }}
<div>
{{ $w := (index (.Resources.Match "banner*") 0).Width }}
@ -81,7 +85,7 @@
{{ else if and (.Resources.ByType "image") (ne .Params.banner false) }}
{{ $img = (index (.Resources.ByType "image") 0).Fill $fill }}
<div style="background-image: url({{- $img.Permalink -}})" class="banner">
<h1>{{ $title }}</h1>
<h1 class="{{ $title_class }}">{{ $title }}</h1>
{{ if eq hugo.Environment "development" }}
<div>
{{ $w := (index (.Resources.ByType "image") 0).Width }}
@ -109,7 +113,7 @@
</div>
{{ else }}
<div class="banner">
<h1>{{ $title }}</h1>
<h1 class="{{ $title_class }}">{{ $title }}</h1>
{{ if eq hugo.Environment "development" }}
<p>
assets/images/banner/{{ $what -}}.* missing..<br>