From 982cf4a66bd42da9f6ba0f1e7b1fec2a5698a106 Mon Sep 17 00:00:00 2001
From: teldra
Date: Sat, 9 Apr 2022 21:34:04 +0200
Subject: [PATCH 1/7] small fixes
---
content/tools/generator.de.md | 4 +
docs/todo.de | 17 ++-
themes/buha/assets/css/layout.css | 6 +-
.../_markup/render-heading.html | 0
.../_markup/render-image.html | 0
.../{_default => _default.old}/archive.html | 0
themes/buha/layouts/_default.old/baseof.html | 27 ++++
.../{_default => _default.old}/contact.html | 0
.../{_default => _default.old}/imprint.html | 0
.../{_default => _default.old}/links.html | 0
.../misc.html => _default.old/list.html} | 0
themes/buha/layouts/_default.old/misc.html | 12 ++
.../{_default => _default.old}/news.html | 0
.../newsletter.html | 0
themes/buha/layouts/_default.old/rss.xml | 75 +++++++++
themes/buha/layouts/_default.old/single.html | 46 ++++++
.../{_default => _default.old}/taxonomy.html | 0
themes/buha/layouts/_default/baseof.html | 2 +-
themes/buha/layouts/_default/list.html | 39 ++++-
themes/buha/layouts/_default/rss.xml | 2 +
themes/buha/layouts/_default/single.html | 45 +-----
themes/buha/layouts/index.html | 28 +---
themes/buha/layouts/index.html.old | 40 +++++
.../partials.old/contentlayouts/article.html | 51 +++++++
.../partials.old/contentlayouts/footer.html | 55 +++++++
.../partials.old/contentlayouts/list.html | 1 +
.../partials.old/contentlayouts/menu.html | 27 ++++
.../partials.old/contentlayouts/meta.html | 18 +++
.../partials.old/contentlayouts/termlist.html | 29 ++++
themes/buha/layouts/partials.old/debug.html | 8 +
.../{partials => partials.old}/layout/about | 0
.../layout/archive.html | 0
.../layout/categories | 0
.../{partials => partials.old}/layout/events | 0
.../layout/featured | 0
.../{partials => partials.old}/layout/index | 0
.../{partials => partials.old}/layout/links | 0
.../{partials => partials.old}/layout/misc | 0
.../{partials => partials.old}/layout/tags | 0
.../misc/expand.html | 0
.../{partials => partials.old}/misc/form.html | 0
.../misc/generator.html | 0
.../misc/nottranslated.html | 0
.../{partials => partials.old}/rrule.html | 0
.../partials.old/structure/contact.html | 6 +
.../layouts/partials.old/structure/empty.html | 0
.../layouts/partials.old/structure/head.html | 27 ++++
.../partials.old/structure/header.html | 15 ++
.../layouts/partials.old/structure/langs.html | 10 ++
.../partials.old/structure/paginator.html | 102 +++++++++++++
.../partials.old/structure/sidebar.html | 2 +
.../partials.old/structure/submenu.html | 8 +
themes/buha/layouts/partials/debug.html | 4 +-
.../partials/layout/lists/article_list.html | 29 ++++
.../partials/layout/lists/section_list.html | 5 +
.../layout/lists/taxonomies_list.html | 3 +
.../partials/layout/lists/term_list.html | 4 +
.../partials/layout/single/archive.html | 14 ++
.../partials/layout/single/article.html | 48 ++++++
.../layout/single/content_single.html | 33 ++++
.../partials/layout/single/generator.html | 17 +++
.../layout/single/generator/expand.html | 3 +
.../layout/single/generator/form.html | 142 ++++++++++++++++++
.../layouts/partials/layout/single/links.html | 6 +
.../partials/layout/single/newsletter.html | 1 +
.../partials/snippets/article_metadata.html | 21 +++
.../layouts/partials/snippets/contact.html | 6 +
.../layouts/partials/snippets/content.html | 1 +
.../layouts/partials/snippets/paginator.html | 102 +++++++++++++
.../partials/snippets/single_chooser.html | 22 +++
70 files changed, 1085 insertions(+), 78 deletions(-)
rename themes/buha/layouts/{_default => _default.old}/_markup/render-heading.html (100%)
rename themes/buha/layouts/{_default => _default.old}/_markup/render-image.html (100%)
rename themes/buha/layouts/{_default => _default.old}/archive.html (100%)
create mode 100644 themes/buha/layouts/_default.old/baseof.html
rename themes/buha/layouts/{_default => _default.old}/contact.html (100%)
rename themes/buha/layouts/{_default => _default.old}/imprint.html (100%)
rename themes/buha/layouts/{_default => _default.old}/links.html (100%)
rename themes/buha/layouts/{_default/misc.html => _default.old/list.html} (100%)
create mode 100644 themes/buha/layouts/_default.old/misc.html
rename themes/buha/layouts/{_default => _default.old}/news.html (100%)
rename themes/buha/layouts/{_default => _default.old}/newsletter.html (100%)
create mode 100644 themes/buha/layouts/_default.old/rss.xml
create mode 100644 themes/buha/layouts/_default.old/single.html
rename themes/buha/layouts/{_default => _default.old}/taxonomy.html (100%)
create mode 100644 themes/buha/layouts/index.html.old
create mode 100644 themes/buha/layouts/partials.old/contentlayouts/article.html
create mode 100644 themes/buha/layouts/partials.old/contentlayouts/footer.html
create mode 100644 themes/buha/layouts/partials.old/contentlayouts/list.html
create mode 100644 themes/buha/layouts/partials.old/contentlayouts/menu.html
create mode 100644 themes/buha/layouts/partials.old/contentlayouts/meta.html
create mode 100644 themes/buha/layouts/partials.old/contentlayouts/termlist.html
create mode 100644 themes/buha/layouts/partials.old/debug.html
rename themes/buha/layouts/{partials => partials.old}/layout/about (100%)
rename themes/buha/layouts/{partials => partials.old}/layout/archive.html (100%)
rename themes/buha/layouts/{partials => partials.old}/layout/categories (100%)
rename themes/buha/layouts/{partials => partials.old}/layout/events (100%)
rename themes/buha/layouts/{partials => partials.old}/layout/featured (100%)
rename themes/buha/layouts/{partials => partials.old}/layout/index (100%)
rename themes/buha/layouts/{partials => partials.old}/layout/links (100%)
rename themes/buha/layouts/{partials => partials.old}/layout/misc (100%)
rename themes/buha/layouts/{partials => partials.old}/layout/tags (100%)
rename themes/buha/layouts/{partials => partials.old}/misc/expand.html (100%)
rename themes/buha/layouts/{partials => partials.old}/misc/form.html (100%)
rename themes/buha/layouts/{partials => partials.old}/misc/generator.html (100%)
rename themes/buha/layouts/{partials => partials.old}/misc/nottranslated.html (100%)
rename themes/buha/layouts/{partials => partials.old}/rrule.html (100%)
create mode 100644 themes/buha/layouts/partials.old/structure/contact.html
create mode 100644 themes/buha/layouts/partials.old/structure/empty.html
create mode 100644 themes/buha/layouts/partials.old/structure/head.html
create mode 100644 themes/buha/layouts/partials.old/structure/header.html
create mode 100644 themes/buha/layouts/partials.old/structure/langs.html
create mode 100644 themes/buha/layouts/partials.old/structure/paginator.html
create mode 100644 themes/buha/layouts/partials.old/structure/sidebar.html
create mode 100644 themes/buha/layouts/partials.old/structure/submenu.html
create mode 100644 themes/buha/layouts/partials/layout/lists/article_list.html
create mode 100644 themes/buha/layouts/partials/layout/lists/section_list.html
create mode 100644 themes/buha/layouts/partials/layout/lists/taxonomies_list.html
create mode 100644 themes/buha/layouts/partials/layout/lists/term_list.html
create mode 100644 themes/buha/layouts/partials/layout/single/archive.html
create mode 100644 themes/buha/layouts/partials/layout/single/article.html
create mode 100644 themes/buha/layouts/partials/layout/single/content_single.html
create mode 100644 themes/buha/layouts/partials/layout/single/generator.html
create mode 100644 themes/buha/layouts/partials/layout/single/generator/expand.html
create mode 100644 themes/buha/layouts/partials/layout/single/generator/form.html
create mode 100644 themes/buha/layouts/partials/layout/single/links.html
create mode 100644 themes/buha/layouts/partials/layout/single/newsletter.html
create mode 100644 themes/buha/layouts/partials/snippets/article_metadata.html
create mode 100644 themes/buha/layouts/partials/snippets/contact.html
create mode 100644 themes/buha/layouts/partials/snippets/content.html
create mode 100644 themes/buha/layouts/partials/snippets/paginator.html
create mode 100644 themes/buha/layouts/partials/snippets/single_chooser.html
diff --git a/content/tools/generator.de.md b/content/tools/generator.de.md
index 42124be..ad3e39d 100644
--- a/content/tools/generator.de.md
+++ b/content/tools/generator.de.md
@@ -48,6 +48,10 @@ forms:
group: misc
input_type: checkbox
name: "Über uns"
+ - title: lastmod
+ group: misc
+ input_type: date
+ name: "Zurueckdatieren"
- title: tags
group: misc
input_type: mc
diff --git a/docs/todo.de b/docs/todo.de
index 33e408b..bb21981 100644
--- a/docs/todo.de
+++ b/docs/todo.de
@@ -2,14 +2,27 @@ todo buha.de
- anleitung git proxy fuer tor
- eintritt "gegen spende"
- covid regel verfeinern
-- diskutieren, ob jede aenderung via rss raus soll (lastmod vs einmalig)
+- diskutieren, ob jede aenderung via rss raus soll (lastmod vs einmalig) (erstellung und lastmod gt date werden erstellt)
- generator form: aus mc ein checkbox machen und kategorien und/oder eventkategorien soloauswaehlbar machen.
-- sollte kein bild gefunden werden, wird ein standard bild verwendet. (diskutabel, hat vor und nachteile. man kann aber auch ein pool bereitstellen, je nach kategorie? im generator auswaehlen?)
+- sollte kein bild gefunden werden, wird ein standard bild verwendet. ( einen pool fuer bestimmte kategorien)
- diskutieren, in welcher reihenfolge artikel angezeigt werden sollen.
+- links in content unterstrichen
+
+- runde ecken? 2px
+
+- stiftung via prefix filename vom bild. maximale hoehe =s wenigst hohe bild. beim footer
+
+- generator "nachtrag": lastmod in frontmatter
- dokumentiere, das artikel der alten homepage "lastmod" mit demgenau bis ungefaehren datum der damligen erstellung, im frontmatter haben sollten, wann sie erstellt wurden.
+- rss: das macht, das nur neue und if (Lastmod = Date) or (Lastmod gt Date.AddDate 0 0 -1)
+
+- push.sh: pushen optional? commit extra? commit --amend?
+
+- https://schlomp.space/Bunteshaus/bunteshaus.de/src/branch/main/docs/artikel_formatierung.md#absatz: durcheinander
+
listen:
mit preview:
events
diff --git a/themes/buha/assets/css/layout.css b/themes/buha/assets/css/layout.css
index 0314a50..deea30c 100644
--- a/themes/buha/assets/css/layout.css
+++ b/themes/buha/assets/css/layout.css
@@ -116,7 +116,7 @@ article {
display: flex;
flex-direction: column;
margin-bottom: 2rem;
- padding: 1rem 1rem 1rem 1rem;
+ padding: 1rem;
}
#articletext img {
@@ -125,8 +125,10 @@ article {
width: 80%;
}
+
#articlemeta {
margin-bottom: 1rem;
+ margin-left: 1rem;
}
#articlemeta div:first-child {
@@ -137,7 +139,7 @@ article {
#articleinner {
display: flex;
flex-direction: column-reverse;
- margin-top: .5rem;
+ margin-left: 1rem;
}
#articletext {
diff --git a/themes/buha/layouts/_default/_markup/render-heading.html b/themes/buha/layouts/_default.old/_markup/render-heading.html
similarity index 100%
rename from themes/buha/layouts/_default/_markup/render-heading.html
rename to themes/buha/layouts/_default.old/_markup/render-heading.html
diff --git a/themes/buha/layouts/_default/_markup/render-image.html b/themes/buha/layouts/_default.old/_markup/render-image.html
similarity index 100%
rename from themes/buha/layouts/_default/_markup/render-image.html
rename to themes/buha/layouts/_default.old/_markup/render-image.html
diff --git a/themes/buha/layouts/_default/archive.html b/themes/buha/layouts/_default.old/archive.html
similarity index 100%
rename from themes/buha/layouts/_default/archive.html
rename to themes/buha/layouts/_default.old/archive.html
diff --git a/themes/buha/layouts/_default.old/baseof.html b/themes/buha/layouts/_default.old/baseof.html
new file mode 100644
index 0000000..2ad994b
--- /dev/null
+++ b/themes/buha/layouts/_default.old/baseof.html
@@ -0,0 +1,27 @@
+
+
+ {{- partial "structure/head.html" . -}}
+ {{ block "css" . -}}{{- end }}
+
+
+
+ {{ partialCached "structure/header" . }}
+ {{ partial "structure/submenu" . }}
+
+
+
+ {{ block "title" . -}}{{- end }}
+ {{ block "content" . -}}{{- end }}
+ {{ block "main" . -}}{{- end }}
+
+
+
+ {{ block "pagefooter" . -}}{{- end }}
+
+
+
+
diff --git a/themes/buha/layouts/_default/contact.html b/themes/buha/layouts/_default.old/contact.html
similarity index 100%
rename from themes/buha/layouts/_default/contact.html
rename to themes/buha/layouts/_default.old/contact.html
diff --git a/themes/buha/layouts/_default/imprint.html b/themes/buha/layouts/_default.old/imprint.html
similarity index 100%
rename from themes/buha/layouts/_default/imprint.html
rename to themes/buha/layouts/_default.old/imprint.html
diff --git a/themes/buha/layouts/_default/links.html b/themes/buha/layouts/_default.old/links.html
similarity index 100%
rename from themes/buha/layouts/_default/links.html
rename to themes/buha/layouts/_default.old/links.html
diff --git a/themes/buha/layouts/_default/misc.html b/themes/buha/layouts/_default.old/list.html
similarity index 100%
rename from themes/buha/layouts/_default/misc.html
rename to themes/buha/layouts/_default.old/list.html
diff --git a/themes/buha/layouts/_default.old/misc.html b/themes/buha/layouts/_default.old/misc.html
new file mode 100644
index 0000000..e612da4
--- /dev/null
+++ b/themes/buha/layouts/_default.old/misc.html
@@ -0,0 +1,12 @@
+{{ define "title" }}
+{{ if i18n .Section }}{{ i18n .Section }}{{ else }}{{ "Misc" }}{{ end }}
+{{ end }}
+
+{{ define "main" }}
+ {{ partial "debug" (dict "context" . ) }}
+
+ {{ range .Pages }}
+ {{ .Name }}
+ {{ end }}
+
+{{ end }}
diff --git a/themes/buha/layouts/_default/news.html b/themes/buha/layouts/_default.old/news.html
similarity index 100%
rename from themes/buha/layouts/_default/news.html
rename to themes/buha/layouts/_default.old/news.html
diff --git a/themes/buha/layouts/_default/newsletter.html b/themes/buha/layouts/_default.old/newsletter.html
similarity index 100%
rename from themes/buha/layouts/_default/newsletter.html
rename to themes/buha/layouts/_default.old/newsletter.html
diff --git a/themes/buha/layouts/_default.old/rss.xml b/themes/buha/layouts/_default.old/rss.xml
new file mode 100644
index 0000000..fdf2e42
--- /dev/null
+++ b/themes/buha/layouts/_default.old/rss.xml
@@ -0,0 +1,75 @@
+{{- $pages := where (where .Site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" .Site.Params.searchSections -}}
+{{- $title := lower .Title -}}
+{{- if eq $title "events" -}}
+ {{- $pages = where $pages ".Params.when" "ne" nil -}}
+{{- end -}}
+{{- $limit := .Site.Config.Services.RSS.Limit -}}
+{{- if ge $limit 1 -}}
+{{- $pages = $pages | first $limit -}}
+{{- end -}}
+{{- $pages = $pages.ByLastmod.Reverse -}}
+{{- printf "" | safeHTML }}
+
+
+ {{ .Site.Title }}
+ {{ .Permalink }}
+ Aktuelles von {{ .Site.Title }}
+ Hugo -- gohugo.io{{ with .Site.LanguageCode }}
+ {{.}}{{end}}{{ with .Site.Author.email }}
+ {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }}
+ {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }}
+ {{.}}{{end}}{{ if not .Date.IsZero }}
+ {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }}
+ {{- with .OutputFormats.Get "RSS" -}}
+ {{ printf "" .Permalink .MediaType | safeHTML }}
+ {{- end -}}
+ {{ range where $pages "Type" "in" .Site.Params.searchSections }}
+ {{ $when := .Params.when }}
+ {{ $about := .Params.about }}
+ {{ $covid := .Params.covid }}
+ {{ $contact := .Params.contact }}
+ {{ $price := .Params.price }}
+ {{ $featured := .Params.featured }}
+ {{ $categories := slice }}
+ {{ range .Params.categories }}
+ {{ $categories = $categories | append . }}
+ {{ end }}
+ {{ $events := slice }}
+ {{ range .Params.events }}
+ {{ $events = $events | append . }}
+ {{ end }}
+ {{ $tags := slice }}
+ {{ range .Params.tags }}
+ {{ $tags = $tags | append . }}
+ {{ end }}
+ {{ $images := slice }}
+ {{ range .Resources.ByType "image" }}
+ {{ $images = $images | append . }}
+ {{ end }}
+ {{ $hash := slice $when $about $categories $events $covid $contact $price $featured $tags .Date .Lastmod .Title .Content }}
+ {{ $hash = delimit $hash ", " }}
+ {{ $hash = md5 $hash }}
+
+ -
+ {{ .Title }}
+ {{ .Permalink }}
+ {{ .Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}
+ {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}
+ {{ .Permalink }}-{{ $hash }}
+
+ {{- $c := replace .Content "%s
%s" $when $c -}}
+ {{- end -}}
+ {{- $img := index (.Resources.ByType "image") 0 -}}
+ {{- with $img -}}
+ {{- $img := .Resize "640x" -}}
+ {{- $c = printf "%s" $c $img.Permalink $img.Width $img.Height -}}
+ {{- end -}}
+ {{- printf "" $c | safeHTML -}}
+
+
+
+ {{ end }}
+
+
diff --git a/themes/buha/layouts/_default.old/single.html b/themes/buha/layouts/_default.old/single.html
new file mode 100644
index 0000000..3f35aa2
--- /dev/null
+++ b/themes/buha/layouts/_default.old/single.html
@@ -0,0 +1,46 @@
+{{ define "title" }}
+ {{ $name := .Title }}
+ {{ if lower $name | i18n }}
+ {{ $name = lower $name | i18n }}
+ {{ end }}
+ {{ $name }}
+{{ end }}
+
+{{ define "main" }}
+ {{ partial "debug" (dict "context" . "caller" "single.html" )}}
+
+ {{ if eq .Type "tools" }}
+
+ {{ $tool := printf "misc/%s" .Params.tool }}
+ {{ partial $tool . }}
+
+ {{ else }}
+
+ {{ partial "contentlayouts/article.html" (dict "context" . "type" "article") }}
+
+ {{ end }}
+{{ end }}
+
+{{ define "pagefooter" }}
+ {{ if and (ne .Section "misc") (eq .Type "tools") }}
+
+
+ {{ if i18n "created" }}{{ i18n "created" }}{{ else }}{{ "Created" }}{{ end }}
+ {{ .Date | time.Format ":date_full" }}
+
+ {{ if ne .Date .Lastmod }}
+
+ {{ if i18n "lastmod" }}{{ i18n "lastmod" }}{{ else }}{{ "Last modification" }}{{ end }}
+ {{ .Lastmod | time.Format ":date_full" }}
+
+ {{ end }}
+
+ {{ end }}
+{{ end }}
+
+
+{{ define "sidebar" }}
+ {{ if ne .Type "tools" }}
+ {{- partial "contentlayouts/menu.html" . }}
+ {{ end }}
+{{ end }}
diff --git a/themes/buha/layouts/_default/taxonomy.html b/themes/buha/layouts/_default.old/taxonomy.html
similarity index 100%
rename from themes/buha/layouts/_default/taxonomy.html
rename to themes/buha/layouts/_default.old/taxonomy.html
diff --git a/themes/buha/layouts/_default/baseof.html b/themes/buha/layouts/_default/baseof.html
index 2ad994b..08990cf 100644
--- a/themes/buha/layouts/_default/baseof.html
+++ b/themes/buha/layouts/_default/baseof.html
@@ -11,8 +11,8 @@
{{ block "title" . -}}{{- end }}
+ {{ block "calc" . -}}{{- end }}
{{ block "content" . -}}{{- end }}
- {{ block "main" . -}}{{- end }}