From ac5f7f7aea94b79860ceefd7f16d1ae15703f226 Mon Sep 17 00:00:00 2001 From: teldra Date: Fri, 8 Apr 2022 17:21:11 +0200 Subject: [PATCH] small fixes --- config.toml | 2 +- content/about/_index.de.md | 4 +- content/misc/generator.de.md | 57 ++++++++-------- themes/buha/layouts/_default/rss.xml | 20 +----- themes/buha/layouts/_default/taxonomy.html | 15 ++--- themes/buha/layouts/partials/debug.html | 1 + themes/buha/layouts/partials/misc/form.html | 65 ++++++++++--------- .../layouts/partials/structure/footer.html | 19 ++++-- 8 files changed, 87 insertions(+), 96 deletions(-) diff --git a/config.toml b/config.toml index 8e48b213..04c38cb4 100644 --- a/config.toml +++ b/config.toml @@ -61,7 +61,7 @@ featured = 'featured' nonprofit = true [outputs] - home = ["HTML", "RSS"] + home = ["HTML"] section = ["HTML", "RSS"] page = ["HTML"] taxonomy = ["HTML", "RSS"] diff --git a/content/about/_index.de.md b/content/about/_index.de.md index f37b3444..6fb36659 100644 --- a/content/about/_index.de.md +++ b/content/about/_index.de.md @@ -1,5 +1,5 @@ --- -title: "About" +title: "Über uns" --- Wir sind das Buntehaus, ein [soziokulturelles](/bunteshaus/soziokultur) Zentrum in Celle. Wir leben vom mitmachen und so. @@ -7,4 +7,4 @@ Lerne unsere [Projekte](/bunteshaus/) kennen und schau, was wir unter [Selbstbes Wir machen Dinge und andere Dinge. Dabei verteilen wir Essen, organisieren Partys und machen Musik. -**Hier sind Details aller Projekte:** \ No newline at end of file +**Hier sind Details aller Projekte:** diff --git a/content/misc/generator.de.md b/content/misc/generator.de.md index 2c6b9f5a..42124be8 100644 --- a/content/misc/generator.de.md +++ b/content/misc/generator.de.md @@ -4,62 +4,61 @@ date: 2021-06-22T23:00:00+02:00 description: "generator" type: "tools" tool: "generator" +divide: "Getrennt durch Komma" forms: - to: info@bunteshaus.de - placeholders: false + realnames: false fields: - - name: title + - title: title input_type: text - placeholder: Title + name: "Titel" required: true - - name: content + - title: content input_type: textarea - placeholder: Content + name: "Inhalt" required: true - - name: categories + - title: categories input_type: mc - placeholder: Kategorien + name: "Kategorien" expanded: true - new: true - - name: when + new: "Neue Kategorien" + - title: when group: events input_type: text - placeholder: Datum des Events - - name: price + name: "Datum des Events" + - title: price group: events input_type: text - placeholder: Preis - - name: contact + name: "Preis" + - title: contact group: events input_type: text - placeholder: Kontakt - - name: events + name: "Kontakt" + - title: events group: events input_type: mc - placeholder: Eventkategorien + name: "Eventkategorien" expanded: false - new: true - - name: featured + new: "Neue Events" + - title: featured group: misc input_type: checkbox - placeholder: featured - required: true - - name: about + name: "Featured" + - title: about group: misc input_type: checkbox - placeholder: about - required: true - - name: tags + name: "Über uns" + - title: tags group: misc input_type: mc - placeholder: Tags + name: "Tags" expanded: false - new: true - - name: results + new: "Neue Tags" + - title: results input_type: results - - name: submit + - title: submit input_type: submit - placeholder: Generate + name: "Erzeugen" required: true --- Hier kannst du einen neuen Artikel generieren. diff --git a/themes/buha/layouts/_default/rss.xml b/themes/buha/layouts/_default/rss.xml index e974b138..fdf2e42f 100644 --- a/themes/buha/layouts/_default/rss.xml +++ b/themes/buha/layouts/_default/rss.xml @@ -1,21 +1,7 @@ -{{- $posts := where (where .Site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" .Site.Params.searchSections -}} +{{- $pages := where (where .Site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" .Site.Params.searchSections -}} {{- $title := lower .Title -}} -{{- $pages := slice -}} -{{- $pctx := . -}} -{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} -{{- if or $.IsHome $.IsSection -}} -{{- $pages = $pctx.RegularPages -}} -{{- else -}} - {{- $what := printf ".Params.%s" $title -}} - {{- if or (eq $title "about") (eq $title "featured") -}} - {{- $pages = where $posts $what "eq" true -}} - {{- else if or (eq $title "tags") (eq $title "categories") -}} - {{- $pages = $posts -}} - {{- else if eq $title "events" -}} - {{- $pages = where $posts ".Params.when" "ne" nil -}} - {{- else -}} - {{- $pages = .Data.Pages -}} - {{- end -}} +{{- if eq $title "events" -}} + {{- $pages = where $pages ".Params.when" "ne" nil -}} {{- end -}} {{- $limit := .Site.Config.Services.RSS.Limit -}} {{- if ge $limit 1 -}} diff --git a/themes/buha/layouts/_default/taxonomy.html b/themes/buha/layouts/_default/taxonomy.html index ac6fb955..4429266e 100644 --- a/themes/buha/layouts/_default/taxonomy.html +++ b/themes/buha/layouts/_default/taxonomy.html @@ -1,18 +1,13 @@ {{- define "title" -}} - {{ $name := .Name | lower }} - {{ if ne ($name | i18n) "" }} - {{ $name = $name | i18n }} - {{ else }} - {{ if ne .Section "events" }} - {{ $name = $name | singularize }} - {{ end }} - {{ $name = $name | humanize }} + {{ $name := .Name }} + {{ if ne ($name | lower | i18n) "" }} + {{ $name = $name | lower | i18n }} {{ end }}

{{ $name }}

{{- end -}} {{- define "main" -}} - {{ if site.Params.debug }}taxonomy.html{{ end }} + {{ partial "debug" (dict "context" .) }} {{ $title := lower .Title }} {{- $paginator := slice -}} {{ $partial := "contentlayouts/list.html" }} @@ -27,6 +22,8 @@ {{ $partial = "contentlayouts/termlist.html" }} {{ else if eq $title "events" }} {{- $paginator = .Paginate (where $posts ".Params.when" "ne" nil) -}} + {{ else if eq .Section "about" }} + {{- $paginator = .Paginate (where $posts ".Params.about" "eq" true) -}} {{ else }} {{- $paginator = .Paginate .Data.Pages -}} {{ end }} diff --git a/themes/buha/layouts/partials/debug.html b/themes/buha/layouts/partials/debug.html index adcd05bb..8cb43c5b 100644 --- a/themes/buha/layouts/partials/debug.html +++ b/themes/buha/layouts/partials/debug.html @@ -3,4 +3,5 @@ Title: {{ .context.Title }}
Name: {{ .context.Name }}
context: {{ .context }}
filename: {{ .filename }}
+section: {{ .context.Section }}
{{ end }} diff --git a/themes/buha/layouts/partials/misc/form.html b/themes/buha/layouts/partials/misc/form.html index 91d8d49c..ee3ac831 100644 --- a/themes/buha/layouts/partials/misc/form.html +++ b/themes/buha/layouts/partials/misc/form.html @@ -1,13 +1,15 @@ {{ $pageform := (index .context.Page.Params.forms .form) }} {{ $group := slice }} - +{{ $divide := .context.Page.Params.divide }}
{{ range $pageform.fields }} - - {{ if .required }}{{ .Scratch.Set "requiredstar" "" }}{{ else }}{{ .Scratch.Set "requiredstar" " (optioneel)" }}{{ end }} - {{ if .required }}{{ .Scratch.Set "requiredtext" "required" }}{{ else }}{{ .Scratch.Set "requiredtext" "" }}{{ end }} + {{ $title := .title }} + {{ $name := $title }} + {{ if .name }} + {{ $name = .name }} + {{ end }} {{ if and .group (not (in $group .group))}}
@@ -15,29 +17,28 @@ {{ partial "misc/expand" (dict "name" (printf "%sgroup" .group)) }}
{{ $group = $group | append .group }} - {{ end }} {{ if eq .input_type "title" }} -

{{ .placeholder }}

+

{{- $name -}}{{- if .required -}}{{- " *" -}}{{- end -}}

{{ else if eq .input_type "textarea" }}
- - + +
{{ else if eq .input_type "radio" }}
- +
{{ else if eq .input_type "checkbox" }}
- +
{{ else if eq .input_type "results" }} {{ else if eq .input_type "submit" }}
- +
@@ -48,11 +49,11 @@ {{ else if eq .input_type "mc" }} - {{ $in0 := .name }} + {{ $in0 := .title }} {{- $finale := slice -}} {{ $pages := where site.RegularPages "Type" "in" site.Params.searchSections }} - {{ if eq .name "tags" }} + {{ if eq .title "tags" }} {{ range $pages }} {{- if .Params.tags -}} {{- $finale = $finale | append .Params.tags -}} @@ -69,8 +70,8 @@
- {{ .placeholder }} - {{ if ne .expanded true }}{{ partial "misc/expand" (dict "name" (printf "%scat" $in0)) }}{{ end }} + {{ .name }} + {{ if ne .expanded true }}{{ partial "misc/expand" (dict "name" (printf "%scat" $in0)) }}{{ end }}{{- if .required -}}{{- " *" -}}{{- end -}}
@@ -84,9 +85,9 @@ {{ end }} - {{ if eq .new true }} - - + {{ if .new }} + + {{ end }}
@@ -103,34 +104,34 @@ {{ else }} - {{ if eq .name "name" }} + {{ if eq .title "name" }}
- - + +
- - + +
- {{ else if eq .name "address" }} + {{ else if eq .title "address" }}
- - + +
- - + +
- - + +
{{ else }}
- - + +
{{ end }} diff --git a/themes/buha/layouts/partials/structure/footer.html b/themes/buha/layouts/partials/structure/footer.html index 1ad2999a..f9cf95b4 100644 --- a/themes/buha/layouts/partials/structure/footer.html +++ b/themes/buha/layouts/partials/structure/footer.html @@ -42,12 +42,19 @@ {{ end }} {{- $links | strings.FirstUpper -}}

{{- end -}} - {{- with .OutputFormats.Get "rss" -}} - {{- if .Permalink -}} - {{- printf `` .Permalink | safeHTML -}} - {{- end -}} - RSS

- {{- end -}} + {{- if not (or (eq .Section "featured") (eq .Section "about")) -}} + {{ if .IsHome }} + {{- printf `` "/news/index.xml" | safeHTML -}} + RSS

+ {{ else }} + {{- with .OutputFormats.Get "rss" -}} + {{- if .Permalink -}} + {{- printf `` .Permalink | safeHTML -}} + {{- end -}} + RSS

+ {{- end -}} + {{ end }} + {{ end }} Sourcecode