Merge branch 'main' into dev
All checks were successful
Website Dev / Entwicklungsumgebung (push) Successful in 13s

This commit is contained in:
2024-09-16 21:47:03 +02:00
55 changed files with 319 additions and 748 deletions

View File

@ -1,17 +1,7 @@
{{ define "main" }}
<section class="section">
<div class="container">
{{ partial "filter-controls" . }}
<div class="filter-container row">
{{ range .Data.Pages }}
<div data-groups="{{ .Params.category | urlize }}" class="col-lg-4 col-sm-6 filter-item">
{{ partial "ganztag" . }}
</div>
{{ end }}
<div class="filter-sizer col-1"></div>
</div>
</div>
</section>
<main data-pagefind-body>
{{ partial "tile-modals" . }}
</main>
{{ end }}

View File

@ -1,35 +0,0 @@
{{ define "main" }}
<main data-pagefind-body>
<section class="section">
<div class="container">
<img src="{{ .Params.image | relURL }}" class="img-fluid w-100 mb-4">
<h2 class="mb-4">{{ .Title }}</h2>
<div class="row mb-4">
{{ partial "icon-element" (dict "size" 3 "icon" "calendar-today-outline" "title" "Zeit" "content" .Params.schedule) }}
{{ partial "icon-element" (dict "size" 3 "icon" "timer-sand" "title" "Dauer" "content" .Params.duration) }}
{{ partial "icon-element" (dict "size" 3 "icon" "crowd" "title" "Klassen" "content" .Params.class) }}
{{ partial "icon-element" (dict "size" 3 "icon" "map-marker-radius-outline" "title" "Raum" "content" .Params.room) }}
</div>
<hr class="mb-4">
<div class="content text-justify">
{{ .Content }}
</div>
</div>
</section>
<section class="section pt-0" data-pagefind-ignore="all">
<div class="container">
<h2 class="mb-4">Andere Arbeitsgemeinschaften</h2>
<div class="row">
{{ range partial "data/related" . }}
<div class="col-lg-4 col-sm-6">
{{ partial "ganztag" . }}
</div>
{{ end }}
</div>
</div>
</section>
</main>
{{ end }}

View File

@ -179,10 +179,17 @@
</div>
</div>
<div class="row justify-content-center">
{{ range first (int $data.homepage.ganztagsangebote.number) (where .Site.RegularPages "Type" "ganztagsangebote" | shuffle)}}
<div class="col-lg-4 col-sm-6">
{{ partial "ganztag" . }}
</div>
{{ with .Site.GetPage "/ganztagsangebote/_index.md" }}
{{ range first (int $data.homepage.ganztagsangebote.number) (.Params.tiles | shuffle) }}
<div class="col-lg-4 col-sm-6">
<div class="card border-primary rounded-0 hover-shadow mb-4">
<img class="card-img-top rounded-0" src="{{ .image | relURL }}">
<div class="card-body">
<h4 class="card-title text-truncate">{{ .title }}</h4>
</div>
</div>
</div>
{{ end }}
{{ end }}
</div>
</div>

View File

@ -0,0 +1,47 @@
{{- $imgs := slice }}
{{- $imgParams := slice .Params.image | append .Params.images }}
{{- $resources := .Resources.ByType "image" -}}
{{/* Find featured image resources if the images parameter is empty. */}}
{{- if or (not $imgParams) (eq ($imgParams | len) 0) }}
{{- $featured := $resources.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $resources.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured }}
{{- $imgs = $imgs | append (dict
"Image" .
"RelPermalink" .RelPermalink
"Permalink" .Permalink) }}
{{- end }}
{{- end }}
{{/* Use the first one of site images as the fallback. */}}
{{- if and (not $imgParams) (not $imgs) }}
{{- with site.Params.images }}
{{- $imgParams = first 1 . }}
{{- end }}
{{- end }}
{{/* Parse page's images parameter. */}}
{{- range $imgParams }}
{{- $img := . }}
{{- $url := urls.Parse $img }}
{{- if eq $url.Scheme "" }}
{{/* Internal image. */}}
{{- with $resources.GetMatch $img -}}
{{/* Image resource. */}}
{{- $imgs = $imgs | append (dict
"Image" .
"RelPermalink" .RelPermalink
"Permalink" .Permalink) }}
{{- else }}
{{- $imgs = $imgs | append (dict
"RelPermalink" (relURL $img)
"Permalink" (absURL $img)
) }}
{{- end }}
{{- else }}
{{/* External image */}}
{{- $imgs = $imgs | append (dict
"RelPermalink" $img
"Permalink" $img
) }}
{{- end }}
{{- end }}
{{- return $imgs }}

View File

@ -1,8 +1,18 @@
<ul class="list-inline text-center filter-controls mb-4">
<li class="list-inline-item m-3 text-uppercase active" data-filter="all">Alle</li>
{{ $categories := slice }}
{{ range .Data.Pages }}
{{ $categories = $categories | append .Params.category }}
{{ if ne (len .Data.Pages) 0 }}
{{ range .Data.Pages }}
{{ $categories = $categories | append .Params.category }}
{{ end }}
{{ else }}
{{ range .Params.tiles }}
{{ with .category }}
{{ $categories = $categories | append . }}
{{ end }}
{{ end }}
{{ end }}
{{ if ne (len $categories) 0 }}
<li class="list-inline-item m-3 text-uppercase active" data-filter="all">Alle</li>
{{ end }}
{{ range ( $categories | uniq ) }}
<li class="list-inline-item m-3 text-uppercase" data-filter="{{ . | urlize }}">{{ . | humanize }}</li>

View File

