small fixes

This commit is contained in:
teldra 2022-06-22 16:09:01 +02:00
parent 942db97cd6
commit ddb307bbdf
13 changed files with 174 additions and 31 deletions

View File

@ -35,7 +35,7 @@ sourcecode = true
mainMenu = ['about','news','events']
# in which section search for posts?
searchSections = ['news']
searchSections = ['posts']
# category, which stands for your own things
ownCategory = "Buha"

View File

@ -1,5 +1,5 @@
---
title: "Wie soll das Cafe heißen? Namenssuche..."
lastmod: 1996-03-26T14:00:00+02:00
categories: ["Buha"]
news: ["Buha"]
---

View File

@ -1,6 +1,6 @@
---
title: "Programmflyer April / Mai "
lastmod: 1997-04-01T14:00:00+02:00
categories: ["Buha"]
news: ["Buha"]
tags: ["Programm"]
---

View File

@ -1,6 +1,6 @@
---
title: "Buntes Haus Außenansicht - Jahr 2000"
lastmod: 2000-06-01T14:00:00+02:00
categories: ["Buha"]
news: ["Buha"]
tags: ["Buntes Haus","Außenansicht","Geschichte des Bunten Hauses","Buntes Haus früher"]
---

View File

@ -1,7 +1,7 @@
---
title: "Buntes Haus Außenansicht - Jahr 2002"
lastmod: 2002-07-01T14:00:00+02:00
categories: ["Buha"]
news: ["Buha"]
tags: ["Außenansicht","Buntes Haus","Buntes Haus früher"]
---

View File

@ -1,5 +1,5 @@
---
title: "INK - Ein Buntes Haus für eine tote Stadt"
categories: ["Buha"]
news: ["Buha"]
lastmod: 1994-03-04T14:00:00+02:00
---

View File

@ -1,7 +1,7 @@
---
title: "Matrix Space"
date: "2022-04-11T20:37:00+02:00"
categories: ["Buha"]
news: ["Buha"]
featured: true
---
Wir betreiben einen Space im Matrix Netzwerk.

View File

@ -4,7 +4,7 @@ date: 1993-09-04T19:00:00+02:00
lastmod: 1993-09-04T19:00:00+02:00
when: "jeden Monat am ersten und dritten Donnerstag, 19:00Uhr"
about: true
categories: ["Buha"]
news: ["Buha"]
recurrent: true
tags: [ "Plenum" ]
covid: "3g"

View File

@ -0,0 +1,12 @@
{{ define "content" }}
<div>
{{ if eq .Kind "taxonomy" }}
{{ range .Pages }}
<a href="{{ .Page.Permalink }}" class="underline" style="margin-right: 1rem;">{{ .Page.Title }}</a>
{{ end }}
{{ else }}
{{- $pages := .Data.Pages -}}
{{ partial "news/gen_list" (dict "context" . "pages" $pages "content" .Content "type" .Type "paginate" true) }}
{{ end }}
</div>
{{ end }}

View File

@ -6,11 +6,11 @@
{{ define "content" }}
{{- $pages := where .Site.RegularPages "Permalink" "!=" .Permalink -}}
{{- $pages := where .Site.RegularPages "Section" "in" .Site.Params.searchSections -}}
{{- $paginator := "" -}}
{{- $partial := "gen_list" -}}
{{- $paginate := true -}}
{{- $pages = (where $pages ".Params.about" "=" true) -}}
{{- $pages = where $pages ".Params.about" "=" true -}}
{{ $partial = string (printf "news/%s" $partial) }}
{{ partial $partial (dict "context" . "pages" $pages "content" .Content "type" .Type "paginate" $paginate) }}

View File

