From d409a1ba58fdd4cecba8faf28fb14ccdf52aca45 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Tue, 24 May 2022 16:33:16 -0700 Subject: [PATCH] Add "notes" Short-form posts for microblogging. TODO: implement POSSE. --- config.toml | 18 ++++++++++++++---- content/notes/dark-theme-woes.md | 14 ++++++++++++++ content/notes/hello-notes.md | 7 +++++++ layouts/_default/list.html | 4 ++++ layouts/_default/notes.html | 29 +++++++++++++++++++++++++++++ layouts/archetypes/notes.md | 5 +++++ layouts/notes/single.html | 9 +++++++++ layouts/partials/head.html | 2 ++ layouts/partials/post-meta.html | 4 +++- layouts/partials/posts.html | 9 ++++++--- layouts/partials/prev-next.html | 6 +++++- layouts/partials/webmentions.html | 2 +- 12 files changed, 99 insertions(+), 10 deletions(-) create mode 100644 content/notes/dark-theme-woes.md create mode 100644 content/notes/hello-notes.md create mode 100644 layouts/_default/notes.html create mode 100644 layouts/archetypes/notes.md create mode 100644 layouts/notes/single.html diff --git a/config.toml b/config.toml index 729f0f5..6b38004 100644 --- a/config.toml +++ b/config.toml @@ -1,6 +1,8 @@ baseURL = "https://seirdy.one/" # just the default, I have mirrors languageCode = "en-us" title = "Seirdy's Home" +timeZone = "UTC" +summaryLength = 150 enableInlineShortcodes = true enableGitInfo = true @@ -37,36 +39,44 @@ nick = "Seirdy" url = "/posts.html" weight = 10 + [[menu.main]] + identifier = "notes" + name = "Notes" + title = "notes" + url = "/notes.html" + weight = 15 + [[menu.main]] identifier = "bookmarks" name = "Bookmarks" title = "bookmarks" url = "/bookmarks.html" - weight = 11 + weight = 20 [[menu.main]] identifier = "about" name = "About" title = "about" url = "/about.html" - weight = 20 + weight = 30 [[menu.main]] identifier = "resume" name = "Resume" title = "resume" url = "/resume.html" - weight = 30 + weight = 40 [[menu.main]] identifier = "rss" name = "RSS feed" title = "rss feed" url = "/posts/index.xml" - weight = 40 + weight = 50 [permalinks] posts = "/:year/:month/:day/:filename" +notes = "/notes/:year/:month/:day/:filename" [markup.goldmark.renderer] # Allows HTML in Markdown diff --git a/content/notes/dark-theme-woes.md b/content/notes/dark-theme-woes.md new file mode 100644 index 0000000..73654f8 --- /dev/null +++ b/content/notes/dark-theme-woes.md @@ -0,0 +1,14 @@ +--- +title: "Dark theme woes" +date: 2022-05-25T00:00:32-07:00 +--- +I try to have limited reliance on CSS media queries in favor of being inclusive by as many people as possible by default, including fingerprinting-averse readers. Unfortunately, I have concluded that it is impossible to set one single website color palette that ticks all of the following boxes: + +- Familiar: colors aren't particularly "novel" and don't impose a learning curve. The difference between a visited and unvisited link should be clear enough from the get-go. +- Friendly to various types of color blindness +- Sufficient contrast for high-contrast needs +- Autism-friendly, anxiety-friendly colors that do not trigger overstimulation or imply a warning. +- Related: sensitive to cultural norms (is red actually a "warning" to everyone?). + +I set a custom palette for my site's dark theme. Since its contrast is a bit high, I made it respond to the `prefers-contrast: less` media query. Now, My 108% body text typically renders at 17.4 px, which should have an absolute value [below 90 Lc on the APCA lookup table](https://www.myndex.com/APCA/). I dropped my link contrast to 90 Lc and my body text to something slightly higher (article body text should have at least as much contrast as link text and buttons to avoid the "piercing glare" effect interactive elements can have; I should add that to my website best practices article sometime). + diff --git a/content/notes/hello-notes.md b/content/notes/hello-notes.md new file mode 100644 index 0000000..19f131d --- /dev/null +++ b/content/notes/hello-notes.md @@ -0,0 +1,7 @@ +--- +title: Hello notes +date: "2022-05-24T23:34:50-00:00" +--- +This is first "note" on my IndieWeb Site. Notes will be shorter and less formal than typical blog posts; this is a microblog, not a typical weblog. + +Once this is working correctly, I'll need to figure out a solution to POSSE these notes to the Fediverse. diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 97af0e3..3161f9f 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,3 +1,7 @@ {{ define "main" }} +{{- if eq .Page.Section "notes" -}} +{{- partial "notes.html" . -}} +{{- else -}} {{- partial "posts.html" . -}} +{{- end -}} {{ end }} diff --git a/layouts/_default/notes.html b/layouts/_default/notes.html new file mode 100644 index 0000000..98676b7 --- /dev/null +++ b/layouts/_default/notes.html @@ -0,0 +1,29 @@ +{{ define "main" }} +
+

