From f2dacffab3882c96166688dd72ce67ae06c0c287 Mon Sep 17 00:00:00 2001 From: wgroeneveld Date: Wed, 13 May 2020 14:23:59 +0200 Subject: [PATCH] searchbox shortcode/partial --- content/{over/_index.md => over.md} | 6 ++---- content/{privacy/_index.md => privacy.md} | 1 + content/zoeken.md | 10 ++++++++++ content/zoeken/_index.md | 11 ----------- layouts/index.html | 3 ++- themes/desem-swift-theme/assets/sass/_posts.sass | 2 ++ .../layouts/_default/single.html | 2 ++ .../layouts/partials/archive.html | 1 + .../desem-swift-theme/layouts/partials/aside.html | 5 ++++- .../layouts/partials/searchbox.html | 15 +++++++++++++++ .../layouts/shortcodes/picture.html | 9 --------- .../layouts/shortcodes/searchresults.html | 3 +-- .../layouts/shortcodes/video.html | 4 ---- 13 files changed, 40 insertions(+), 32 deletions(-) rename content/{over/_index.md => over.md} (93%) rename content/{privacy/_index.md => privacy.md} (98%) create mode 100644 content/zoeken.md delete mode 100644 content/zoeken/_index.md create mode 100644 themes/desem-swift-theme/layouts/partials/searchbox.html delete mode 100644 themes/desem-swift-theme/layouts/shortcodes/picture.html rename layouts/shortcodes/searchbox.html => themes/desem-swift-theme/layouts/shortcodes/searchresults.html (88%) delete mode 100644 themes/desem-swift-theme/layouts/shortcodes/video.html diff --git a/content/over/_index.md b/content/over.md similarity index 93% rename from content/over/_index.md rename to content/over.md index a8daad2..44d61aa 100644 --- a/content/over/_index.md +++ b/content/over.md @@ -1,12 +1,10 @@ --- -title: Over +title: Hallo daar! aliases: - /about/ -date: 2012-12-06T16:29:31+00:00 +disablefb: true --- -## Hallo daar! - Mijn naam is [Wouter Groeneveld][1] en mijn missie is zuurdesembrood bakken opnieuw populair maken. Mijn grootste passies zijn brood bakken en kennis delen. De vruchtbare combinatie van deze twee dingen betekende de geboorte van deze [blog](/blog) en van [het boek](/boek)! diff --git a/content/privacy/_index.md b/content/privacy.md similarity index 98% rename from content/privacy/_index.md rename to content/privacy.md index e4300ea..a46ad86 100644 --- a/content/privacy/_index.md +++ b/content/privacy.md @@ -1,5 +1,6 @@ --- title: Pricacy/cookie policy +disablefb: true --- ## Privacy en cookie policy diff --git a/content/zoeken.md b/content/zoeken.md new file mode 100644 index 0000000..493f1e1 --- /dev/null +++ b/content/zoeken.md @@ -0,0 +1,10 @@ +--- +title: Zoeken +aliases: + - /search/ +disablefb: true +--- + +Niet gevonden wat je zocht? Probeer hier je geluk: + +{{< searchresults >}} diff --git a/content/zoeken/_index.md b/content/zoeken/_index.md deleted file mode 100644 index 966a4d8..0000000 --- a/content/zoeken/_index.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Zoeken -aliases: - - /search ---- - -# Zoeken - -> Niet gevonden wat je zocht? Probeer je geluk hier: - -{{< searchbox >}} diff --git a/layouts/index.html b/layouts/index.html index 8c73f9e..7c17eef 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -74,7 +74,8 @@ window.fbtoken = "{{ .Site.Params.fbtoken }}"; Bekijk alle Facebook posts » -
+ +{{- partial "searchbox" . }} {{ end }} diff --git a/themes/desem-swift-theme/assets/sass/_posts.sass b/themes/desem-swift-theme/assets/sass/_posts.sass index 9bdcd81..04532e1 100644 --- a/themes/desem-swift-theme/assets/sass/_posts.sass +++ b/themes/desem-swift-theme/assets/sass/_posts.sass @@ -1,4 +1,5 @@ .post_metadata + padding-bottom: 2em h1, h3 text-align: center !important @@ -16,6 +17,7 @@ hr width: 100% background-color: var(--theme) + margin: 1em 0 .post @extend %narrow diff --git a/themes/desem-swift-theme/layouts/_default/single.html b/themes/desem-swift-theme/layouts/_default/single.html index b9ea22c..455c4b5 100644 --- a/themes/desem-swift-theme/layouts/_default/single.html +++ b/themes/desem-swift-theme/layouts/_default/single.html @@ -35,12 +35,14 @@

