small fixes

This commit is contained in:
teldra 2022-04-08 17:21:11 +02:00
parent 2b5708d402
commit ac5f7f7aea
8 changed files with 87 additions and 96 deletions

View File

@ -61,7 +61,7 @@ featured = 'featured'
nonprofit = true nonprofit = true
[outputs] [outputs]
home = ["HTML", "RSS"] home = ["HTML"]
section = ["HTML", "RSS"] section = ["HTML", "RSS"]
page = ["HTML"] page = ["HTML"]
taxonomy = ["HTML", "RSS"] taxonomy = ["HTML", "RSS"]

View File

@ -1,5 +1,5 @@
--- ---
title: "About" title: "Über uns"
--- ---
Wir sind das Buntehaus, ein [soziokulturelles](/bunteshaus/soziokultur) Zentrum in Celle. Wir sind das Buntehaus, ein [soziokulturelles](/bunteshaus/soziokultur) Zentrum in Celle.
Wir leben vom mitmachen und so. 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. Wir machen Dinge und andere Dinge. Dabei verteilen wir Essen, organisieren Partys und machen Musik.
**Hier sind Details aller Projekte:** **Hier sind Details aller Projekte:**

View File

@ -4,62 +4,61 @@ date: 2021-06-22T23:00:00+02:00
description: "generator" description: "generator"
type: "tools" type: "tools"
tool: "generator" tool: "generator"
divide: "Getrennt durch Komma"
forms: forms:
- to: info@bunteshaus.de - to: info@bunteshaus.de
placeholders: false realnames: false
fields: fields:
- name: title - title: title
input_type: text input_type: text
placeholder: Title name: "Titel"
required: true required: true
- name: content - title: content
input_type: textarea input_type: textarea
placeholder: Content name: "Inhalt"
required: true required: true
- name: categories - title: categories
input_type: mc input_type: mc
placeholder: Kategorien name: "Kategorien"
expanded: true expanded: true
new: true new: "Neue Kategorien"
- name: when - title: when
group: events group: events
input_type: text input_type: text
placeholder: Datum des Events name: "Datum des Events"
- name: price - title: price
group: events group: events
input_type: text input_type: text
placeholder: Preis name: "Preis"
- name: contact - title: contact
group: events group: events
input_type: text input_type: text
placeholder: Kontakt name: "Kontakt"
- name: events - title: events
group: events group: events
input_type: mc input_type: mc
placeholder: Eventkategorien name: "Eventkategorien"
expanded: false expanded: false
new: true new: "Neue Events"
- name: featured - title: featured
group: misc group: misc
input_type: checkbox input_type: checkbox
placeholder: featured name: "Featured"
required: true - title: about
- name: about
group: misc group: misc
input_type: checkbox input_type: checkbox
placeholder: about name: "Über uns"
required: true - title: tags
- name: tags
group: misc group: misc
input_type: mc input_type: mc
placeholder: Tags name: "Tags"
expanded: false expanded: false
new: true new: "Neue Tags"
- name: results - title: results
input_type: results input_type: results
- name: submit - title: submit
input_type: submit input_type: submit
placeholder: Generate name: "Erzeugen"
required: true required: true
--- ---
Hier kannst du einen neuen Artikel generieren. Hier kannst du einen neuen Artikel generieren.

View File

@ -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 -}} {{- $title := lower .Title -}}
{{- $pages := slice -}} {{- if eq $title "events" -}}
{{- $pctx := . -}} {{- $pages = where $pages ".Params.when" "ne" nil -}}
{{- 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 -}}
{{- end -}} {{- end -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}} {{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}} {{- if ge $limit 1 -}}

View File

@ -1,18 +1,13 @@
{{- define "title" -}} {{- define "title" -}}
{{ $name := .Name | lower }} {{ $name := .Name }}
{{ if ne ($name | i18n) "" }} {{ if ne ($name | lower | i18n) "" }}
{{ $name = $name | i18n }} {{ $name = $name | lower | i18n }}
{{ else }}
{{ if ne .Section "events" }}
{{ $name = $name | singularize }}
{{ end }}
{{ $name = $name | humanize }}
{{ end }} {{ end }}
<h1>{{ $name }}</h1> <h1>{{ $name }}</h1>
{{- end -}} {{- end -}}
{{- define "main" -}} {{- define "main" -}}
{{ if site.Params.debug }}taxonomy.html{{ end }} {{ partial "debug" (dict "context" .) }}
{{ $title := lower .Title }} {{ $title := lower .Title }}
{{- $paginator := slice -}} {{- $paginator := slice -}}
{{ $partial := "contentlayouts/list.html" }} {{ $partial := "contentlayouts/list.html" }}
@ -27,6 +22,8 @@
{{ $partial = "contentlayouts/termlist.html" }} {{ $partial = "contentlayouts/termlist.html" }}
{{ else if eq $title "events" }} {{ else if eq $title "events" }}
{{- $paginator = .Paginate (where $posts ".Params.when" "ne" nil) -}} {{- $paginator = .Paginate (where $posts ".Params.when" "ne" nil) -}}
{{ else if eq .Section "about" }}
{{- $paginator = .Paginate (where $posts ".Params.about" "eq" true) -}}
{{ else }} {{ else }}
{{- $paginator = .Paginate .Data.Pages -}} {{- $paginator = .Paginate .Data.Pages -}}
{{ end }} {{ end }}