@ -29,8 +29,10 @@
<div class="col-lg-3 col-sm-6 mb-4 mb-md-0 text-sm-start text-center">
<h4 class="text-white mb-4 text-uppercase">Ganztagsangebote</h4>
<ul class="list-unstyled">
{{ range first 5 (where .Site.RegularPages "Type" "ganztagsangebote" | shuffle)}}
<li class="mb-3"><a class="text-white text-opacity-50" href="{{ .Permalink }}">{{ .Title }}</a></li>
{{ with .Site.GetPage "/ganztagsangebote/_index.md" }}
{{ range first 5 (.Params.tiles | shuffle) }}
<li class="mb-3"><a class="text-white text-opacity-50" href="/ganztagsangebote">{{ .title }}</a></li>
{{ end }}
{{ end }}
</ul>
</div>

View File

@ -51,6 +51,6 @@
};
</script>
{{ partial "opengraph" . }}
{{ partial "twitter" . }}
{{ template "_internal/opengraph.html" . }}
{{ template "_internal/twitter_cards.html" . }}
</head>

View File

@ -1,47 +0,0 @@
<meta property="og:title" content="{{ .Title }}" />
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
<meta property="og:url" content="{{ .Permalink }}" />
{{- with $.Params.images -}}
{{- range first 6 . }}<meta property="og:image" data-pagefind-meta="image[content]" content="{{ . | absURL }}" />{{ end -}}
{{- else -}}
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured -}}
<meta property="og:image" data-pagefind-meta="image[content]" content="{{ $featured.Permalink }}"/>
{{- else -}}
{{- with $.Params.image -}}
<meta property="og:image" data-pagefind-meta="image[content]" content="{{ . | absURL }}"/>
{{- else -}}
{{- with $.Site.Params.images }}<meta property="og:image" data-pagefind-meta="image[content]" content="{{ index . 0 | absURL }}"/>{{ end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if .IsPage }}
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
<meta property="article:section" content="{{ .Section }}" />
{{ with .PublishDate }}<meta property="article:published_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
{{ with .Lastmod }}<meta property="article:modified_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
{{- end -}}
{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}
{{- with .Params.locale }}<meta property="og:locale" content="{{ . }}" />{{ end }}
{{- with .Site.Params.title }}<meta property="og:site_name" content="{{ . }}" />{{ end }}
{{- with .Params.videos }}{{- range . }}
<meta property="og:video" content="{{ . | absURL }}" />
{{ end }}{{ end }}
{{- /* If it is part of a series, link to related articles */}}
{{- $permalink := .Permalink }}
{{- $siteSeries := .Site.Taxonomies.series }}
{{- if $siteSeries }}
{{ with .Params.series }}{{- range $name := . }}
{{- $series := index $siteSeries ($name | urlize) }}
{{- range $page := first 6 $series.Pages }}
{{- if ne $page.Permalink $permalink }}<meta property="og:see_also" content="{{ $page.Permalink }}" />{{ end }}
{{- end }}
{{ end }}{{ end }}
{{- end }}

View File

@ -5,14 +5,19 @@
</div>
</div>
<div class="container">
<div class="row justify-content-center">
{{ partial "filter-controls" . }}
<div class="filter-container row justify-content-center">
{{ range .Params.tiles }}
{{ partial "modal" . }}
<div class="col-lg-4 col-sm-6">
<div class="col-lg-4 col-sm-6 filter-item" data-groups="{{ .category | urlize }}">
<div class="card border-primary rounded-0 hover-shadow mb-2">
<div class="container fb-tile-color" style="background-color:{{ .bg_color }};">
<span class="fb-tile-icon" style="color: {{ .font_color }}">{{ partial "mdi" .icon }}</span>
</div>
{{ if and .image (ne .image "/media/image.webp") }}
<img class="card-img-top rounded-0" src="{{ .image | relURL }}">
{{ else }}
<div class="container fb-tile-color" style="background-color:{{ .bg_color }};">
<span class="fb-tile-icon" style="color: {{ .font_color }}">{{ partial "mdi" .icon }}</span>
</div>
{{ end }}
<div class="card-body d-flex flex-column">
<h4 class="card-title text-truncate">{{ .title }}</h4>
{{ if .external.enable }}
@ -25,5 +30,6 @@
</div>
{{ end }}
</div>
<div class="filter-sizer col-1"></div>
</div>
</section>

View File

@ -1,29 +0,0 @@
{{- with $.Params.images -}}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="{{ index . 0 | absURL }}"/>
{{ else -}}
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured -}}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="{{ $featured.Permalink }}"/>
{{- else -}}
{{- with $.Params.image -}}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="{{ . | absURL }}"/>
{{- else -}}
{{- with $.Site.Params.images -}}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="{{ index . 0 | absURL }}"/>
{{ else -}}
<meta name="twitter:card" content="summary"/>
{{- end -}}
{{- end -}}
{{- end -}}
{{- end }}
<meta name="twitter:title" content="{{ .Title }}"/>
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/>
{{ with .Site.Social.twitter -}}
<meta name="twitter:site" content="@{{ . }}"/>
{{ end -}}

View File

@ -27,7 +27,7 @@
<div class="card d-flex flex-row flex-wrap-reverse">
<div class="flex-grow card-body min-w-0">
<a href="{{ .Permalink }}"><h3 class="card-title">{{ .Title }}</h3></a>
{{ range (getJSON "static/data/abiturdurchschnitte.json").abiturdurchschnitte }}
{{ range (resources.Get "data/abiturdurchschnitte.json" | transform.Unmarshal).abiturdurchschnitte }}
{{ if eq (string .jahr) $.Title }}<a href="/chronikseiten/abiturdurchschnitte" class="h4 card-text">Abiturdurchschnitt: {{ .schnitt }}</a>{{ end }}
{{ end }}
</div>