mirror of
https://github.com/by-jp/www.byjp.me.git
synced 2025-08-24 15:53:12 +01:00
List alternates (ics & RSS)
This commit is contained in:
parent
9fa87985e3
commit
978d0abca6
15 changed files with 86 additions and 21 deletions
|
@ -103,4 +103,13 @@
|
|||
|
||||
.side-by-side .post-item a {
|
||||
padding: 0.2em 0;
|
||||
}
|
||||
}
|
||||
|
||||
hgroup {
|
||||
nav {
|
||||
svg {
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -130,14 +130,9 @@ date = ["date", "publishDate", "lastmod", ":git"]
|
|||
[mediaTypes]
|
||||
[mediaTypes.'text/opml']
|
||||
suffixes = ['opml']
|
||||
[mediaTypes.'text/calendar']
|
||||
suffixes = ['ics']
|
||||
[outputFormats]
|
||||
[outputFormats.opml]
|
||||
mediaType = 'text/opml'
|
||||
baseName = 'feeds'
|
||||
[outputFormats.ics]
|
||||
isPlainText = true
|
||||
isHTML = false
|
||||
mediaType = 'text/calendar'
|
||||
[outputFormats.calendar]
|
||||
baseName = 'events'
|
||||
|
|
|
@ -3,8 +3,8 @@ title: Calendar
|
|||
emoji: 🗓️
|
||||
outputs:
|
||||
- html
|
||||
- calendar
|
||||
- rss
|
||||
- ics
|
||||
---
|
||||
|
||||
I enjoy making new friends, and hanging out with the folks I already know and love. Below is a calendar of events I'm thinking of going to — if you'd like to come with me, get in touch and perhaps we can go together!
|
||||
|
|
22
content/calendar/emfcamp.md
Normal file
22
content/calendar/emfcamp.md
Normal file
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
title: EMF Camp
|
||||
emoji: 📖
|
||||
date: 2023-12-24 13:49:16Z
|
||||
timings:
|
||||
- starts: 2024-05-30
|
||||
duration: P4D
|
||||
link: https://www.emfcamp.org/
|
||||
location:
|
||||
name: Eastnor Deer Park
|
||||
latitude: 52.03916120840042
|
||||
longitude: -2.3784384798321465
|
||||
summary: A non-profit camping festival for those with an inquisitive mind or an interest in making things.
|
||||
---
|
||||
|
||||
I'd really love to go to EMF Camp this year (it'd be my first time, despite how much I'm sure I'd like it!) but I think I'd need to offer to volunteer to get tickets, and this close to my wedding might be a bit too much at once!
|
||||
|
||||
> Electromagnetic Field is a non-profit camping festival for those with an inquisitive mind or an interest in making things: hackers, artists, geeks, crafters, scientists, and engineers.
|
||||
>
|
||||
> A temporary town of nearly three thousand like-minded people enjoying a long weekend of talks, performances, and workshops on everything from blacksmithing to biometrics, chiptunes to computer security, high altitude ballooning to lockpicking, origami to democracy, and online privacy to knitting.
|
||||
>
|
||||
> To help matters along, we provide fast internet, power to the tent, good beer, and amazing installations, entirely organised by a dedicated team of volunteers.
|
|
@ -2,3 +2,5 @@
|
|||
title: Posts
|
||||
emoji: 📔
|
||||
---
|
||||
|
||||
I write about a wide variety of topics, you may find the list of [tags](/tags) easier to peruse!
|
||||
|
|
|
@ -4,10 +4,13 @@
|
|||
<main class="posts" {{ if eq .Kind "taxonomy" }}data-pagefind-ignore{{ end }}>
|
||||
{{ partial "generic-list-header.html" . }}
|
||||
|
||||
<h1 class="p-name">
|
||||
{{ with .Params.emoji }}<span data-emoji="{{.}}"></span>{{end}}
|
||||
<a href="{{ .Permalink }}" class="noaccent u-url">{{ title (replace .Title "-" " ") }}</a>
|
||||
</h1>
|
||||
<hgroup class="post-title">
|
||||
<h1 class="p-name">
|
||||
{{ with .Params.emoji }}<span data-emoji="{{.}}"></span>{{end}}
|
||||
<a href="{{ .Permalink }}" class="noaccent u-url">{{ title (replace .Title "-" " ") }}</a>
|
||||
</h1>
|
||||
{{ partial "alternates.html" . }}
|
||||
</hgroup>
|
||||
|
||||
{{ if .Content }}
|
||||
<div class="content" data-pagefind-body data-pagefind-filter="type:{{.Type | title}}">{{ .Content }}</div>
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
{{ define "main" }}
|
||||
<main class="posts" {{ if eq .Kind "taxonomy" }}data-pagefind-ignore{{ end }}>
|
||||
{{ partial "generic-list-header.html" . }}
|
||||
|
||||
{{ partial "memex-header.html" . }}
|
||||
|
||||
<hgroup class="post-title">
|
||||
<h1 class="p-name">
|
||||
{{ with .Params.emoji }}<span data-emoji="{{.}}"></span>{{end}}
|
||||
<a href="{{ .Permalink }}" class="noaccent u-url">{{ title (replace .Title "-" " ") }}</a>
|
||||
</h1>
|
||||
</h1>
|
||||
{{ partial "alternates.html" . }}
|
||||
</hgroup>
|
||||
|
||||
{{ if .Content }}
|
||||
<div class="content" data-pagefind-body data-pagefind-filter="type:{{.Type | title}}">{{ .Content }}</div>
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
{{ define "main" }}
|
||||
<main class="post h-event">
|
||||
{{ partial "memex-header.html" . }}
|
||||
|
||||
{{ $timing := index .Params.timings 0 -}}
|
||||
{{ range .Params.timings -}}
|
||||
{{ if (time.AsTime .starts).Before time.Now -}}
|
||||
|
@ -62,8 +64,9 @@
|
|||
<polyline points="12 6 12 12 16 14"></polyline>
|
||||
</svg>
|
||||
{{ $starts := time.AsTime $timing.starts }}
|
||||
{{ $duration := ((strings.Substr $timing.duration 2) | strings.ToLower) }}
|
||||
From {{ $starts.Format "15:04" }} until {{ $starts.Add (time.ParseDuration $duration) | dateFormat "15:04 (MST)" }} (<span class="dt-duration">{{ $duration }}</span>)
|
||||
{{ $durationStr := ((strings.Substr $timing.duration 1) | strings.ToLower) }}
|
||||
{{ $duration := partial "iso8601.duration" $timing.duration }}
|
||||
From {{ $starts.Format "15:04" }} until {{ $starts.Add $duration | dateFormat "15:04 (MST)" }} (<span class="dt-duration">{{ replace $durationStr "t" "" }}</span>)
|
||||
</p>
|
||||
|
||||
{{ if .Params.attending }}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
{{ define "main" }}
|
||||
<main class="posts">
|
||||
|
||||
{{ partial "memex-header.html" . }}
|
||||
|
||||
<article>
|
||||
|
|
4
layouts/partials/alternatename.txt
Normal file
4
layouts/partials/alternatename.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
{{- if eq . "calendar"}}Calendar (.ics)
|
||||
{{- else if eq . "rss"}}Feed (RSS)
|
||||
{{- else }}Alternate
|
||||
{{- end -}}
|
10
layouts/partials/alternates.html
Normal file
10
layouts/partials/alternates.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
{{ if gt (len .OutputFormats) 1 }}
|
||||
{{ $page := .}}
|
||||
<nav>
|
||||
{{ range $page.OutputFormats }}
|
||||
{{ if ne .Rel "alternate" }}{{ continue }}{{ end }}
|
||||
{{ $link := ($page.OutputFormats.Get .Name).Permalink }}
|
||||
<a href="{{ $link | safeURL }}" title="{{ partial "alternatename.txt" .Name }}">{{ partial "svg.html" (dict "name" .Name) }}</a>
|
||||
{{ end }}
|
||||
</nav>
|
||||
{{ end }}
|
|
@ -16,7 +16,7 @@
|
|||
<line x1="10" y1="3" x2="8" y2="21"></line>
|
||||
<line x1="16" y1="3" x2="14" y2="21"></line>
|
||||
</svg>
|
||||
{{ len .Data.Pages }} posts
|
||||
{{ len .Data.Pages }} {{ if eq .Title "Calendar" }}events{{ else }}posts{{ end }}
|
||||
</p>
|
||||
<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>
|
||||
|
|
13
layouts/partials/iso8601.duration
Normal file
13
layouts/partials/iso8601.duration
Normal file
|
@ -0,0 +1,13 @@
|
|||
{{ $parts := strings.Split (strings.Substr . 1) "T" }}
|
||||
{{ $timePart := (index $parts 1 | strings.ToLower) }}
|
||||
{{ if eq $timePart "" }}{{ $timePart = "0s" }}{{ end }}
|
||||
{{ $duration := time.ParseDuration $timePart }}
|
||||
{{ $dayPart := replaceRE `^(\d+)D$` `$1` (index $parts 0) }}
|
||||
{{ with $dayPart }}
|
||||
{{ $asHours := printf "%dh" (mul (int .) 24) }}
|
||||
{{ $origin := time.Now }}
|
||||
{{ $origin.Add (time.ParseDuration $asHours) }}
|
||||
{{ $origin.Add $duration }}
|
||||
{{ $duration = $origin.Sub $origin }}
|
||||
{{ end }}
|
||||
{{ return $duration }}
|
|
@ -20,7 +20,7 @@
|
|||
{{- end }}
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
</p>
|
||||
{{ if gt (len .Data.Pages) 0 }}
|
||||
{{ if and (gt (len .Data.Pages) 0) (eq .Type "memex") }}
|
||||
<p>
|
||||
<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-hash">
|
||||
<line x1="4" y1="9" x2="20" y2="9"></line>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{- if (eq .name "hidden") -}}
|
||||
<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"><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path><line x1="1" y1="1" x2="23" y2="23"></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"><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>
|
||||
{{- else if (eq .name "amazon") -}}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M.045 18.02c.072-.116.187-.124.348-.022 3.636 2.11 7.594 3.166 11.87 3.166 2.852 0 5.668-.533 8.447-1.595l.315-.14c.138-.06.234-.1.293-.13.226-.088.39-.046.525.13.12.174.09.336-.12.48-.256.19-.6.41-1.006.654-1.244.743-2.64 1.316-4.185 1.726a17.617 17.617 0 01-10.951-.577 17.88 17.88 0 01-5.43-3.35c-.1-.074-.151-.15-.151-.22 0-.047.021-.09.051-.13zm6.565-6.218c0-1.005.247-1.863.743-2.577.495-.71 1.17-1.25 2.04-1.615.796-.335 1.756-.575 2.912-.72.39-.046 1.033-.103 1.92-.174v-.37c0-.93-.105-1.558-.3-1.875-.302-.43-.78-.65-1.44-.65h-.182c-.48.046-.896.196-1.246.46-.35.27-.575.63-.675 1.096-.06.3-.206.465-.435.51l-2.52-.315c-.248-.06-.372-.18-.372-.39 0-.046.007-.09.022-.15.247-1.29.855-2.25 1.82-2.88.976-.616 2.1-.975 3.39-1.05h.54c1.65 0 2.957.434 3.888 1.29.135.15.27.3.405.48.12.165.224.314.283.45.075.134.15.33.195.57.06.254.105.42.135.51.03.104.062.3.076.615.01.313.02.493.02.553v5.28c0 .376.06.72.165 1.036.105.313.21.54.315.674l.51.674c.09.136.136.256.136.36 0 .12-.06.226-.18.314-1.2 1.05-1.86 1.62-1.963 1.71-.165.135-.375.15-.63.045a6.062 6.062 0 01-.526-.496l-.31-.347a9.391 9.391 0 01-.317-.42l-.3-.435c-.81.886-1.603 1.44-2.4 1.665-.494.15-1.093.227-1.83.227-1.11 0-2.04-.343-2.76-1.034-.72-.69-1.08-1.665-1.08-2.94l-.05-.076zm3.753-.438c0 .566.14 1.02.425 1.364.285.34.675.512 1.155.512.045 0 .106-.007.195-.02.09-.016.134-.023.166-.023.614-.16 1.08-.553 1.424-1.178.165-.28.285-.58.36-.91.09-.32.12-.59.135-.8.015-.195.015-.54.015-1.005v-.54c-.84 0-1.484.06-1.92.18-1.275.36-1.92 1.17-1.92 2.43l-.035-.02zm9.162 7.027c.03-.06.075-.11.132-.17.362-.243.714-.41 1.05-.5a8.094 8.094 0 011.612-.24c.14-.012.28 0 .41.03.65.06 1.05.168 1.172.33.063.09.099.228.099.39v.15c0 .51-.149 1.11-.424 1.8-.278.69-.664 1.248-1.156 1.68-.073.06-.14.09-.197.09-.03 0-.06 0-.09-.012-.09-.044-.107-.12-.064-.24.54-1.26.806-2.143.806-2.64 0-.15-.03-.27-.087-.344-.145-.166-.55-.257-1.224-.257-.243 0-.533.016-.87.046-.363.045-.7.09-1 .135-.09 0-.148-.014-.18-.044-.03-.03-.036-.047-.02-.077 0-.017.006-.03.02-.063v-.06z"/></svg>
|
||||
{{- else if (eq .name "anilist") -}}
|
||||
|
@ -12,6 +12,8 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6.938 4.503c.702 0 1.34.06 1.92.188.577.13 1.07.33 1.485.61.41.28.733.65.96 1.12.225.47.34 1.05.34 1.73 0 .74-.17 1.36-.507 1.86-.338.5-.837.9-1.502 1.22.906.26 1.576.72 2.022 1.37.448.66.665 1.45.665 2.36 0 .75-.13 1.39-.41 1.93-.28.55-.67 1-1.16 1.35-.48.348-1.05.6-1.67.767-.61.165-1.252.254-1.91.254H0V4.51h6.938v-.007zM16.94 16.665c.44.428 1.073.643 1.894.643.59 0 1.1-.148 1.53-.447.424-.29.68-.61.78-.94h2.588c-.403 1.28-1.048 2.2-1.9 2.75-.85.56-1.884.83-3.08.83-.837 0-1.584-.13-2.272-.4-.673-.27-1.24-.65-1.72-1.14-.464-.49-.823-1.08-1.077-1.77-.253-.69-.373-1.45-.373-2.27 0-.803.135-1.54.403-2.23.27-.7.644-1.28 1.12-1.79.495-.51 1.063-.895 1.736-1.194s1.4-.433 2.22-.433c.91 0 1.69.164 2.38.523.67.34 1.22.82 1.66 1.4.44.586.75 1.26.94 2.02.19.75.25 1.54.21 2.38h-7.69c0 .84.28 1.632.71 2.065l-.08.03zm-10.24.05c.317 0 .62-.03.906-.093.29-.06.548-.165.763-.3.21-.135.39-.328.52-.583.13-.24.19-.57.19-.96 0-.75-.22-1.29-.64-1.62-.43-.32-.99-.48-1.69-.48H3.24v4.05H6.7v-.03zm13.607-5.65c-.352-.385-.94-.592-1.657-.592-.468 0-.855.074-1.166.238-.302.15-.55.35-.74.59-.19.24-.317.48-.392.75-.075.26-.12.5-.135.71h4.762c-.07-.75-.33-1.3-.68-1.69v.01zM6.52 10.45c.574 0 1.05-.134 1.425-.412.374-.27.554-.72.554-1.338 0-.344-.07-.625-.18-.846-.13-.22-.3-.39-.5-.512-.21-.124-.45-.21-.72-.257-.27-.053-.56-.074-.84-.074H3.23v3.44h3.29zm9.098-4.958h5.968v1.454h-5.968V5.48v.01z"/></svg>
|
||||
{{- else if (eq .name "bitbucket") -}}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M.778 1.211c-.424-.006-.772.334-.778.758 0 .045.002.09.01.134l3.263 19.811c.084.499.515.867 1.022.872H19.95c.382.004.708-.271.77-.646l3.27-20.03c.068-.418-.216-.813-.635-.881-.045-.008-.089-.011-.133-.01L.778 1.211zM14.52 15.528H9.522L8.17 8.464h7.561l-1.211 7.064z"/></svg>
|
||||
{{- else if (eq .name "calendar") -}}
|
||||
<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"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
|
||||
{{- else if (eq .name "case") -}}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21.12,4.25h0V3.74a.86.86,0,0,0-.81-.91H19.05a.86.86,0,0,0-.8.91v.51H16.54V2.33a2.2,2.2,0,0,0-2-2.33h-5a2.2,2.2,0,0,0-2,2.33V4.25H5.75V3.74A.86.86,0,0,0,5,2.83H3.71a.86.86,0,0,0-.81.91v.51h0A3.09,3.09,0,0,0,0,7.52v13.2A3.1,3.1,0,0,0,2.88,24H21.12A3.1,3.1,0,0,0,24,20.72V7.52A3.09,3.09,0,0,0,21.12,4.25ZM19,3.74a0,0,0,0,1,0,0h1.24a0,0,0,0,1,0,0v.51H19ZM8.24,2.33A1.37,1.37,0,0,1,9.51.88h5a1.37,1.37,0,0,1,1.27,1.45V4.25h-.88V2.33a.42.42,0,0,0-.39-.44h-5a.42.42,0,0,0-.39.44V4.25H8.24ZM9.9,4.25V2.77h4.2V4.25ZM3.68,3.74a0,0,0,0,1,0,0H5a0,0,0,0,1,0,0v.51H3.68Zm19.54,17a2.26,2.26,0,0,1-2.1,2.39H2.88a2.26,2.26,0,0,1-2.1-2.39V7.52a2.26,2.26,0,0,1,2.1-2.39H21.12a2.26,2.26,0,0,1,2.1,2.39Z"/></svg>
|
||||
{{- else if (eq .name "chess") -}}
|
||||
|
|
Loading…
Reference in a new issue