{{ .Title }}

+ {{ if isset .Params "date" }}

{{ .Lastmod.Format (.Site.Params.dateFormat | default "2 January 2006") }}

+ {{ end }}
diff --git a/themes/desem-swift-theme/layouts/partials/archive.html b/themes/desem-swift-theme/layouts/partials/archive.html index 307c963..9bce373 100644 --- a/themes/desem-swift-theme/layouts/partials/archive.html +++ b/themes/desem-swift-theme/layouts/partials/archive.html @@ -38,3 +38,4 @@ {{- template "_internal/pagination.html" . }} +{{- partial "searchbox" . }} \ No newline at end of file diff --git a/themes/desem-swift-theme/layouts/partials/aside.html b/themes/desem-swift-theme/layouts/partials/aside.html index da84dfe..29e0d9a 100644 --- a/themes/desem-swift-theme/layouts/partials/aside.html +++ b/themes/desem-swift-theme/layouts/partials/aside.html @@ -1,6 +1,8 @@ +{{- $kin := (where .Site.RegularPages ".Params.tags" "intersect" .Params.tags) }} + +{{ if (ne (len $kin) 0) }}

{{ i18n "moreFrom" .Site.Title }} »

+{{ end }} \ No newline at end of file diff --git a/themes/desem-swift-theme/layouts/partials/searchbox.html b/themes/desem-swift-theme/layouts/partials/searchbox.html new file mode 100644 index 0000000..e604265 --- /dev/null +++ b/themes/desem-swift-theme/layouts/partials/searchbox.html @@ -0,0 +1,15 @@ +
+
+
+

Niet gevonden wat je zocht?

+ +

+ Probeer hier je geluk: +

+ +
+ + +
+
+
\ No newline at end of file diff --git a/themes/desem-swift-theme/layouts/shortcodes/picture.html b/themes/desem-swift-theme/layouts/shortcodes/picture.html deleted file mode 100644 index 0949bb8..0000000 --- a/themes/desem-swift-theme/layouts/shortcodes/picture.html +++ /dev/null @@ -1,9 +0,0 @@ -{{- $normal := .Get 0 }} -{{- $dark := .Get 1 }} -{{- $alt := .Get 2 }} -{{- $normalPath := absURL (printf "images/%s" $normal) }} -{{- $darkPath := absURL (printf "images/%s" $dark) }} - diff --git a/layouts/shortcodes/searchbox.html b/themes/desem-swift-theme/layouts/shortcodes/searchresults.html similarity index 88% rename from layouts/shortcodes/searchbox.html rename to themes/desem-swift-theme/layouts/shortcodes/searchresults.html index fd249bc..40c60c0 100644 --- a/layouts/shortcodes/searchbox.html +++ b/themes/desem-swift-theme/layouts/shortcodes/searchresults.html @@ -14,9 +14,8 @@ - {{ $p := slice }} -{{ range .Site.RegularPages }} +{{ range (where .Site.RegularPages "Section" "!=" "") }} {{ $post := dict "link" .RelPermalink "title" .Title "content" (substr .Plain 0 200) -}} {{ $p = $p | append $post -}} {{ end }} diff --git a/themes/desem-swift-theme/layouts/shortcodes/video.html b/themes/desem-swift-theme/layouts/shortcodes/video.html deleted file mode 100644 index 5f29d66..0000000 --- a/themes/desem-swift-theme/layouts/shortcodes/video.html +++ /dev/null @@ -1,4 +0,0 @@ -{{ $url := .Get 0 }} -
- -