From 76cf7da9ad608d71deab49747d296bf2874cda9e Mon Sep 17 00:00:00 2001 From: JP Hastings-Spital Date: Mon, 29 Apr 2024 23:25:55 +0100 Subject: [PATCH] Gemini: Homepage --- content/bookmarks/ongoing-by-tim-bray-osqi.md | 1 + content/bookmarks/playable-quotes.md | 1 + content/bookmarks/volunteer-amnesty-day.md | 1 + content/calendar/interesting-conference.md | 2 + layouts/_default/baseof.gmi | 36 +++++++++++++ layouts/_default/list.gmi | 17 ++----- layouts/_default/single.gmi | 36 ++----------- layouts/index.gmi | 51 +++++++++++++++++-- layouts/partials/intro.html | 3 ++ layouts/partials/post-previews.html | 4 +- 10 files changed, 100 insertions(+), 52 deletions(-) create mode 100644 layouts/_default/baseof.gmi create mode 100644 layouts/partials/intro.html diff --git a/content/bookmarks/ongoing-by-tim-bray-osqi.md b/content/bookmarks/ongoing-by-tim-bray-osqi.md index d2ee4c51..b5654c88 100644 --- a/content/bookmarks/ongoing-by-tim-bray-osqi.md +++ b/content/bookmarks/ongoing-by-tim-bray-osqi.md @@ -1,6 +1,7 @@ --- title: Open Source Quality Institutes date: "2024-04-03T07:43:01Z" +emoji: ๐Ÿ“ publishDate: "2024-04-01T00:00:00Z" bookmarkOf: https://www.tbray.org/ongoing/When/202x/2024/04/01/OSQI references: diff --git a/content/bookmarks/playable-quotes.md b/content/bookmarks/playable-quotes.md index f81f0d33..5f9568cb 100644 --- a/content/bookmarks/playable-quotes.md +++ b/content/bookmarks/playable-quotes.md @@ -1,6 +1,7 @@ --- date: 2024-03-01T08:41:57.157Z publishDate: 2024-03-01T08:41:57.157Z +emoji: ๐ŸŽฎ title: Playable Quotes category: - games diff --git a/content/bookmarks/volunteer-amnesty-day.md b/content/bookmarks/volunteer-amnesty-day.md index a0e3b9ec..d826f60c 100644 --- a/content/bookmarks/volunteer-amnesty-day.md +++ b/content/bookmarks/volunteer-amnesty-day.md @@ -1,6 +1,7 @@ --- date: 2024-02-23T14:55:13.977Z publishDate: 2024-02-23T14:55:13.977Z +emoji: ๐Ÿ“… title: Volunteer Amnesty Day bookmarkOf: https://www.volunteeramnestyday.net/ references: diff --git a/content/calendar/interesting-conference.md b/content/calendar/interesting-conference.md index 3e395774..a8395cfc 100644 --- a/content/calendar/interesting-conference.md +++ b/content/calendar/interesting-conference.md @@ -14,4 +14,6 @@ location: summary: Short talks about interesting things. --- +I'm actually really excited for this; I've been to similar conferences in the past and loved them. (I even ran a mini lecture series event in my lat twenties). I'm hoping to meet a whole bunch of interesting people, and be inspired by their passions! + > Short talks about interesting things. Same old same old. diff --git a/layouts/_default/baseof.gmi b/layouts/_default/baseof.gmi new file mode 100644 index 00000000..7c3bc1f6 --- /dev/null +++ b/layouts/_default/baseof.gmi @@ -0,0 +1,36 @@ +{{ block "main" . }}{{ end }} +# Postscript + +{{- $type := .Type -}} +{{- $paginateType := (partial "article-type.txt" (default "page" $type)) | pluralize -}} +{{- with .NextInSection }} +=> {{ .RelPermalink }} Next post: {{ partial "page-title.txt" . }}{{ end }} +{{- with .PrevInSection }} +=> {{ .RelPermalink }} Previous post: {{ partial "page-title.txt" . }}{{ end }} +{{ if eq .Kind "section" }}{{ with .Paginator.Next }} +=> {{ .URL }} Next page of {{ $paginateType }}{{ end }} +{{- with .Paginator.Prev }} +=> {{ .URL }} Previous page of {{ $paginateType }}{{ end }}{{ end }} +=> https://www.byjp.me{{ replace .RelPermalink "index.gmi" "" }} View this page on the WWW + +{{ $dateType := "published" -}} +{{- $date := .Date -}} +{{- if not .Date -}} + {{- $date = .Lastmod -}} + {{- $dateType := "last updated" -}} +{{- end -}} +{{- if .IsNode }}{{ $type = "page" }}{{ end -}} +This {{ partial "article-type.txt" (default "page" $type) }} was {{ $dateType }} by {{ .Params.author | default "JP" }} on **{{ $date.Format (.Site.Params.dateFormat | default "2 January 2006") }}** +{{- if not .Params.geminiAware }}, originally in markdown and _without_ Gemini in mind, so things might look a little odd!{{else}}.{{ end }} + +{{- with .Params.tags }} + +I've not quite figured out if hashtags are useful in a Gemini context, but this post was tagged with{{ range (. | sort) }} #{{ . }}{{ end -}}. +{{- end }} + +You may also want to visit: + +=> / ๐Ÿก Home +{{ range .Site.Menus.main -}} + => {{ .URL | relURL }} {{ .Name }} +{{ end -}} diff --git a/layouts/_default/list.gmi b/layouts/_default/list.gmi index f9bf271e..144321f9 100644 --- a/layouts/_default/list.gmi +++ b/layouts/_default/list.gmi @@ -1,3 +1,4 @@ +{{- define "main" -}} # {{ with .Params.emoji }}{{.}} {{end}}{{ title (replace .Title "-" " ") }} {{- with .Page.RenderShortcodes }} @@ -10,17 +11,5 @@ {{ range .Pages -}} => {{ .RelPermalink }} {{ with .Params.emoji }}{{ . }} {{ end }}{{ partial "page-title.txt" . }} {{ end -}} -{{- end }} - -# Postscript -{{ with .Paginator.Next }} -=> {{ .URL }} Next page{{ end }} -{{- with .Paginator.Prev }} -=> {{ .URL }} Previous page{{ end }} - -You may also want to visit: - -=> / ๐Ÿก Home -{{ range .Site.Menus.main -}} - => {{ .URL | relURL }} {{ .Name }} -{{ end -}} +{{- end -}} +{{- end -}} diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi index ce85e36c..0e88e976 100644 --- a/layouts/_default/single.gmi +++ b/layouts/_default/single.gmi @@ -1,39 +1,11 @@ -# {{ .Title | default (partial "page-title.txt" .) }} +{{- define "main" -}} +# {{ with .Params.emoji }}{{.}} {{end}}{{ .Title | default (partial "page-title.txt" .) }} -{{ partial "reference-to.gmi" . -}} - -{{- with .Params.media }}{{ range . -}} +{{ partial "reference-to.gmi" . }} +{{ with .Params.media }}{{ range . -}} {{- partial "image.gmi" (dict "src" .url) -}} {{- end }} {{ end -}} {{- partial "markdown.gmi" .Page.RenderShortcodes -}} -# Postscript - -=> https://www.byjp.me{{ replace .RelPermalink "index.gmi" "" }} View this page on the WWW -{{- with .NextInSection }} -=> {{ .RelPermalink }} Next post: {{ partial "page-title.txt" . }}{{ end }} -{{- with .PrevInSection }} -=> {{ .RelPermalink }} Previous post: {{ partial "page-title.txt" . }}{{ end }} - -{{ $dateType := "published" -}} -{{- $date := .Date -}} -{{- if not .Date -}} - {{- $date = .Lastmod -}} - {{- $dateType := "last updated" -}} {{- end -}} -This post was {{ $dateType }} by {{ .Params.author | default "JP" }} on **{{ $date.Format (.Site.Params.dateFormat | default "2 January 2006") }}** -{{- if not .Params.geminiAware }}, originally in markdown and _without_ Gemini in mind, so things might look a little odd!{{else}}.{{ end }} - -{{- with .Params.tags }} - -I've not quite figured out if hashtags are useful in a Gemini context, but this post was tagged with{{ range (. | sort) }} #{{ . }}{{ end -}}. -{{- end }} - -You may also want to visit: - -=> / ๐Ÿก Home -{{ range .Site.Menus.main -}} - => {{ .URL | relURL }} {{ .Name }} -{{ end -}} - diff --git a/layouts/index.gmi b/layouts/index.gmi index 3d7678e3..6a04bc7d 100644 --- a/layouts/index.gmi +++ b/layouts/index.gmi @@ -1,5 +1,50 @@ -## List of posts +{{- define "main" -}} +# byJP -{{ range .RegularPages }} -=> {{ .RelPermalink }} {{ .Title }} +{{ (partial "about-me.html" .) | plainify }} + +{{ (partial "intro.html" .) | plainify }} + +## Recent posts + +Some of my recent (and more substantial) writing. +{{ $posts := where .Site.RegularPages "Section" "in" (slice "posts" "bookmarks" "poetry") -}} +{{- range ($posts.ByPublishDate.Reverse | first 6) }} +=> {{.RelPermalink}} {{ with .Params.emoji }}{{.}} {{end}}{{- with .Title -}}{{ . }}{{ else }}{{ .Type | singularize | title }}{{ end -}} +{{- end }} + +=> /posts/ ๐Ÿ“” More posts (my longer articles) +=> /bookmarks/ ๐Ÿ”– More bookmarks (my thoughts on others' interesting writing) + +## Upcoming events + +{{ $allEvents := where .Site.RegularPages "Section" "calendar" -}} +{{- $upcomingEvents := slice -}} +{{- range $eventPage := $allEvents -}} + {{- range $eventPage.Params.timings -}} + {{- $event := dict "Title" $eventPage.Title "Page" $eventPage.Page "Date" (time.AsTime .starts) "Duration" (partial "iso8601.duration" .duration) -}} + {{- if $event.Date.Before time.Now }}{{ continue }}{{ end -}} + {{- $upcomingEvents = sort ($upcomingEvents | append $event) "Date" "asc" -}} + {{- break -}}{{/* Only show the first on the list */}} + {{- end -}} +{{- end -}} + +{{- if ge (len $upcomingEvents) 2 -}} +Maybe you'll see me at **{{ (index $upcomingEvents 0).Title }}** on {{ (partial "year-relative-date.html" (index $upcomingEvents 0).Date) | plainify }}, or **{{ (index $upcomingEvents 1).Title }}** on {{ (partial "year-relative-date.html" (index $upcomingEvents 1).Date) | plainify }}. +Get in touch if you'd like to go to these, or any other eventsโบ, together! + +=> {{ (index $upcomingEvents 0).Page.RelPermalink }} {{ (index $upcomingEvents 0).Title }} +=> {{ (index $upcomingEvents 1).Page.RelPermalink }} {{ (index $upcomingEvents 1).Title }} + +=> /calendar/ ๐Ÿ—“๏ธ My events calendar +{{ end }} +## A recent note +{{ $notePage := index (where .Site.RegularPages "Section" "eq" "notes") 0 -}} +{{ with $notePage }}{{ partial "markdown.gmi" .Page.RenderShortcodes }}{{ end }} +## Me, elsewhere + +You can find me across the world wide web; here are a handful of ways to get in touch. +{{ range .Site.Params.social }} +=> {{ .url }} {{ .name | humanize }} +{{- end -}} {{- end }} diff --git a/layouts/partials/intro.html b/layouts/partials/intro.html new file mode 100644 index 00000000..bc2e275e --- /dev/null +++ b/layouts/partials/intro.html @@ -0,0 +1,3 @@ +

+ This space is a much loved wild garden; things aren't perfectly organised, there are lots of nooks and crannies to explore. Follow your nose and see where you end up. +

\ No newline at end of file diff --git a/layouts/partials/post-previews.html b/layouts/partials/post-previews.html index 88fd27f6..31261d03 100644 --- a/layouts/partials/post-previews.html +++ b/layouts/partials/post-previews.html @@ -1,7 +1,5 @@
-

- This site is a much loved wild garden; things aren't perfectly orgnaised, there are lots of nooks and crannies to explore. Follow your nose and see where you end up. -

+ {{ partial "intro.html" }}
    {{- $posts := where .Site.RegularPages "Section" "in" (slice "posts" "bookmarks" "poetry") -}}