From ade244c72af62827c4c30151404abf755597f243 Mon Sep 17 00:00:00 2001 From: Arne Rief Date: Mon, 1 Sep 2025 21:57:30 +0200 Subject: Search & socials --- layouts/_default/list.html | 28 +++++++++++------- layouts/_default/search.html | 69 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 11 deletions(-) create mode 100644 layouts/_default/search.html (limited to 'layouts/_default') diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 8ff9b18..d3d2d99 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,28 +1,34 @@ {{- define "main" }} -
-
-

+
+
+

{{ .Title }}

+ {{- with .Content }} +
+ {{ . }} +
+ {{- else }} {{- $description := or .Description .Summary (lang.Translate "list.default_description" .Title | default (printf "All posts in %s" .Title)) }} -

- {{ $description }} -

+

+ {{ $description }} +

+ {{- end }}
-
+
{{- /* 20 posts per site */ -}} {{- $paginator := .Paginate .Pages 20 }} {{- with $paginator.Pages }} -
    +
      {{- range . }} -
    • +
    • {{- partial "list/post-card.html" . }}
    • {{- end }}
    - {{- else }} -

    + {{ else }} +

    {{ lang.Translate "list.empty" | default "No posts found in this section." }}

    {{- end }} diff --git a/layouts/_default/search.html b/layouts/_default/search.html new file mode 100644 index 0000000..569cc9a --- /dev/null +++ b/layouts/_default/search.html @@ -0,0 +1,69 @@ +{{ define "main" }} +
    +
    +

    + {{ .Title }} +

    + {{- with .Content }} +
    + {{ . }} +
    + {{- else }} + {{- $description := or .Description (lang.Translate "search.description" | default "Find posts by search term.") }} +

    + {{ $description }} +

    + {{- end }} +
    + +
    + + +
    + +
    + + + + + {{- /* Hidden template, used for hydrating search results from index.json with JS */ -}} + + +
    +
    +{{ end }} -- cgit v1.2.3