searchbox shortcode/partial

This commit is contained in:
wgroeneveld 2020-05-13 14:23:59 +02:00
parent d8725b6e22
commit f2dacffab3
13 changed files with 40 additions and 32 deletions

View File

@ -1,12 +1,10 @@
--- ---
title: Over title: Hallo daar!
aliases: aliases:
- /about/ - /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 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)! 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)!

View File

@ -1,5 +1,6 @@
--- ---
title: Pricacy/cookie policy title: Pricacy/cookie policy
disablefb: true
--- ---
## Privacy en cookie policy ## Privacy en cookie policy

10
content/zoeken.md Normal file
View File

@ -0,0 +1,10 @@
---
title: Zoeken
aliases:
- /search/
disablefb: true
---
Niet gevonden wat je zocht? Probeer hier je geluk:
{{< searchresults >}}

View File

@ -1,11 +0,0 @@
---
title: Zoeken
aliases:
- /search
---
# Zoeken
> Niet gevonden wat je zocht? Probeer je geluk hier:
{{< searchbox >}}

View File

@ -74,7 +74,8 @@ window.fbtoken = "{{ .Site.Params.fbtoken }}";
<a href="https://facebook.com/redzuurdesem">Bekijk alle Facebook posts</a> &raquo; <a href="https://facebook.com/redzuurdesem">Bekijk alle Facebook posts</a> &raquo;
</h4> </h4>
</div> </div>
<hr/>
{{- partial "searchbox" . }}
{{ end }} {{ end }}

View File

@ -1,4 +1,5 @@
.post_metadata .post_metadata
padding-bottom: 2em
h1, h3 h1, h3
text-align: center !important text-align: center !important
@ -16,6 +17,7 @@
hr hr
width: 100% width: 100%
background-color: var(--theme) background-color: var(--theme)
margin: 1em 0
.post .post
@extend %narrow @extend %narrow

View File

@ -35,12 +35,14 @@
<div class='post_metadata'> <div class='post_metadata'>
<hr/> <hr/>
<h1 class='post_title'>{{ .Title }}</h1> <h1 class='post_title'>{{ .Title }}</h1>
{{ if isset .Params "date" }}
<h3> <h3>
<svg> <svg>
<use xlink:href="#calendar"></use> <use xlink:href="#calendar"></use>
</svg> </svg>
{{ .Lastmod.Format (.Site.Params.dateFormat | default "2 January 2006") }} {{ .Lastmod.Format (.Site.Params.dateFormat | default "2 January 2006") }}
</h3> </h3>
{{ end }}
<hr/> <hr/>
</div> </div>
<article class='post_content'> <article class='post_content'>

View File

@ -38,3 +38,4 @@
{{- template "_internal/pagination.html" . }} {{- template "_internal/pagination.html" . }}
{{- partial "searchbox" . }}

View File

@ -1,6 +1,8 @@
{{- $kin := (where .Site.RegularPages ".Params.tags" "intersect" .Params.tags) }}
{{ if (ne (len $kin) 0) }}
<h3>{{ i18n "moreFrom" .Site.Title }} &raquo;</h3> <h3>{{ i18n "moreFrom" .Site.Title }} &raquo;</h3>
<ul class='posts aside'> <ul class='posts aside'>
{{- $kin := (where .Site.RegularPages ".Params.tags" "intersect" .Params.tags) }}
{{- $siblings := (where $kin ".Title" "!=" .Title) }} {{- $siblings := (where $kin ".Title" "!=" .Title) }}
{{- with $siblings }} {{- with $siblings }}
{{- range first 2 . }} {{- range first 2 . }}
@ -14,3 +16,4 @@
{{- end }} {{- end }}
{{- end }} {{- end }}
</ul> </ul>
{{ end }}

View File

@ -0,0 +1,15 @@
<hr/>
<div class = 'post' style='padding-bottom: 4em'>
<article class='post_content'>
<h2>Niet gevonden wat je zocht?</h2>
<p>
Probeer hier je geluk:
</p>
<form method="get" action="/zoeken">
<input id="zoekentxt" placeholder="zuurdesembrood" name="q" type="text" style="width: 56%" />
<button type="submit" class="button" style="width: 36%">Zoeken</button>
</form>
</article>
</div>

View File

@ -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) }}
<picture class = 'nav_logo'>
<source srcset = '{{ $darkPath }}' media="(prefers-color-scheme: dark)">
<img srcset = '{{ $normalPath }}' alt = '{{ $alt }}'>
</picture>

View File

@ -14,9 +14,8 @@
</div> </div>
<script src="https://unpkg.com/lunr/lunr.js"></script> <script src="https://unpkg.com/lunr/lunr.js"></script>
<!-- Generate a list of posts so we can display them -->
{{ $p := slice }} {{ $p := slice }}
{{ range .Site.RegularPages }} {{ range (where .Site.RegularPages "Section" "!=" "") }}
{{ $post := dict "link" .RelPermalink "title" .Title "content" (substr .Plain 0 200) -}} {{ $post := dict "link" .RelPermalink "title" .Title "content" (substr .Plain 0 200) -}}
{{ $p = $p | append $post -}} {{ $p = $p | append $post -}}
{{ end }} {{ end }}

View File

@ -1,4 +0,0 @@
{{ $url := .Get 0 }}
<div class = 'video'>
<iframe src='https://www.youtube.com/embed/{{ $url }}?controls=1&rel=0'></iframe>
</div>