View File

@ -3,4 +3,5 @@ Title: {{ .context.Title }}<br>
Name: {{ .context.Name }}<br> Name: {{ .context.Name }}<br>
context: {{ .context }}<br> context: {{ .context }}<br>
filename: {{ .filename }}<br> filename: {{ .filename }}<br>
section: {{ .context.Section }}<br>
{{ end }} {{ end }}

View File

@ -1,13 +1,15 @@
{{ $pageform := (index .context.Page.Params.forms .form) }} {{ $pageform := (index .context.Page.Params.forms .form) }}
{{ $group := slice }} {{ $group := slice }}
{{ $divide := .context.Page.Params.divide }}
<form id="myform"> <form id="myform">
{{ range $pageform.fields }} {{ range $pageform.fields }}
{{ $title := .title }}
{{ if .required }}{{ .Scratch.Set "requiredstar" "" }}{{ else }}{{ .Scratch.Set "requiredstar" " (optioneel)" }}{{ end }} {{ $name := $title }}
{{ if .required }}{{ .Scratch.Set "requiredtext" "required" }}{{ else }}{{ .Scratch.Set "requiredtext" "" }}{{ end }} {{ if .name }}
{{ $name = .name }}
{{ end }}
{{ if and .group (not (in $group .group))}} {{ if and .group (not (in $group .group))}}
<div class="margin_top_1rem"> <div class="margin_top_1rem">
@ -15,29 +17,28 @@
{{ partial "misc/expand" (dict "name" (printf "%sgroup" .group)) }} {{ partial "misc/expand" (dict "name" (printf "%sgroup" .group)) }}
</div> </div>
{{ $group = $group | append .group }} {{ $group = $group | append .group }}
{{ end }} {{ end }}
{{ if eq .input_type "title" }} {{ if eq .input_type "title" }}
<h3 {{ if .group }}class="visibleIf margin_left_1rem" data-visibleif-rule="{{ .group }}group == 'true'"{{ end }}>{{ .placeholder }}</h3> <h3 {{ if .group }}class="visibleIf margin_left_1rem" data-visibleif-rule="{{ .group }}group == 'true'"{{ end }}>{{- $name -}}{{- if .required -}}{{- " *" -}}{{- end -}}</h3>
{{ else if eq .input_type "textarea" }} {{ else if eq .input_type "textarea" }}
<div {{ if .group }}class="visibleIf margin_left_1rem" data-visibleif-rule="{{ .group }}group == 'true'"{{ end }}> <div {{ if .group }}class="visibleIf margin_left_1rem" data-visibleif-rule="{{ .group }}group == 'true'"{{ end }}>
<label {{ if $pageform.placeholders }}sr-only{{ end }} for="{{ .name }}">{{ .placeholder }}{{ .Scratch.Get "requiredstar" }}</label> <label {{ if $pageform.names }}sr-only{{ end }} for="{{ .title }}">{{- $name -}}{{- if .required -}}{{- " *" -}}{{- end -}}</label>
<textarea name="{{ .name }}" id="{{ .name }}" rows="10" {{ if $pageform.placeholders }}placeholder="{{ .placeholder }}{{ .Scratch.Get "requiredstar" }}"{{ end }} {{ .Scratch.Get "requiredtext" }}></textarea> <textarea name="{{ .title }}" id="{{ .title }}" rows="10" {{ if $pageform.names }}placeholder="{{ .name }}{{ .Scratch.Get "requiredstar" }}"{{ end }} {{ .Scratch.Get "requiredtext" }}></textarea>
</div> </div>
{{ else if eq .input_type "radio" }} {{ else if eq .input_type "radio" }}
<div class="radio {{- if .group }} visibleIf margin_left_1rem" data-visibleif-rule="{{ .group }}group == 'true'{{ end }}"> <div class="radio {{- if .group }} visibleIf margin_left_1rem" data-visibleif-rule="{{ .group }}group == 'true'{{ end }}">
<label><input type="radio" name="{{ .name }}" id="{{ .name }}" value="{{ .placeholder }}" {{ .Scratch.Get "requiredtext" }}>{{ .placeholder }}</label> <label><input type="radio" name="{{ .title }}" id="{{ .title }}" value="{{ .name }}" {{ .Scratch.Get "requiredtext" }}>{{- $name -}}{{- if .required -}}{{- " *" -}}{{- end -}}</label>
</div> </div>
{{ else if eq .input_type "checkbox" }} {{ else if eq .input_type "checkbox" }}
<div class="checkbox {{- if .group }} visibleIf margin_left_1rem" data-visibleif-rule="{{ .group }}group == 'true'{{ end }}"> <div class="checkbox {{- if .group }} visibleIf margin_left_1rem" data-visibleif-rule="{{ .group }}group == 'true'{{ end }}">
<label><input type="checkbox" name="{{ .name }}" id="{{ .name }}" value="{{ .placeholder }}" {{ .Scratch.Get "requiredtext" }}>{{ if i18n .placeholder }}{{ i18n .placeholder }}{{ else }}{{ humanize .placeholder }}{{ end }}</label> <label><input type="checkbox" name="{{ .title }}" id="{{ .title }}" value="{{ .name }}" {{ .Scratch.Get "requiredtext" }}>{{- $name -}}{{- if .required -}}{{- " *" -}}{{- end -}}</label>
</div> </div>
{{ else if eq .input_type "results" }} {{ else if eq .input_type "results" }}
<div id='display' class="result" style="white-space: pre; display: none; background: var(--background-body); padding: .6rem 0 1rem 1rem;"></div> <div id='display' class="result" style="white-space: pre; display: none; background: var(--background-body); padding: .6rem 0 1rem 1rem;"></div>
{{ else if eq .input_type "submit" }} {{ else if eq .input_type "submit" }}
<div class="margin_top_1rem {{ if .group }}visibleIf margin_left_1rem" data-visibleif-rule="{{ .group }}group == 'true'{{ end }}"> <div class="margin_top_1rem {{ if .group }}visibleIf margin_left_1rem" data-visibleif-rule="{{ .group }}group == 'true'{{ end }}">
<input type="{{ .input_type }}" value="{{ if i18n "generate" }}{{ i18n "generate" }}{{ else }}{{ "Generate" }}{{ end }}" onclick="showInput(event);" /> <input type="{{ .input_type }}" value="{{- $name -}}" onclick="showInput(event);" />
</div> </div>
@ -48,11 +49,11 @@
{{ else if eq .input_type "mc" }} {{ else if eq .input_type "mc" }}
{{ $in0 := .name }} {{ $in0 := .title }}
{{- $finale := slice -}} {{- $finale := slice -}}
{{ $pages := where site.RegularPages "Type" "in" site.Params.searchSections }} {{ $pages := where site.RegularPages "Type" "in" site.Params.searchSections }}
{{ if eq .name "tags" }} {{ if eq .title "tags" }}
{{ range $pages }} {{ range $pages }}
{{- if .Params.tags -}} {{- if .Params.tags -}}
{{- $finale = $finale | append .Params.tags -}} {{- $finale = $finale | append .Params.tags -}}
@ -69,8 +70,8 @@
<div class="margin_top_1rem {{- if .group }} visibleIf" data-visibleif-rule="{{ .group }}group == 'true'"{{ else }}"{{ end }} style="flex-direction: column;"> <div class="margin_top_1rem {{- if .group }} visibleIf" data-visibleif-rule="{{ .group }}group == 'true'"{{ else }}"{{ end }} style="flex-direction: column;">
<div class="{{- if .group }}margin_left_1rem{{ end }}"> <div class="{{- if .group }}margin_left_1rem{{ end }}">
{{ .placeholder }} {{ .name }}
{{ if ne .expanded true }}{{ partial "misc/expand" (dict "name" (printf "%scat" $in0)) }}{{ end }} {{ if ne .expanded true }}{{ partial "misc/expand" (dict "name" (printf "%scat" $in0)) }}{{ end }}{{- if .required -}}{{- " *" -}}{{- end -}}
</div> </div>
@ -84,9 +85,9 @@
<input type="checkbox" name="{{ $in0 }}" id="{{ $in0 }}-cat" value="{{ . }}"><label for="{{ $in0 }}-cat">{{ . }}</label> <input type="checkbox" name="{{ $in0 }}" id="{{ $in0 }}-cat" value="{{ . }}"><label for="{{ $in0 }}-cat">{{ . }}</label>
{{ end }} {{ end }}
</fieldset> </fieldset>
{{ if eq .new true }} {{ if .new }}
<label id="label" for="new{{- .name -}}">{{ if i18n "new" }}{{ i18n "new" }}{{ else }}{{ "New" }}{{ end }} <span style="font-size: x-small;">(Getrennt durch Komma)</span></label> <label id="label" for="new{{- .title -}}">{{ .new }} <span style="font-size: x-small;">({{ $divide }})</span></label>
<input type="text" name="new{{- .name -}}" id="new{{- .name -}}" value="" placeholder="{{ .eg }}" /> <input type="text" name="new{{- .title -}}" id="new{{- .title -}}" value="" placeholder="{{ .eg }}" />
{{ end }} {{ end }}
</div> </div>
</div> </div>
@ -103,34 +104,34 @@
{{ else }} {{ else }}
{{ if eq .name "name" }} {{ if eq .title "name" }}
<div class="half {{- if .group }} visibleIf margin_left_1rem" data-visibleif-rule="{{ .group }}group == 'true'{{ end }}"> <div class="half {{- if .group }} visibleIf margin_left_1rem" data-visibleif-rule="{{ .group }}group == 'true'{{ end }}">
<label class="{{ if $pageform.placeholders }}sr-only{{ end }}" for="firstname">First name{{ .Scratch.Get "requiredstar" }}</label> <label class="{{ if $pageform.names }}sr-only{{ end }}" for="firstname">First name{{- if .required -}}{{- " *" -}}{{- end -}}</label>
<input type="text" name="firstname" id="firstname" {{ if $pageform.placeholders }}placeholder="First name{{ .Scratch.Get "requiredstar" }}"{{ end }} {{ .Scratch.Get "requiredtext" }}> <input type="text" name="firstname" id="firstname" {{ if $pageform.names }}placeholder="First name{{ .Scratch.Get "requiredstar" }}"{{ end }} {{ .Scratch.Get "requiredtext" }}>
</div> </div>
<div class="half {{- if .group }} visibleIf margin_left_1rem" data-visibleif-rule="{{ .group }}group == 'true'{{ end }}"> <div class="half {{- if .group }} visibleIf margin_left_1rem" data-visibleif-rule="{{ .group }}group == 'true'{{ end }}">
<label class="{{ if $pageform.placeholders }}sr-only{{ end }}" for="lastname">Last name{{ .Scratch.Get "requiredstar" }}</label> <label class="{{ if $pageform.names }}sr-only{{ end }}" for="lastname">Last name{{- if .required -}}{{- " *" -}}{{- end -}}</label>
<input type="text" name="lastname" id="lastname" {{ if $pageform.placeholders }}placeholder="Last name{{ .Scratch.Get "requiredstar" }}"{{ end }} {{ .Scratch.Get "requiredtext" }}> <input type="text" name="lastname" id="lastname" {{ if $pageform.names }}placeholder="Last name{{ .Scratch.Get "requiredstar" }}"{{ end }} {{ .Scratch.Get "requiredtext" }}>
</div> </div>
{{ else if eq .name "address" }} {{ else if eq .title "address" }}
<div {{- if .group }} class="visibleIf margin_left_1rem" data-visibleif-rule="{{ .group }}group == 'true'"{{ end -}}> <div {{- if .group }} class="visibleIf margin_left_1rem" data-visibleif-rule="{{ .group }}group == 'true'"{{ end -}}>
<label class="{{ if $pageform.placeholders }}sr-only{{ end }}" for="address">Address{{ .Scratch.Get "requiredstar" }}</label> <label class="{{ if $pageform.names }}sr-only{{ end }}" for="address">Address{{- if .required -}}{{- " *" -}}{{- end -}}</label>
<input type="text" name="address" id="address" {{ if $pageform.placeholders }}placeholder="Address{{ .Scratch.Get "requiredstar" }}"{{ end }} {{ .Scratch.Get "requiredtext" }}> <input type="text" name="address" id="address" {{ if $pageform.names }}placeholder="Address{{ .Scratch.Get "requiredstar" }}"{{ end }} {{ .Scratch.Get "requiredtext" }}>
</div> </div>
<div class="half {{- if .group }} visibleIf margin_left_1rem" data-visibleif-rule="{{ .group }}group == 'true{{ end }}"> <div class="half {{- if .group }} visibleIf margin_left_1rem" data-visibleif-rule="{{ .group }}group == 'true{{ end }}">
<label class="{{ if $pageform.placeholders }}sr-only{{ end }}" for="city">City{{ .Scratch.Get "requiredstar" }}</label> <label class="{{ if $pageform.names }}sr-only{{ end }}" for="city">City{{- if .required -}}{{- " *" -}}{{- end -}}</label>
<input type="text" name="city" id="city" {{ if $pageform.placeholders }}placeholder="City{{ .Scratch.Get "requiredstar" }}"{{ end }} {{ .Scratch.Get "requiredtext" }}> <input type="text" name="city" id="city" {{ if $pageform.names }}placeholder="City{{ .Scratch.Get "requiredstar" }}"{{ end }} {{ .Scratch.Get "requiredtext" }}>
</div> </div>
<div class="half {{- if .group }} visibleIf margin_left_1rem" data-visibleif-rule="{{ .group }}group == 'true'{{ end }}"> <div class="half {{- if .group }} visibleIf margin_left_1rem" data-visibleif-rule="{{ .group }}group == 'true'{{ end }}">
<label class="{{ if $pageform.placeholders }}sr-only{{ end }}" for="postalcode">Postal code{{ .Scratch.Get "requiredstar" }}</label> <label class="{{ if $pageform.names }}sr-only{{ end }}" for="postalcode">Postal code{{- if .required -}}{{- " *" -}}{{- end -}}</label>
<input type="text" name="postalcode" id="postalcode" {{ if $pageform.placeholders }}placeholder="Postal code{{ .Scratch.Get "requiredstar" }}"{{ end }} {{ .Scratch.Get "requiredtext" }}> <input type="text" name="postalcode" id="postalcode" {{ if $pageform.names }}placeholder="Postal code{{ .Scratch.Get "requiredstar" }}"{{ end }} {{ .Scratch.Get "requiredtext" }}>
</div> </div>
{{ else }} {{ else }}
<div class="margin_top_1rem {{ if .group }} visibleIf margin_left_1rem" data-visibleif-rule=" {{ .group }}group == 'true' {{ end }}" class="minmax"> <div class="margin_top_1rem {{ if .group }} visibleIf margin_left_1rem" data-visibleif-rule=" {{ .group }}group == 'true' {{ end }}" class="minmax">
<div class="minmax" style="display: flex; flex-direction: column;"> <div class="minmax" style="display: flex; flex-direction: column;">
<label class="{{ if $pageform.placeholders }}sr-only{{ end }}" for="{{ .name }}">{{ .placeholder }}{{ .Scratch.Get "requiredstar" }}</label> <label class="{{ if $pageform.names }}sr-only{{ end }}" for="{{ .title }}">{{ .name }}{{- if .required -}}{{- " *" -}}{{- end -}}</label>
<input type="{{ .input_type }}" name="{{ .name }}" id="{{ .name }}" {{ if $pageform.placeholders }}placeholder="{{ .placeholder }}{{ .Scratch.Get "requiredstar" }}"{{ end }} {{ .Scratch.Get "requiredtext" }}> <input type="{{ .input_type }}" name="{{ .title }}" id="{{ .title }}" {{ if $pageform.names }}placeholder="{{ .name }}{{ .Scratch.Get "requiredstar" }}"{{ end }} {{ .Scratch.Get "requiredtext" }}>
</div> </div>
</div> </div>
{{ end }} {{ end }}

View File

@ -42,12 +42,19 @@
{{ end }} {{ end }}
<a href="{{- "links" | absLangURL -}}">{{- $links | strings.FirstUpper -}}</a><br><br> <a href="{{- "links" | absLangURL -}}">{{- $links | strings.FirstUpper -}}</a><br><br>
{{- end -}} {{- end -}}
{{- with .OutputFormats.Get "rss" -}} {{- if not (or (eq .Section "featured") (eq .Section "about")) -}}
{{- if .Permalink -}} {{ if .IsHome }}
{{- printf `<a href="%s">` .Permalink | safeHTML -}} {{- printf `<a href="%s">` "/news/index.xml" | safeHTML -}}
{{- end -}} RSS</a><br><br>
RSS</a><br><br> {{ else }}
{{- end -}} {{- with .OutputFormats.Get "rss" -}}
{{- if .Permalink -}}
{{- printf `<a href="%s">` .Permalink | safeHTML -}}
{{- end -}}
RSS</a><br><br>
{{- end -}}
{{ end }}
{{ end }}
<a href="https://schlomp.space/Bunteshaus/bunteshaus.de">Sourcecode</a> <a href="https://schlomp.space/Bunteshaus/bunteshaus.de">Sourcecode</a>
</div> </div>