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:
- /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)!

View File

@ -1,5 +1,6 @@
---
title: Pricacy/cookie policy
disablefb: true
---
## 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;
</h4>
</div>
<hr/>
{{- partial "searchbox" . }}
{{ end }}

View File

@ -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

View File

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

View File

@ -38,3 +38,4 @@
{{- 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>
<ul class='posts aside'>
{{- $kin := (where .Site.RegularPages ".Params.tags" "intersect" .Params.tags) }}
{{- $siblings := (where $kin ".Title" "!=" .Title) }}
{{- with $siblings }}
{{- range first 2 . }}
@ -14,3 +16,4 @@
{{- end }}
{{- end }}
</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>
<script src="https://unpkg.com/lunr/lunr.js"></script>
<!-- Generate a list of posts so we can display them -->
{{ $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 }}

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>