@ -5,18 +5,12 @@
{{ end }}
{{ define "content" }}
{{- $pages := where .Site.RegularPages "Permalink" "!=" .Permalink -}}
{{- $paginator := "" -}}
{{- $partial := "gen_list" -}}
{{- $paginate := true -}}
{{- $pages := where .Site.RegularPages "Section" "in" .Site.Params.searchSections -}}
{{- $pages = where $pages ".Params.when" "ne" nil -}}
{{ $partial = string (printf "news/%s" $partial) }}
{{ partial $partial (dict "context" . "pages" $pages "content" .Content "type" .Type "paginate" $paginate) }}
{{ partial "news/gen_list" (dict "context" . "pages" $pages "content" .Content "type" .Type "paginate" true) }}
{{ end }}
{{ define "sidebar" }}
{{ if gt .Site.Taxonomies.events 0 }}
<aside class="sidebar">
<h3 class="align_menu">{{ if i18n "categories" }}{{ i18n "categories" }}{{ else }}{{ "Categories" }}{{ end }}</h3>
<div class="align_menu"><a href="{{ "recurrent/" | relLangURL}}">{{ i18n "recurrent" }}</a></div>
@ -30,5 +24,4 @@
<div class="align_menu"><a href="{{ "events/" | relLangURL}}{{ $orig | urlize }}">{{ $taxonomyname }}</a></div>
{{ end }}
</aside>
{{ end }}
{{ end }}

View File

@ -5,21 +5,13 @@
{{ end }}
{{ define "content" }}
{{- $pages := where .Site.RegularPages "Permalink" "!=" .Permalink -}}
{{- $paginator := "" -}}
{{- $partial := "gen_list" -}}
{{- $paginate := true -}}
{{- $pages = where $pages ".Params.news" "ne" nil -}}
{{ $partial = string (printf "news/%s" $partial) }}
{{ partial $partial (dict "context" . "pages" $pages "content" .Content "type" .Type "paginate" $paginate) }}
{{- $pages := where .Site.RegularPages "Section" "in" .Site.Params.searchSections -}}
{{ partial "news/gen_list" (dict "context" . "pages" $pages "content" .Content "type" .Type "paginate" true) }}
{{ end }}
{{ define "sidebar" }}
{{ if gt .Site.Taxonomies.news 0 }}
<aside class="sidebar">
<h3 class="align_menu">{{ if i18n "categories" }}{{ i18n "categories" }}{{ else }}{{ "Categories" }}{{ end }}</h3>
<div class="align_menu"><a href="{{ "recurrent/" | relLangURL}}">{{ i18n "recurrent" }}</a></div>
{{ range $taxonomyname, $taxonomy := .Site.Taxonomies.news }}
{{ $orig := $taxonomyname }}
{{ if ne (i18n $taxonomyname) "" }}
@ -27,8 +19,7 @@
{{ else }}
{{ $taxonomyname = $taxonomyname | humanize }}
{{ end }}
<div class="align_menu"><a href="{{ "events/" | relLangURL}}{{ $orig | urlize }}">{{ $taxonomyname }}</a></div>
<div class="align_menu"><a href="{{ "news/" | relLangURL}}{{ $orig | urlize }}">{{ $taxonomyname }}</a></div>
{{ end }}
</aside>
{{ end }}
{{ end }}

View File