Notes

+

This is my microblog. These are my short informal posts, sorted by date (newest first). For longer posts, see my blog.

+

+ Timestamp format: YYYY-MM-DD HH:MM:SS, as per RFC 3339 +

+
    + {{- $posts := (where site.RegularPages "Section" "notes") -}} + {{- range $posts -}} + {{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" -}} +
  1. +
    +

    + +

    + Posted + {{- if lt .Date .Lastmod -}} + , updated {{ .Lastmod.Format "2006-01-02 15:04:05" }} + {{- end }} +
    {{ .Content }}
    +
    +
  2. + {{- end }} +
+
+{{ end }} diff --git a/layouts/archetypes/notes.md b/layouts/archetypes/notes.md new file mode 100644 index 0000000..d8f7c17 --- /dev/null +++ b/layouts/archetypes/notes.md @@ -0,0 +1,5 @@ +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +--- + +poggies diff --git a/layouts/notes/single.html b/layouts/notes/single.html new file mode 100644 index 0000000..a863089 --- /dev/null +++ b/layouts/notes/single.html @@ -0,0 +1,9 @@ +{{- define "main" -}} +{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" }} +
+ + {{ partial "full-article.html" . }} + {{ partial "webmentions.html" . }} +
+{{ partial "prev-next.html" . -}} +{{- end }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index d90c54e..101f648 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -14,6 +14,8 @@ {{ $description := .Site.Params.Description -}} {{- if .Params.description -}} {{- $description = .Params.Description -}} +{{- else if .Summary -}} + {{- $description = .Summary | replaceRE `\n` ` ` | safeHTML -}} {{- else if eq $canonicalRelPermalink "/posts.html" -}} {{- $description = "All the posts on Seirdy's Home" -}} {{- end -}} diff --git a/layouts/partials/post-meta.html b/layouts/partials/post-meta.html index b294df0..79b1eae 100644 --- a/layouts/partials/post-meta.html +++ b/layouts/partials/post-meta.html @@ -6,5 +6,7 @@ Posted {{ .Lastmod.Format "2006-01-02" }}. Changelog. {{- end }} + {{ if not (eq .Page.Section "notes") -}}
- {{ partial "wordcount.html" . }} + {{ partial "wordcount.html" . -}} + {{ end }} diff --git a/layouts/partials/posts.html b/layouts/partials/posts.html index 66e56c2..0ccbb9f 100644 --- a/layouts/partials/posts.html +++ b/layouts/partials/posts.html @@ -16,7 +16,7 @@ Timestamp format: YYYY-MM-DD, as per RFC 3339 and ISO 8601

    - {{- $posts := (where site.RegularPages "Type" "in" site.Params.mainSections) -}} + {{- $posts := (where site.RegularPages "Section" "posts") -}} {{- if not $isStandalone -}} {{- $posts = sort (where $posts "Params.featured" ">" 0) "Params.featured" -}} {{- end -}} @@ -38,8 +38,11 @@ {{- else -}} {{- end }} - Posted , updated - {{ .Lastmod.Format "2006-01-02" }} + Posted + {{- if lt .Date .Lastmod -}} + , updated {{ .Lastmod.Format "2006-01-02" }} + {{- end }} +

    {{ .Description }}

    {{- partial "wordcount.html" . -}}

    diff --git a/layouts/partials/prev-next.html b/layouts/partials/prev-next.html index fcb0dd4..bfdcd4e 100644 --- a/layouts/partials/prev-next.html +++ b/layouts/partials/prev-next.html @@ -1,3 +1,7 @@ +{{ $name := "post" -}} +{{- if eq .Page.Section "notes" -}} + {{- $name = "note" -}} +{{- end -}}