Search page filtering & styles

This commit is contained in:
JP Hastings-Spital 2023-09-13 08:09:38 +01:00
parent e98080dabd
commit 79ba0b4133
22 changed files with 49 additions and 50 deletions

View file

@ -105,10 +105,6 @@
.permalink a { .permalink a {
text-decoration: none; text-decoration: none;
} }
.author {
display: none;
}
} }
&-audio { &-audio {

View file

@ -1,4 +1,5 @@
--- ---
type: timeless
_build: _build:
list: never list: never
--- ---

View file

@ -10,6 +10,4 @@ tags:
--- ---
An unusual shot of the bridge for sure, but the Fort underneath, run by the National Parks service, was surprisingly fun to walk around — and what views\! An unusual shot of the bridge for sure, but the Fort underneath, run by the National Parks service, was surprisingly fun to walk around — and what views\!
[differentperspective](/tags/differentperspective) [patterns](/tags/patterns) [differentperspective](/tags/differentperspective) [patterns](/tags/patterns)

View file

@ -10,6 +10,4 @@ tags:
--- ---
New thing Tuesday\! Bollywood casting call with some of my favourite swing dancers. 💃🕺 "We need to make you look as young as possible", they said. So bye bye beard, hello face\! New thing Tuesday\! Bollywood casting call with some of my favourite swing dancers. 💃🕺 "We need to make you look as young as possible", they said. So bye bye beard, hello face\!
Also, apparently everyone gets the same, white people, makeup. 😳
Also, apparently everyone gets the same, white people, makeup. 😅

View file

@ -1,5 +1,5 @@
--- ---
title: '#sloMoBro /a @chrismhs' title: '#sloMoBro / Chris'
media: media:
- media-0.mp4 - media-0.mp4
date: "2014-03-30T13:44:37Z" date: "2014-03-30T13:44:37Z"
@ -8,4 +8,4 @@ tags:
- sloMoBro - sloMoBro
- chris - chris
--- ---
[sloMoBro](/tags/slomobro) /a [Chris](/tags/chris) [sloMoBro](/tags/slomobro) / [Chris](/tags/chris)

View file

@ -1,5 +1,5 @@
--- ---
title: '@chrismhs has organised an epic series of…' title: Chris has organised an epic series of…'
media: media:
- media-0.webp - media-0.webp
date: "2022-05-25T02:07:27Z" date: "2022-05-25T02:07:27Z"
@ -9,6 +9,4 @@ tags:
--- ---
[Chris](/tags/chris) has organised an epic series of supremely fun and spectacularly beautiful adventures for us while we're here in BC. [Chris](/tags/chris) has organised an epic series of supremely fun and spectacularly beautiful adventures for us while we're here in BC.
Today's was whale watching, and we got to see three humpbacks, one of which was fishing \(not just filter feeding\)\! A perfect way to spend our first \(\!\) cloudy day 🐳 Today's was whale watching, and we got to see three humpbacks, one of which was fishing \(not just filter feeding\)\! A perfect way to spend our first \(\!\) cloudy day 🐳

View file

@ -1,5 +1,5 @@
--- ---
title: An awesome photo my bro @chrismhs took when I… title: An awesome photo my bro Chris took when I…
media: media:
- media-0.jpg - media-0.jpg
date: "2018-01-15T22:28:11Z" date: "2018-01-15T22:28:11Z"

View file

@ -1,5 +1,5 @@
--- ---
title: Adeventure Time with @chrismhs title: Adventure Time with Chris
media: media:
- media-0.jpg - media-0.jpg
date: "2014-05-22T10:54:05Z" date: "2014-05-22T10:54:05Z"
@ -7,4 +7,4 @@ draft: false
tags: tags:
- chris - chris
--- ---
Adeventure Time with [Chris](/tags/chris) Adventure Time with [Chris](/tags/chris)

View file

@ -1,5 +1,5 @@
--- ---
title: Nerding it up with @chrismhs tonight! title: Nerding it up with Chris tonight!
media: media:
- media-0.jpg - media-0.jpg
date: "2017-10-24T18:20:17Z" date: "2017-10-24T18:20:17Z"

View file

@ -1,5 +1,5 @@
--- ---
title: '@chrismhs cooks a mean trout. Literally; look at…' title: 'Chris cooks a mean trout. Literally; look at…'
media: media:
- media-0.jpg - media-0.jpg
date: "2014-04-08T19:54:05Z" date: "2014-04-08T19:54:05Z"

View file

@ -1,5 +1,5 @@
--- ---
title: That time when @chrismhs was accidentally in… title: That time when Chris was accidentally in…
media: media:
- media-0.jpg - media-0.jpg
date: "2019-06-13T19:46:11Z" date: "2019-06-13T19:46:11Z"

View file

@ -1,5 +1,5 @@
--- ---
title: Building things with @chrismhs is the best. title: Building things with Chris is the best.
media: media:
- media-0.mp4 - media-0.mp4
date: "2017-02-05T18:44:39Z" date: "2017-02-05T18:44:39Z"

View file

@ -6,18 +6,8 @@ _build:
list: never list: never
--- ---
I quite enjoy this site _not_ having search, as it means I (and others!) need to explore it to find what's there. Having said that, I do find myself in need of finding something I _know_ is there, but which I can't put my finger on… I quite enjoy this site _not_ having search, as it means folks need to explore it to find what's there — curiosity being something I'd love to inspire in people. Having said that, I do find myself in need of finding things I _know_ are in here, but which I can't put my finger on…
Sigh, it's time for search; but I'm sneaking this away where it's not too visible, so you'll have to have previously found this to know you can put `/search` into your browser to use it 😉 Sigh, it's time for search; but I'm sneaking this away where it's not too visible, so you'll have to have previously found this to know you can put `/search` into your browser to use it 😉
<link href="/search/pagefind-ui.css" rel="stylesheet"> {{< sitesearch >}}
<script src="/search/pagefind-ui.js" type="text/javascript"></script>
<div id="search"></div>
<script>
window.addEventListener('DOMContentLoaded', (event) => {
new PagefindUI({
element: "#search",
showEmptyFilters: false,
});
});
</script>

View file

@ -10,7 +10,7 @@
</h1> </h1>
{{ if .Content }} {{ if .Content }}
<div class="content" data-pagefind-body>{{ .Content }}</div> <div class="content" data-pagefind-body data-pagefind-filter="type:{{.Type | title}}">{{ .Content }}</div>
{{ end }} {{ end }}
{{ range $paginator.Pages.GroupByDate "2006" }} {{ range $paginator.Pages.GroupByDate "2006" }}

View file

@ -1,5 +1,5 @@
{{ define "main" }} {{ define "main" }}
<main class="post h-entry"> <main class="post h-entry"{{ if eq .Type "site-infra" }} data-pagefind-ignore="all"{{ end }}>
<div class="post-info"> <div class="post-info">
{{ $dateType := "published" }} {{ $dateType := "published" }}
@ -29,7 +29,7 @@
</svg> </svg>
{{ i18n "readingTime" .Page.ReadingTime }} {{ i18n "readingTime" .Page.ReadingTime }}
</p> </p>
<p class="author h-card" aria-hidden="true"> <p class="author h-card hidden" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>
<a href="{{ .Site.BaseURL | absURL }}" rel="author" class="p-author u-url">{{ .Site.Author.name }}</a> <a href="{{ .Site.BaseURL | absURL }}" rel="author" class="p-author u-url">{{ .Site.Author.name }}</a>
</p> </p>
@ -120,7 +120,7 @@
<line x1="8" y1="2" x2="8" y2="6"></line> <line x1="8" y1="2" x2="8" y2="6"></line>
<line x1="3" y1="10" x2="21" y2="10"></line> <line x1="3" y1="10" x2="21" y2="10"></line>
</svg> </svg>
<date datetime="{{ dateFormat "2006-01-02T15:04:05-0700" $date }}" class="dt-{{ $dateType }}" title="{{ $dateType | title }} on {{ dateFormat "Monday Jan 2 2006 at 03:04 MST" $date }}"> <date datetime="{{ dateFormat "2006-01-02T15:04:05-0700" $date }}" class="dt-{{ $dateType }}" title="{{ $dateType | title }} on {{ dateFormat "Monday Jan 2 2006 at 03:04 MST" $date }}" data-pagefind-sort="date">
{{ if .Site.Params.dateformNumTime }} {{ if .Site.Params.dateformNumTime }}
{{ dateFormat .Site.Params.dateformNumTime $date }} {{ dateFormat .Site.Params.dateformNumTime $date }}
{{ else }} {{ else }}

View file

@ -1,4 +1,4 @@
<div class="about-me"> <div class="about-me" data-pagefind-body>
<div class="h-card vcard no-emoji"> <div class="h-card vcard no-emoji">
<a href="https://byjp.me" rel="me" class="u-uid u-url"><img class="profile u-photo" src="profile-512.jpg" alt="A photo of me smiling, with short brown hair, a beard and glasses." width="48" height="48"/></a> <a href="https://byjp.me" rel="me" class="u-uid u-url"><img class="profile u-photo" src="profile-512.jpg" alt="A photo of me smiling, with short brown hair, a beard and glasses." width="48" height="48"/></a>
<span class="p-note">Hello! I'm <em class="p-name fn always-accented"><span class="p-nickname">JP</span> <span class="p-family-name">Hastings-Spital</span></em>, a <span class="p-category category">maker</span>, <span class="p-category category">software engineer</span>, <span class="p-category category">swing dancer</span>, and all-round <span class="p-category category">miriscient chap</span> living in <span class="adr p-adr h-adr"><span class="p-locality locality">London</span>, <span class="p-country-name country-name">UK</span></span>. <span class="h-card no-emoji">I'm <span clas="p-job-title">principal engineer</a> at <a href="https://deliveroo.engineering/" target="_blank" class="p-org u-url" rel="noopener">Deliveroo</a></span>.</span> <span class="p-note">Hello! I'm <em class="p-name fn always-accented"><span class="p-nickname">JP</span> <span class="p-family-name">Hastings-Spital</span></em>, a <span class="p-category category">maker</span>, <span class="p-category category">software engineer</span>, <span class="p-category category">swing dancer</span>, and all-round <span class="p-category category">miriscient chap</span> living in <span class="adr p-adr h-adr"><span class="p-locality locality">London</span>, <span class="p-country-name country-name">UK</span></span>. <span class="h-card no-emoji">I'm <span clas="p-job-title">principal engineer</a> at <a href="https://deliveroo.engineering/" target="_blank" class="p-org u-url" rel="noopener">Deliveroo</a></span>.</span>

View file

@ -1,11 +1,11 @@
<figure> <figure>
{{ if hasSuffix . ".mp4" }} {{ if hasSuffix .src ".mp4" }}
<video controls loop> <video controls loop>
<source src="{{.}}" type="video/mp4"> <source src="{{.src}}" type="video/mp4">
<img src="{{ . }}.jpg" /> <img {{ if .searchmeta | default true }}data-pagefind-meta="image[src]" {{end}}src="{{ .src }}.jpg" />
(Your browser can't play videos. <a href="{{.}}">Download instead</a>.) (Your browser can't play videos. <a href="{{.src}}">Download instead</a>.)
</video> </video>
{{ else }} {{ else }}
<img src="{{ . }}" /> <img {{ if .searchmeta | default true }}data-pagefind-meta="image[src]" {{end}}src="{{ .src }}" />
{{ end }} {{ end }}
</figure> </figure>

View file

@ -19,7 +19,7 @@
<line x1="8" y1="2" x2="8" y2="6"></line> <line x1="8" y1="2" x2="8" y2="6"></line>
<line x1="3" y1="10" x2="21" y2="10"></line> <line x1="3" y1="10" x2="21" y2="10"></line>
</svg> </svg>
<date datetime="{{ dateFormat "2006-01-02T15:04:05-0700" .Lastmod }}" class="dt-updated" title="last updated on {{ dateFormat "Monday Jan 2 2006 at 03:04 MST" .Lastmod }}"> <date datetime="{{ dateFormat "2006-01-02T15:04:05-0700" .Lastmod }}" class="dt-updated" title="last updated on {{ dateFormat "Monday Jan 2 2006 at 03:04 MST" .Lastmod }}" data-pagefind-sort="date">
{{ if .Site.Params.dateformNumTime }} {{ if .Site.Params.dateformNumTime }}
{{ dateFormat .Site.Params.dateformNumTime .Lastmod }} {{ dateFormat .Site.Params.dateformNumTime .Lastmod }}
{{ else }} {{ else }}

View file

@ -3,7 +3,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-tag meta-icon"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path><line x1="7" y1="7" x2="7" y2="7"></line></svg> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-tag meta-icon"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path><line x1="7" y1="7" x2="7" y2="7"></line></svg>
{{ range . -}} {{ range . -}}
<span class="tag p-category"><a href="{{ "/tags/" | absLangURL }}{{ . | urlize }}/">{{.}}</a></span> <span class="tag p-category"><a href="{{ "/tags/" | absLangURL }}{{ . | urlize }}/" data-pagefind-sort="tag">{{.}}</a></span>
{{ end }} {{ end }}
</p> </p>
{{ end }} {{ end }}

View file

@ -1,10 +1,16 @@
{{ define "main" }} {{ define "main" }}
<main class="post instagram"> <main class="post instagram">
<article> <article>
<h1 class="post-title p-name hidden" aria-hidden="true">{{ .Title | markdownify }}</h1>
{{ with .Summary }}
<div class="post-summary p-summary" aria-hidden="true">{{ . }}</div>
{{ end }}
<div class="post-content" data-pagefind-body data-pagefind-filter="type:Photos"> <div class="post-content" data-pagefind-body data-pagefind-filter="type:Photos">
<div class="instagram-media"> <div class="instagram-media">
{{ range .Params.Media }} {{ range $i, $src := .Params.Media }}
{{ partial "imgorvid.html" . }} {{ partial "imgorvid.html" (dict "src" (path.Join $.Page.RelPermalink $src | absURL) "searchmeta" (eq $i 0)) }}
{{ end }} {{ end }}
</div> </div>
@ -29,7 +35,7 @@
<line x1="8" y1="2" x2="8" y2="6"></line> <line x1="8" y1="2" x2="8" y2="6"></line>
<line x1="3" y1="10" x2="21" y2="10"></line> <line x1="3" y1="10" x2="21" y2="10"></line>
</svg> </svg>
<date datetime="{{ dateFormat .Site.Params.dateformHTML .Date }}"> <date datetime="{{ dateFormat .Site.Params.dateformHTML .Date }}" data-pagefind-sort="date">
{{ dateFormat .Site.Params.dateformNumTime .Date }} {{ dateFormat .Site.Params.dateformNumTime .Date }}
</date> </date>
</p> </p>

View file

@ -8,7 +8,7 @@
<div class="post-summary p-summary" aria-hidden="true">{{ . }}</div> <div class="post-summary p-summary" aria-hidden="true">{{ . }}</div>
{{ end }} {{ end }}
<div class="post-content"> <div class="post-content" data-pagefind-body data-pagefind-filter="type:Poetry">
{{ if eq .Params.align "monospace" }} {{ if eq .Params.align "monospace" }}
<pre>{{.RawContent}}</pre> <pre>{{.RawContent}}</pre>
{{ else }} {{ else }}
@ -18,7 +18,7 @@
</article> </article>
<div class="post-info"> <div class="post-info">
<p><date datetime="{{ dateFormat .Site.Params.dateformHTML .Date }}">{{ dateFormat .Site.Params.dateform .Date }}</date></p> <p><date datetime="{{ dateFormat .Site.Params.dateformHTML .Date }}" data-pagefind-sort="date">{{ dateFormat .Site.Params.dateform .Date }}</date></p>
<p><a href="../">back</a></p> <p><a href="../">back</a></p>
</div> </div>

View file

@ -0,0 +1,12 @@
<link href="/search/pagefind-ui.css" rel="stylesheet" />
<style>.pagefind-ui__drawer { flex-direction: row-reverse !important }</style>
<script src="/search/pagefind-ui.js" type="text/javascript"></script>
<div id="search"></div>
<script>
window.addEventListener('DOMContentLoaded', (event) => {
new PagefindUI({
element: "#search",
showEmptyFilters: false,
});
});
</script>