@ -0,0 +1,147 @@
{{ define "content" }}
<article>
{{ $metas := dict "when" .Params.when "price" .Params.price "contact_mail" .Params.contact_mail "covid" .Params.covid "insta" .Params.insta }}
{{ $banner := slice }}
{{ $image := slice }}
{{ $thumb := "" }}
{{ if .Resources.GetMatch "banner*" }}
{{ $banner = slice (.Resources.GetMatch "banner*") }}
{{ end }}
{{ if .Resources.ByType "image" }}
{{ $image = .Resources.ByType "image" }}
{{ end }}
{{ $image = (index (complement $banner $image) 0) }}
{{ if $banner }}
{{ $image = (index $banner 0) }}
{{ end }}
{{ $image = .Resources.GetMatch (string $image) }}
{{ if ne $image nil }}
{{ $thumb1 := $image.Fill "1280x480 smart"}}
{{ $thumb = $image}}
{{ end }}
{{ partial "snippets/article_metadata" $metas }}
{{- if .Description -}}
<p>{{ .Description }}</p>
{{ end }}
{{ $count_href := .TableOfContents | strings.Count "href" }}
{{ if ge $count_href 4 }}
<details open>
<summary class="toc-head">Inhaltsverzeichnis</summary>
<div class="toc">
{{ .TableOfContents }}
</div>
</details>
{{ end }}
{{ $content := .Content }}
{{ if or .Content (.Resources.ByType "image")}}
<div class="article_content">
{{- if .Content -}}
{{- $content -}}
{{ end }}
{{ if .Resources.ByType "image" }}
{{ range .Resources.ByType "image" }}
{{ $picname := . }}
{{ if not (or (in $content $picname ) (hasPrefix $picname "banner") )}}
<a href="{{- $picname.Permalink -}}" class="article_image no_underline">
<img loading="lazy"
src="{{ .Permalink }}"
alt="{{ . }}"
{{ with .Title}} title="{{ . }}"{{ end }}
width={{ $picname.Width }}
height="{{ $picname.Height }}" /><br>
</a>
{{ end }}
{{ end }}
{{ end }}
</div>
{{ end }}
</article>
{{ end }}
{{ define "sidebar" }}
{{ if ne .Type "tools" }}
<aside class="sidebar">
{{ if or .Params.categories .Params.events }}
<h3 class="align_menu">{{ if i18n "categories" }}{{ i18n "categories" }}{{ else }}{{ "Categories" }}{{ end }}</h3>
{{ end }}
{{ if .Params.categories }}
{{ range .Params.categories }}
<div class="align_menu"><a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></div>
{{ end }}
{{ end }}
{{ if .Params.events }}
{{ range .Params.events }}
<div class="align_menu"><a href="{{ "/events/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></div>
{{ end }}
{{ end }}
{{ if .Params.tags }}
<h3 class="align_menu"><a href="{{ "/tags/" | relLangURL }}">{{ if i18n "tags" }}{{ i18n "tags" }}{{ else }}{{ "Tags" }}{{ end }}</a></h3>
{{ range .Params.tags }}
<div class="align_menu"><a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></div>
{{ end }}
{{ end }}
{{ $related := .Site.RegularPages.RelatedIndices . "tags" | first 5 }}
{{ if $related }}
<h3 class="align_menu">Related</h3>
{{ range $related }}
<div class="align_menu"><a href="{{ .Permalink }}">{{ .Title }}</a></div>
{{ end }}
{{ end }}
</aside>
{{ end }}
{{ end }}
{{ define "inner_footer" }}
{{ if and (eq .Kind "page") (or (eq .Section "news") (eq .Section "events") (eq .Section "about")) }}
<div class="article_footer">
{{ with .Params.foundations }}
<div class="bold">Träger der Veranstaltung:</div>
<div class="foundations_items">
{{ range . }}
{{ $l := . }}
{{ $url := "" }}
{{ if isset site.Params.foundations $l }}
{{ $url = index site.Params.foundations $l }}
{{ end }}
{{- $res_im := resources.GetMatch (printf "/images/foundations/%s*" $l ) -}}
{{ if $res_im }}
<div class="foundations_item">
{{ if $url }}<a href="{{ $url | safeHTML }}">{{ end }}<img src="{{- $res_im.Permalink -}}" class="borderrad4px article_footer_item1" /> {{ if $url }}</a>{{ end }}
</div>
{{ else }}
{{ if eq hugo.Environment "development" }}
<div class="foundations_item">
assets/images/foundations/{{- $l -}} .* missing
</div>
{{ else }}
picture missing.
{{ end }}
{{ end }}
{{ end }}
</div>
{{ end }}
<div class="mod_times">
<div class="mod_times_item">
<div class="bold">{{ if i18n "created" }}{{ i18n "created" }}{{ else }}{{ "Created" }}{{ end }}: </div>
<div>{{ .Date | time.Format ":date_full" }}</div>
</div>
{{ if ne .Date .Lastmod }}
<div class="mod_times_item">
<div class="bold">{{ if i18n "lastmod" }}{{ i18n "lastmod" }}{{ else }}{{ "Last modification" }}{{ end }}: </div>
<div>{{ .Lastmod | time.Format ":date_full" }}</div>
</div>
{{ end }}
</div>
</div>
{{ end }}
{{ end }}