small fixes

This commit is contained in:
teldra 2022-04-04 12:44:19 +02:00
parent e2fbbddb0c
commit afe0a15b58
10 changed files with 21 additions and 20 deletions

View File

@ -11,7 +11,6 @@ copyright = "bunteshaus.de"
[taxonomies] [taxonomies]
category = 'categories' category = 'categories'
tag = 'tags' tag = 'tags'
news = 'news'
events = 'events' events = 'events'
about = 'about' about = 'about'
featured = 'featured' featured = 'featured'
@ -29,8 +28,8 @@ featured = 'featured'
# do you want an imprint? # do you want an imprint?
imprint = true imprint = true
mainSections = ['about','news','events']
mainMenu = ['about'] mainMenu = ['about']
searchSections = ['news']
# data for your imprint and contact page # data for your imprint and contact page
[params.imprintdata] [params.imprintdata]

View File

@ -232,6 +232,11 @@ input, textarea {
border-radius: 15px; border-radius: 15px;
} }
.minmax {
width: auto;
max-width: auto;
}
/* Extra small devices (phones, 600px and down) */ /* Extra small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {...} @media only screen and (max-width: 600px) {...}
@ -294,7 +299,10 @@ input, textarea {
#article_footer { #article_footer {
margin-left: 2rem; margin-left: 2rem;
} }
.minmax {
width: calc(100vw - 5rem);
max-width: 800px;
}
} }
/* Medium devices (landscape tablets, 768px and up) */ /* Medium devices (landscape tablets, 768px and up) */

View File

@ -9,7 +9,7 @@
{{ define "main" }} {{ define "main" }}
<article> <article>
{{ $prev := 3000}} {{ $prev := 3000}}
{{range where .Site.RegularPages "Type" "in" site.Params.mainSections }} {{range where .Site.RegularPages "Type" "in" site.Params.searchSections }}
{{ $date := .Date }} {{ $date := .Date }}
{{ if gt $prev ($date.Format "2006") }} {{ if gt $prev ($date.Format "2006") }}
<h2>{{ $date.Format "2006" }}</h2> <h2>{{ $date.Format "2006" }}</h2>

View File

@ -17,9 +17,9 @@
{{- $paginator := slice -}} {{- $paginator := slice -}}
{{ $what := printf ".Params.%s" $title }} {{ $what := printf ".Params.%s" $title }}
{{ if or (eq $title "about") (eq $title "featured") }} {{ if or (eq $title "about") (eq $title "featured") }}
{{- $paginator = .Paginate (where (where .Site.RegularPages "Type" "in" site.Params.mainSections) $what "eq" true) -}} {{- $paginator = .Paginate (where (where .Site.RegularPages "Type" "in" site.Params.searchSections) $what "eq" true) -}}
{{ else if eq $title "events" }} {{ else if eq $title "events" }}
{{- $paginator = .Paginate (where (where .Site.RegularPages "Type" "in" site.Params.mainSections) ".Params.when" "ne" nil) -}} {{- $paginator = .Paginate (where (where .Site.RegularPages "Type" "in" site.Params.searchSections) ".Params.when" "ne" nil) -}}
{{ else if eq $title "news" }} {{ else if eq $title "news" }}
{{- $paginator = .Paginate .Site.RegularPages -}} {{- $paginator = .Paginate .Site.RegularPages -}}
{{ else }} {{ else }}

View File

