From f0a4d81451f8a21013be6ad0748cc395204d1a53 Mon Sep 17 00:00:00 2001 From: jtbx Date: Sun, 8 Oct 2023 17:38:54 +0200 Subject: [PATCH] Home: Fix event annoucement summary --- hugo.toml | 1 + themes/ccchh/assets/sass/main.scss | 22 +++++++++++++++---- themes/ccchh/layouts/_default/summary.html | 2 +- themes/ccchh/layouts/blog/single.html | 2 +- themes/ccchh/layouts/index.html | 20 ++++++----------- .../ccchh/layouts/partials/blog-header.html | 19 ++++++++++------ 6 files changed, 40 insertions(+), 26 deletions(-) diff --git a/hugo.toml b/hugo.toml index 504f40b..84ceee6 100644 --- a/hugo.toml +++ b/hugo.toml @@ -1,5 +1,6 @@ baseURL = 'https://hamburg.ccc.de/' languageCode = 'de-de' +defaultContentLanguage = 'de' title = 'CCC Hansestadt Hamburg e.V.' theme = 'ccchh' diff --git a/themes/ccchh/assets/sass/main.scss b/themes/ccchh/assets/sass/main.scss index fb6de71..6b53a0f 100644 --- a/themes/ccchh/assets/sass/main.scss +++ b/themes/ccchh/assets/sass/main.scss @@ -10,13 +10,15 @@ $roomstate_color_closed: var(--del-color); header { margin-bottom: 3rem; - h1 { + h1, + h2, + h3, + h4, + h5, + h6 { margin-bottom: 0; } - h2 { - margin-bottom: 0; - } } body>footer { @@ -114,6 +116,18 @@ body>main { margin-bottom: var(--typography-spacing-vertical); + header { + margin-bottom: 1rem; + } + + p { + margin-bottom: calc(var(--typography-spacing-vertical) / 2); + } + + // .morelink { + // margin-top: calc((var(--typography-spacing-vertical) / 2) * -1); + // } + p:last-child { margin-bottom: 0; } diff --git a/themes/ccchh/layouts/_default/summary.html b/themes/ccchh/layouts/_default/summary.html index f05cf0b..f78477a 100644 --- a/themes/ccchh/layouts/_default/summary.html +++ b/themes/ccchh/layouts/_default/summary.html @@ -1,6 +1,6 @@
- {{- partial "blog-header.html" (dict "subitem" true "page" . ) }} + {{- partial "blog-header.html" (dict "headingLink" true "level" 2 "page" . ) }} {{- if in .RawContent "" }} {{ .Summary | safeHTML }} diff --git a/themes/ccchh/layouts/blog/single.html b/themes/ccchh/layouts/blog/single.html index 87bff02..b298a64 100644 --- a/themes/ccchh/layouts/blog/single.html +++ b/themes/ccchh/layouts/blog/single.html @@ -1,6 +1,6 @@ {{ define "main" }}
- {{- partial "blog-header.html" (dict "subitem" false "page" . ) }} + {{- partial "blog-header.html" (dict "page" . ) }}
{{ .Content }} diff --git a/themes/ccchh/layouts/index.html b/themes/ccchh/layouts/index.html index 82dd1cd..1af1d39 100644 --- a/themes/ccchh/layouts/index.html +++ b/themes/ccchh/layouts/index.html @@ -1,29 +1,23 @@ {{ define "main" }}
-
- {{ .Content }}
{{- $events := where (.Site.GetPage "blog").Pages ".Params.categories" "event" }} {{- $upcoming := where $events ".Params.date" "ge" now }} - {{ if $upcoming}} + {{ if $upcoming }}

Neuigkeiten

{{- range $upcoming.ByDate }}
-

{{ .Date.Format "2006-01-02" }}: {{ .Title }} - {{ .Summary }} - {{- if .Truncated }} - Read More… + {{- partial "blog-header.html" (dict "headingLink" true "level" 4 "reduced" true "page" . ) }} + + {{- if in .RawContent "" }} + {{ .Summary | safeHTML }} + {{- else }} +

{{ .Summary | safeHTML }}

{{- end }} -

{{- end }}
diff --git a/themes/ccchh/layouts/partials/blog-header.html b/themes/ccchh/layouts/partials/blog-header.html index 7b695cf..530d6c0 100644 --- a/themes/ccchh/layouts/partials/blog-header.html +++ b/themes/ccchh/layouts/partials/blog-header.html @@ -1,22 +1,24 @@ {{- $page := .page -}} -{{- $isMain := not .subitem -}} +{{- $level := (.level | default 1) -}} +{{- $headingLink := (.headingLink | default false) -}} +{{- $showTags := not (.reduced | default false) -}} +{{- $showAuthors := not (.reduced | default false) -}} {{ with $page }}
- {{- if $isMain }} -

{{ .Title }}

- {{- else }} -

{{ .Title }}

- {{- end }} + {{- if $headingLink }}{{ end }} + {{ .Title }} + {{- if $headingLink }}{{ end }} {{- with .Params.subtitle }} {{ . }} {{- end }}
- {{ .Date.Format "2006-01-02 15:04" }} + {{ .Date | time.Format "Mon, 2006-01-02 15:04" }} {{- with .Params.location }} {{ . }} {{- end }} + {{- if $showTags }} {{- with .Page.GetTerms "tags" }} {{- range . }} @@ -24,6 +26,8 @@ {{- end }} {{- end }} + {{- end }} + {{- if $showAuthors }}
{{- with .Page.GetTerms "authors" }} @@ -32,6 +36,7 @@ {{- end }} {{- end }} + {{- end }}
{{- end }} \ No newline at end of file