diff --git a/i18n/de.yaml b/i18n/de.yaml index 872ac2a..b46c692 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -1,5 +1,5 @@ # -# de.yaml 2021-11-11 +# de.yaml 2021-11-15 # about: @@ -20,6 +20,9 @@ articles-in-section: author: other: Autor +child-articles: + other: Untergeordnete Artikel + child-topics: other: Unterbegriffe @@ -44,6 +47,9 @@ next: pages: other: Seiten +parent-articles: + other: Übergeordnete Artikel + parent-topics: other: Oberbegriffe @@ -57,7 +63,10 @@ recentArticles: other: Aktuelle Artikel related: - other: Ähnliche Artikel + other: Verwandte Artikel + +related-articles: + other: Verwandte Artikel Teaser: other: Hintergrund diff --git a/i18n/en.yaml b/i18n/en.yaml index 0d79020..0d74f7f 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -1,5 +1,5 @@ # -# en.yaml 2021-11-11 +# en.yaml 2021-11-15 # about: @@ -20,6 +20,9 @@ articles-in-section: author: other: Author +child-articles: + other: Child Articles + child-topics: other: Child Topics @@ -48,6 +51,9 @@ pages: posts: other: Posts +parent-articles: + other: Parent Articles + parent-topics: other: Parent Topics @@ -60,6 +66,9 @@ recentArticles: related: other: Related Posts +related-articles: + other: Related Posts + Teaser: other: Teaser diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 1b080a7..0b38af4 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -2,8 +2,10 @@
+ {{- $parents := .Params.Topics -}} + {{- $mainWidth := or (and $parents "8") "12" -}}
-
+

{{ .Title }}

@@ -13,8 +15,10 @@
+ {{ partial "parent-topics.html" . }}
+
{{ $section := or .Section .Site.Params.homeSection "posts" }} {{ $paginator := .Paginate (where .Site.RegularPages "Section" $section) }} diff --git a/layouts/partials/list-item.html b/layouts/partials/list-item.html new file mode 100644 index 0000000..56a0edb --- /dev/null +++ b/layouts/partials/list-item.html @@ -0,0 +1,12 @@ +{{ range . -}} +
  • + {{ .Title }}   + {{ if .Date -}} + {{ .Date.Format (i18n "dateFormat") }} + {{- else if .Params.Teaser -}}{{ .Params.Teaser }} + {{- else -}}{{ .Summary }} + {{- end }} + +
  • +{{- end }} diff --git a/layouts/partials/parent-topics.html b/layouts/partials/parent-topics.html new file mode 100644 index 0000000..c34111d --- /dev/null +++ b/layouts/partials/parent-topics.html @@ -0,0 +1,22 @@ + {{- $site := .Site -}} + {{- $parents := .Params.Topics -}} + {{ with $parents -}} +
    +
    +
    +

    {{i18n "parent-topics"}}

    +
    +
    + {{ range . -}} + {{- $page := $site.GetPage (printf "/topics/%s" .) -}} + + {{ $page.Title }} + + + {{- end }} +
    +
    +
    + {{- end }} + diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index b078dcc..1018b96 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -37,26 +37,48 @@
    {{- end }} - {{ if not .Site.Params.hideRelatedArticles -}} - {{- with .Params.Topics -}} + {{ if not .Site.Params.hideParentArticles -}} + {{- $related := where .Site.RegularPages "Params.pageid" "in" .Params.parents -}} + {{- with $related -}}
    -

    {{ i18n "related" }}

    +

    {{ i18n "parent-articles" }}

    +
    +
    +
      + {{- partial "list-item" $related -}} +
    +
    +
    + {{- end -}} + {{- end }} + + {{ if not .Site.Params.hideChildArticles -}} + {{- $related := .Site.RegularPages.RelatedTo (keyVals "parents" .Params.pageid) -}} + {{- with $related -}} +
    +
    +

    {{ i18n "child-articles" }}

    +
    +
    +
      + {{- partial "list-item" $related -}} +
    +
    +
    + {{- end -}} + {{- end }} + + {{ if not .Site.Params.hideRelatedArticles -}} + {{- $related := .Site.RegularPages.RelatedIndices . "topics" -}} + {{- with $related -}} +
    +
    +

    {{ i18n "related-articles" }}

    @@ -64,28 +86,20 @@ {{- end }} {{ if not .Site.Params.hideSectionArticles -}} + {{- $section := or .Section "posts" -}} + {{- $related := first 20 (where .Site.RegularPages "Section" $section) -}} + {{- with $related -}}
    - {{- $section := or .Section "posts" -}}

    {{ or (i18n (printf "articles-in-%s" $section)) (i18n "articles-in-section") }}

    -
    {{- end }} + {{- end }}
    diff --git a/layouts/taxonomy/list.html b/layouts/taxonomy/list.html index ae27a3f..894572d 100644 --- a/layouts/taxonomy/list.html +++ b/layouts/taxonomy/list.html @@ -2,15 +2,13 @@
    - {{- $site := .Site -}} {{- $parents := .Params.Topics -}} + {{- $mainWidth := or (and $parents "8") "12" -}} {{- $children := (where (where .Site.Pages "Section" "topics") "Params.topics" "intersect" (slice .Name)) -}} - {{- $mainWidth := or (and $parents "col-md-8") "col-md-12" -}}
    - -
    +

    {{i18n .Data.Singular}}: {{ .Title }}

    @@ -32,27 +30,7 @@
    - - {{ with $parents -}} -
    -
    -
    -

    {{i18n "parent-topics"}}

    -
    -
    - {{ range . -}} - {{- $page := $site.GetPage (printf "/topics/%s" .) -}} - - {{ $page.Title }} - - - {{- end }} -
    -
    -
    - {{- end }} - + {{ partial "parent-topics.html" . }}