@ -8,7 +8,7 @@
<!-- <a href="/news"><h2>{{ "news" | T }}</h2></a> --> <!-- <a href="/news"><h2>{{ "news" | T }}</h2></a> -->
{{ $s := .Site.Params }} {{ $s := .Site.Params }}
{{ $meta := false }} {{ $meta := false }}
{{- $posts := where (where .Site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" $s.mainSections }} {{- $posts := where (where .Site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" $s.searchSections }}
{{- $paginator := slice -}} {{- $paginator := slice -}}
{{- $paginator = .Paginate $posts.ByDate.Reverse -}} {{- $paginator = .Paginate $posts.ByDate.Reverse -}}
<!-- <a href="/featured"><h2>{{ "featured" | T }}</h2></a> --> <!-- <a href="/featured"><h2>{{ "featured" | T }}</h2></a> -->
@ -18,7 +18,7 @@
{{ .Content }} {{ .Content }}
</article> </article>
{{ end }} {{ end }}
{{ range first 3 (where (where .Site.RegularPages "Type" "in" site.Params.mainSections) ".Params.featured" "=" true) }} {{ range first 3 (where (where .Site.RegularPages "Type" "in" site.Params.searchSections) ".Params.featured" "=" true) }}
{{ $article_age := sub now.Unix (int .Date.Unix) }} {{ $article_age := sub now.Unix (int .Date.Unix) }}
{{ if lt $article_age "1209600" }} {{ if lt $article_age "1209600" }}
{{ partial "structure/list_article.html" . }} {{ partial "structure/list_article.html" . }}
@ -31,7 +31,7 @@
{{ partial "structure/list_article.html" . }} {{ partial "structure/list_article.html" . }}
{{ end }} {{ end }}
{{- end }} {{- end }}
<div id="pagination_outer" style="display: flex; justify-content: flex-end;"> <div id="pagination_outer" style="display: flex; justify-content: center;">
{{ partial "structure/paginator" (dict "paginator" $paginator) }} {{ partial "structure/paginator" (dict "paginator" $paginator) }}
</div> </div>

View File

@ -2,7 +2,7 @@
<link rel="stylesheet" href="/css/visibleIf.css" type="text/css" /> <link rel="stylesheet" href="/css/visibleIf.css" type="text/css" />
{{ end }} {{ end }}
<h1>Artikelgenerator</h1> <h1>Artikelgenerator</h1>
<article style="width: calc(100vw - 5rem); max-width: 800px;"> <article class="minmax">
<div style="flex-direction: row;"> <div style="flex-direction: row;">
{{ .Content }} {{ .Content }}
</div > </div >

View File

@ -9,7 +9,7 @@
{{ $openname := printf "open%s" $in0 }} {{ $openname := printf "open%s" $in0 }}
{{- $finale := slice -}} {{- $finale := slice -}}
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} {{ $pages := where site.RegularPages "Type" "in" site.Params.searchSections }}
{{ if eq .name "tags" }} {{ if eq .name "tags" }}
{{ range $pages }} {{ range $pages }}
{{- if .Params.tags -}} {{- if .Params.tags -}}

View File

@ -1,4 +1,4 @@
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} {{ $pages := where site.RegularPages "Type" "in" site.Params.searchSections }}
{{- $tags := slice -}} {{- $tags := slice -}}
{{ range $pages }} {{ range $pages }}
{{- if .Params.tags -}} {{- if .Params.tags -}}

View File

@ -3,18 +3,12 @@
<img src="/images/logo.svg" alt="SVG mit img laden" width="auto" height="100%" > <img src="/images/logo.svg" alt="SVG mit img laden" width="auto" height="100%" >
</a> </a>
<div id="menu"> <div id="menu">
{{ $visible := site.Params.mainMenu }} {{- range site.Params.mainMenu -}}
{{- range site.Params.mainSections -}}
{{ $section := . }}
{{ range $visible }}
{{ if eq $section . }}
{{ $name := . | T }} {{ $name := . | T }}
{{ if eq $name "" }} {{ if eq $name "" }}
{{ $name = . }} {{ $name = . }}
{{ end }} {{ end }}
<a href="{{- . | relLangURL -}}">{{- $name | humanize -}}</a> <a href="{{- . | relLangURL -}}">{{- $name | humanize -}}</a>
{{ end }}
{{ end }}
{{- end -}} {{- end -}}
</div> </div>

View File

@ -1,5 +1,5 @@
{{ $paginator := .paginator}} {{ $paginator := .paginator}}
<div id="pagination_outer" style="display: flex; justify-content: flex-end;"> <div id="pagination_outer" style="display: flex; justify-content: center;">
<div id="pagination"> <div id="pagination">
<!-- Number of links either side of the current page. --> <!-- Number of links either side of the current page. -->
{{ $adjacent_links := 2 }} {{ $adjacent_links := 2 }}