small fixes

This commit is contained in:
teldra 2022-03-27 16:47:39 +02:00
parent c21b991004
commit c74c29ea26
5 changed files with 92 additions and 63 deletions

View File

@ -5,6 +5,6 @@ when: "13.4.1983"
price: "free"
covid: ""
register: ""
categories: ["Party","recurrent"]
categories: ["Party"]
tags: ["",]
---

View File

@ -59,6 +59,7 @@ h1 {
justify-content: flex-end;
flex-wrap: wrap;
padding-right: .5rem;
align-items: center;
}
#menu a {
@ -213,6 +214,7 @@ article h3 {
flex-shrink: 0;
max-width: 50%;
height: 50%;
margin-right: 1rem;
}
.borderrad25 {

View File

@ -13,13 +13,10 @@
{{- define "main" -}}
{{ $s := .Site.Params }}
{{ if ne .Content "" }}
<article>
{{ .Content }}
</article>
{{ end }}
{{- $paginator := slice -}}
{{- $posts := where .Site.RegularPages "Type" "in" $s.mainSections }}
{{ $meta := "false" }}
{{- if eq .Section "events" -}}
{{- $paginator = .Paginate (where site.RegularPages.ByLastmod.Reverse ".Params.when" "ne" nil) -}}
{{- else if eq .Section "news" }}
@ -31,6 +28,13 @@
{{- else -}}
{{- $paginator = .Paginate .RegularPagesRecursive.ByLastmod.Reverse -}}
{{- end -}}
{{ if eq $paginator.PageNumber 1 }}
{{ if ne .Content "" }}
<article>
{{ .Content }}
</article>
{{ end }}
{{ end }}
{{- range first 5 $paginator.Pages -}}
<article class="articlebgcol1 borderrad25"><a href="{{- .Permalink -}}">
<div id="articletitle">
@ -40,12 +44,15 @@
<div id="articlemeta">
{{ if and (ne .Params.when "") (ne .Params.when nil) }}
<div style="margin-bottom: .4em;"><b>{{ .Params.when }}</b></div>
{{ $meta = "true" }}
{{ end }}
{{ if and (ne .Params.price "") (ne .Params.price nil) }}
{{ if eq .Params.price "free" }}
<div style="margin-bottom: .4em;">Der Eintritt ist frei.</div>
{{ $meta = "true" }}
{{ else }}
<div style="margin-bottom: .4em;">Eintritt: {{ .Params.price }}</div>
{{ $meta = "true" }}
{{ end }}
{{ end }}
</div>
@ -71,7 +78,7 @@
{{- else -}}
{{- .Summary -}}
{{- end }}
{{ if .Truncated }}
{{ if or .Truncated (eq $meta "true") }}
<div id="readmore">{{- i18n "readmore" -}}..</div>
{{ end }}
</div>

View File

@ -3,66 +3,75 @@
{{ end }}
{{ define "main" }}
{{ if ne .Content "" }}
<article>
{{ .Content }}
</article>
{{ end }}
<!-- <a href="/featured"><h2>{{ "featured" | T }}</h2></a> -->
{{ range first 3 (where (where .Site.RegularPages "Type" "in" site.Params.mainSections) ".Params.featured" "=" true) }}
<article class="articlebgcol1 borderrad25"><a href="{{- .Permalink -}}">
<div id="articletitle">
<h3>{{- .Title -}}</h3>
</div>
<div id="articlecontent">
<div id="articlemeta">
{{ if and (ne .Params.when "") (ne .Params.when nil) }}
<div style="margin-bottom: .4em;">{{ .Params.when }}</div>
{{ end }}
{{ if and (ne .Params.price "") (ne .Params.price nil) }}
{{ if eq .Params.price "free" }}
<div style="margin-bottom: .4em;">Der Eintritt ist frei.</div>
{{ else }}
<div style="margin-bottom: .4em;">Eintritt: {{ .Params.price }}</div>
{{ end }}
{{ end }}
</div>
<div id="articleinner">
<div id="articledata">
{{- if .Resources.ByType "image" -}}
{{- $pic := index (.Resources.ByType "image") 0 -}}
{{ $thumb := "" }}
{{ if eq .Content "" }}
<div class="notext">
{{- $thumb = $pic.Resize "1024x" }}
{{ else }}
<div class="text">
{{- $thumb = $pic.Resize "2048x" }}
{{ end }}
<img src="{{- $thumb.Permalink -}}"/>
</div>
{{- end }}
<div id="articletext">
{{- if .Params.description -}}
{{- .Params.description -}}
{{- else -}}
{{- .Summary -}}
{{- end }}
{{ if .Truncated }}
<div id="readmore">{{- i18n "readmore" -}}..</div>
{{ end }}
</div>
</div>
</div>
</div>
</a></article>
{{ end }}
<!-- <a href="/news"><h2>{{ "news" | T }}</h2></a> -->
{{ $s := .Site.Params }}
{{ $meta := false }}
{{- $posts := where (where .Site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" $s.mainSections }}
{{- $paginator := slice -}}
{{- $paginator = .Paginate $posts.ByLastmod.Reverse -}}
<!-- <a href="/featured"><h2>{{ "featured" | T }}</h2></a> -->
{{ if eq $paginator.PageNumber 1 }}
{{ if ne .Content "" }}
<article>
{{ .Content }}
</article>
{{ end }}
{{ $meta := false }}
{{ range first 3 (where (where .Site.RegularPages "Type" "in" site.Params.mainSections) ".Params.featured" "=" true) }}
<article class="articlebgcol1 borderrad25"><a href="{{- .Permalink -}}">
<div id="articletitle">
<h3>{{- .Title -}}</h3>
</div>
<div id="articlecontent">
<div id="articlemeta">
{{ if and (ne .Params.when "") (ne .Params.when nil) }}
<div style="margin-bottom: .4em;">{{ .Params.when }}</div>
{{ $meta = true }}
{{ end }}
{{ if and (ne .Params.price "") (ne .Params.price nil) }}
{{ if eq .Params.price "free" }}
<div style="margin-bottom: .4em;">Der Eintritt ist frei.</div>
{{ $meta = true }}
{{ else }}
<div style="margin-bottom: .4em;">Eintritt: {{ .Params.price }}</div>
{{ $meta = true }}
{{ end }}
{{ end }}
</div>
<div id="articleinner">
<div id="articledata">
{{- if .Resources.ByType "image" -}}
{{- $pic := index (.Resources.ByType "image") 0 -}}
{{ $thumb := "" }}
{{ if eq .Content "" }}
<div class="notext">
{{- $thumb = $pic.Resize "1024x" }}
{{ else }}
<div class="text">
{{- $thumb = $pic.Resize "2048x" }}
{{ end }}
<img src="{{- $thumb.Permalink -}}"/>
</div>
{{- end }}
<div id="articletext">
{{- if .Params.description -}}
{{- .Params.description -}}
{{- else -}}
{{- .Summary -}}
{{- end }}
{{ if or .Truncated (eq $meta true) }}
<div id="readmore">{{- i18n "readmore" -}}..</div>
{{ end }}
</div>
</div>
</div>
</div>
</a></article>
{{ end }}
{{ end }}
{{- range first 5 $paginator.Pages -}}
{{ if ne .Params.featured true }}
<article class="articlebgcol1 borderrad25"><a href="{{- .Permalink -}}">
@ -73,12 +82,15 @@
<div id="articlemeta">
{{ if and (ne .Params.when "") (ne .Params.when nil) }}
<div style="margin-bottom: .4em;">{{ .Params.when }}</div>
{{ $meta = true }}
{{ end }}
{{ if and (ne .Params.price "") (ne .Params.price nil) }}
{{ if eq .Params.price "free" }}
<div style="margin-bottom: .4em;">Der Eintritt ist frei.</div>
{{ $meta = true }}
{{ else }}
<div style="margin-bottom: .4em;">Eintritt: {{ .Params.price }}</div>
{{ $meta = true }}
{{ end }}
{{ end }}
</div>
@ -104,7 +116,7 @@
{{- else -}}
{{- .Summary -}}
{{- end }}
{{ if .Truncated }}
{{ if or .Truncated (eq $meta true) }}
<div id="readmore">{{- i18n "readmore" -}}..</div>
{{ end }}
</div>
@ -218,6 +230,7 @@
{{ end }}
</div>
{{ end }}
{{ define "sidebar" }}

View File

@ -12,5 +12,12 @@
<a href="{{- . | relLangURL -}}">{{- $name | humanize -}}</a>
{{ end }}
{{- end -}}
<div style="display: flex; flex-direction: column; margin-left: 1rem;">
{{ range $.Site.Home.AllTranslations }}
{{ if ne .Lang $.Lang }}
<a href="{{- .Permalink -}}">{{- .Lang -}}</a>
{{ end }}
{{ end }}
</div>
</div>
</div>