Add calendar & todo

Adds a simple calendar section, including ICS file created from contents.

Includes a couple of TODOs for this.
This commit is contained in:
JP Hastings-Spital 2023-12-22 16:06:01 +00:00
parent ed3550f21f
commit aa931ed39c
12 changed files with 334 additions and 0 deletions

1
.gitattributes vendored Normal file
View file

@ -0,0 +1 @@
layouts/calendar/list.ics text eol=crlf

13
archetypes/calendar.md Normal file
View file

@ -0,0 +1,13 @@
---
title: "{{ replace .Name "-" " " | title }}"
emoji: ❓
date: {{ .Date }}
timings:
- starts: 2024-01-01T00:00Z
duration: P1H
link: https://...
location:
name:
latitude:
longitude:
---

View file

@ -130,7 +130,14 @@ 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'
baseName = 'events'

View file

@ -0,0 +1,10 @@
---
title: Calendar
emoji: 🗓️
outputs:
- html
- 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!

View file

@ -0,0 +1,20 @@
---
title: The Cable Street Rag Band
emoji: 🎻
date: 2023-12-22T12:27:13Z
timings:
- starts: 2023-12-21T20:30:00Z
duration: PT5H
link: https://www.ewanbleach.com/events/557688l959gl8pa-dflnz-2sykl-frkxa-f5p58-m2d3p-dybs2-kwew8-tjls6-94w7t-hytj4-mzjhe-z8zkw-f6hk4-x79yn-wlynt-6jtnm-tkwj3-rbyyk-pb4xx-bbdsh-35xpf-erye2-2nlxy-4cz4b-pme3d-gsb28
location:
name: Jamboree
latitude: 51.53052698618849
longitude: -0.1196719819977664
summary: A rag & swing band play jazz into the early hours.
---
The Cable Street Rag Bands Thursday night residency at Jamboree. 1920s and 30s jazz and swing all night long with a jam session from 11:30 - 12:30.
[Get your tickets here](https://www.wegottickets.com/event/598828/)
[More Info](https://www.jamboreevenue.co.uk/events/limehouse-de-reverie-with-the-cable-street-rag-band-27/)

View file

@ -0,0 +1,18 @@
---
title: Whiskey Moon Face
emoji: 🪗
date: 2023-12-22T12:27:13Z
timings:
- starts: 2023-12-23T20:00:00Z
duration: PT3H
link: https://www.ewanbleach.com/events/2023/3/22/whiskey-moon-face-the-harrison-xgdwl-f9bnn-rhhjc-pxk77
location:
name: Larry's Live at the National Portrait Gallery
latitude: 51.50918934310175
longitude: -0.12754071312701715
summary: A delightful folk music band play in a cocktail bar at the national portrait gallery.
---
Hidden behind a secret entrance on Charing Cross Road, Larrys is our brand-new underground cocktail bar located in the historic vaults of the National Portrait Gallery. Originally built as coal storage in 1896, the spectacular exposed brick space has been transformed offering a slice of elegance deep into the evening (seven days a week), just a short stroll from Covent Garden and Trafalgar Square. Sip on classic cocktails and dine on lavish bar snacks, amidst over 100 portraits of the famous faces of Londons West End.
[More Info](https://www.daisygreenfood.com/location-larrys)

View file

@ -0,0 +1,17 @@
---
title: Interesting 2024
emoji: ✨
date: 2023-12-22T13:31:40Z
timings:
- starts: 2024-05-15T19:00:00+0100
duration: PT5H
link: https://www.eventbrite.com/e/interesting-2024-tickets-780721006547
location:
name: Conway Hall
latitude: 51.51972123177939
longitude: -0.11838331781213689
summary: Short talks about interesting things.
attending: true
---
Short talks about interesting things. Same old same old.

View file

@ -0,0 +1,22 @@
---
title: Radical Left, LSE Library Archives Drop-in Session
emoji: 📖
date: 2023-12-22T12:27:13Z
timings:
- starts: 2024-01-24T16:00:00Z
duration: PT3H
link: https://www.lse.ac.uk/library/events/general/lse-library-archives-drop-in-session
location:
name: LSE Library Gallery
latitude: 51.514664134157435
longitude: -0.11572255524925255
summary: A tour of the development of Britain's radical left, told through the LSE Library's collection.
---
Join us for an early evening sneak peek at the archives related to the radical left.
Drop in to see some of our flagship collections on the theme of the early development of the British Left. On display will be items from anti-fascist activism, the Independent Labour Party, the Social Democratic Federation, anarchism, strikes, protests, and much more!
You can also learn more from our friendly team of curators and archivists who will be on hand to answer any questions and talk more about using archives and special collections in your teaching, research or for personal interest.
Book a place to register your interest and receive reminders about the day or just drop in and stay as long as you like!

View file

@ -0,0 +1,44 @@
{{ define "main" }}
<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>
{{ if .Content }}
<div class="content" data-pagefind-body data-pagefind-filter="type:{{.Type | title}}">{{ .Content }}</div>
{{ end }}
{{ $events := dict }}
{{ range $page := .Data.Pages }}
{{ range $page.Params.timings }}
{{ $event := dict "Title" $page.Title "Page" $page.Page "Date" (time.AsTime .starts) }}
{{ $bundle := $event.Date.Format "Jan 2006" }}
{{ $events = merge $events (dict $bundle (sort ((index $events $bundle) | append $event) "Date" "asc")) }}
{{ end }}
{{ end }}
{{ range $key, $bundledEvents := $events }}
<div class="posts-group">
<div class="post-year">{{ $key }}</div>
<ul class="posts-list">
{{ range $bundledEvents }}
<li class="post-item">
<a href="{{.Page.Permalink}}">
{{ if .Page.Params.emoji }}<span class="post-emoji">{{ .Page.Params.emoji }}</span>{{ end }}
<span class="post-title">{{.Page.Title}}</span>
<span class="post-day">
{{ .Date.Format "Jan 2"}} {{ if or (lt (.Date.Format "15") 9) (gt (.Date.Format "15") 17) }}🌙{{ else }}🌞{{ end }}
</span>
</a>
</li>
{{ end }}
</ul>
</div>
{{ end }}
{{ partial "pagination-list.html" . }}
</main>
{{ end }}

21
layouts/calendar/list.ics Normal file
View file

@ -0,0 +1,21 @@
BEGIN:VCALENDAR
CALSCALE:GREGORIAN
VERSION:2.0
PRODID:-//www.byjp.me
{{- range .Data.Pages}}
BEGIN:VEVENT
UID:byjp{{replace .Page.RelPermalink "/" "-"}}
DTSTAMP:{{ .Page.Date.UTC.Format "20060102T150405Z" }}
{{ with (index .Params.timings 0) -}}
DTSTART:{{ (time.AsTime .starts).UTC.Format "20060102T150405Z" }}
DURATION:{{ .duration }}
{{ end -}}
LOCATION:{{.Page.Params.location.name}}
GEO:{{.Page.Params.location.latitude}};{{.Page.Params.location.longitude}}
SUMMARY:{{.Page.Title}}
DESCRIPTION:{{ .Page.Summary }}
URL:{{.Page.Params.link}}
ATTENDEE;CUTYPE=INDIVIDUAL;CN={{site.Author.name}};PARTSTAT={{ if .Page.Params.attending }}ACCEPTED{{else}}NEEDS-ACTION{{end}}:MAILTO:{{ site.Author.email}}
END:VEVENT
{{- end }}
END:VCALENDAR

View file

@ -0,0 +1,156 @@
{{ define "main" }}
<main class="post h-entry">
<div class="post-info">
{{ $dateType := "published" }}
{{ $date := .Date}}
{{ if not .Date }}
{{ $date = .Lastmod }}
{{ $dateType := "updated" }}
{{ end }}
{{ if .Lastmod }}
<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-calendar">
<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>
{{ if eq $dateType "updated" }}Last updated {{ end }}
{{ if eq $dateType "published" }}Published on {{ end }}
{{ partial "year-relative-date.html" $date }}
</p>
{{ end }}
<p class="reading-time">
<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-clock">
<circle cx="12" cy="12" r="10"></circle>
<polyline points="12 6 12 12 16 14"></polyline>
</svg>
{{ i18n "readingTime" .Page.ReadingTime }}
</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>
<a href="{{ .Site.BaseURL | absURL }}" rel="author" class="p-author u-url">{{ .Site.Author.name }}</a>
</p>
</div>
<article>
<hgroup class="post-title">
<h1 class="p-name">
{{ with .Params.emoji }}<span data-emoji="{{.}}"></span>{{end}}
<a href="{{ .Permalink }}" class="noaccent u-url">{{ .Title | markdownify }}</a>
</h1>
{{ with .Params.Subtitle }}
<h2 class="post-subtitle">{{ . | markdownify }}</h2>
{{ end }}
</hgroup>
{{ with .Summary }}
<div class="post-summary p-summary" aria-hidden="true">{{ . }}</div>
{{ end }}
{{ if .Params.Cover }}
<figure class="post-cover">
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Title }}" />
{{ if .Params.CoverCaption }}
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
{{ end }}
</figure>
{{ end }}
{{- if .Params.toc }}
<hr />
<aside id="toc">
<div class="toc-title">{{ i18n "tableOfContents" }}</div>
{{ .TableOfContents }}
</aside>
<hr />
{{- end }}
{{ if .Params.Audio }}
<div class="post-audio">
<audio controls>
<source src="{{ .Params.Audio }}">
</audio>
</div>
{{ end }}
{{ if .Page.Store.Get "hasSpoilers" }}
<blockquote class="spoiler-explainer">
{{ partial "svg.html" (dict "name" "hidden") }} This post contains spoilers, but they're hidden by default.
</blockquote>
{{ end }}
<div class="post-content e-content" data-pagefind-body data-pagefind-filter="type:{{.Type | title}}">
{{ .Content }}
</div>
</article>
<hr />
{{ if ne .Type "site-infra" }}
<div class="post-info">
{{ partial "tags.html" .Params.tags }}
{{ partial "series-tags.html" . }}
<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-file-text">
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
<polyline points="14 2 14 8 20 8"></polyline>
<line x1="16" y1="13" x2="8" y2="13"></line>
<line x1="16" y1="17" x2="8" y2="17"></line>
<polyline points="10 9 9 9 8 9"></polyline>
</svg>
{{ i18n "wordCount" .Page.WordCount }}
</p>
{{ if in .Params.tags "from-tumblr" }}
<p>
<svg class="feather" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="-11 -11 282 282"><path fill="none" stroke="currentColor" stroke-width="22" d="M210.86 197.54a5 5 0 0 0-5.12.23c-11.62 7.64-23.4 11.5-35.02 11.5-6.24 0-11.6-1.39-16.41-4.27-3.27-1.93-6.31-5.32-7.4-8.26-1.06-2.8-1.05-10.33-1.03-20.75v-63.54h52.8a5 5 0 0 0 5-5V62.8a5 5 0 0 0-5-5h-52.8V5a5 5 0 0 0-5-5h-35.56a5 5 0 0 0-4.97 4.4c-1.48 12.23-4.25 22.38-8.24 30.2a63.66 63.66 0 0 1-15.65 19.92c-5.2 4.44-14.12 8.73-26.5 12.77a5 5 0 0 0-3.44 4.75v35.41a5 5 0 0 0 5 5h28.95v82.67c0 12.18 1.3 21.34 3.95 28.02 2.71 6.79 7.52 13.18 14.3 19 6.68 5.71 14.8 10.18 24.16 13.3 9.09 2.96 16.32 4.56 28.51 4.56 10.31 0 20.14-1.07 29.22-3.18 8.92-2.08 19.01-5.76 30-10.93a5 5 0 0 0 2.88-4.53v-39.41a5 5 0 0 0-2.63-4.4z"/></svg>
From <a href="/tags/from-tumblr">tumblr archive</a>
</p>
{{ end }}
{{ if .Lastmod }}
<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-calendar">
<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>
<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 }}
{{ dateFormat .Site.Params.dateformNumTime $date }}
{{ else }}
{{ dateFormat "2006-01-02 15:04" $date }}
{{ end }}
</date>
</p>
{{ end }}
</div>
<hr />
<div class="syndication">
{{ partial "syndication.html" . }}
</div>
{{ partial "pagination-single.html" . }}
{{ end }}
{{ if .Page.Store.Get "hasMermaid" }}
<script src="/js/mermaid.js"></script>
<script>
// TODO: Render mermaid server side
function initMermaid() {
const dark = (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches);
mermaid.initialize({ startOnLoad: true, theme: dark ? 'dark' : 'neutral' });
}
// https://github.com/mermaid-js/mermaid/issues/1945
// window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', initMermaid);
initMermaid();
</script>
{{ end }}
</main>
{{ end }}

5
todo.md Normal file
View file

@ -0,0 +1,5 @@
Add single.html for Calendar
Support repeating calendar events
Handle long lines
Ensure ICS files have CRLF endings {cm:2023-12-22}