1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-23 21:02:09 +00:00

Add "notes"

Short-form posts for microblogging. TODO: implement POSSE.
This commit is contained in:
Rohan Kumar 2022-05-24 16:33:16 -07:00
parent 972e025aa3
commit d409a1ba58
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
12 changed files with 99 additions and 10 deletions

View file

@ -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

View file

@ -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&nbsp;px, which should have an absolute value [below 90&nbsp;L<sup>c</sup> on the APCA lookup table](https://www.myndex.com/APCA/). I dropped my link contrast to 90&nbsp;L<sup>c</sup> 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).

View file

@ -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 <abbr title="Publish on Own Site, Syndicate Elsewhere">POSSE</abbr> these notes to the Fediverse.

View file

@ -1,3 +1,7 @@
{{ define "main" }}
{{- if eq .Page.Section "notes" -}}
{{- partial "notes.html" . -}}
{{- else -}}
{{- partial "posts.html" . -}}
{{- end -}}
{{ end }}

View file

@ -0,0 +1,29 @@
{{ define "main" }}
<main itemprop="mainEntity" class="h-feed hfeed" itemscope itemtype="https://schema.org/DataFeed">
<h1 class="p-name" itemprop="name headline" id="posts">Notes</h1>
<p>This is my microblog. These are my short informal posts, sorted by date (newest first). For longer posts, <a href="../posts.html">see my blog</a>.</p>
<p role="doc-tip">
Timestamp format: <code>YYYY-MM-DD HH:MM:SS</code>, as per <cite><a href="https://www.ietf.org/rfc/rfc3339.txt">RFC 3339</a></cite>
</p>
<ol>
{{- $posts := (where site.RegularPages "Section" "notes") -}}
{{- range $posts -}}
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" -}}
<li itemprop="dataFeedElement" itemscope itemtype="https://schema.org/DataFeedItem">
<article class="h-entry hentry" itemprop="item" itemscope itemtype="https://schema.org/SocialMediaPosting" itemid="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">
<h2 itemprop="name headline" class="p-name entry-title">
<a href="{{ .Permalink }}" itemprop="url" class="u-url url" rel="bookmark">
{{ .Title }}
</a>
</h2>
Posted <time itemprop="datePublished" class="dt-published published" datetime="{{ .Date.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02 15:04:05" }}</time>
{{- if lt .Date .Lastmod -}}
, updated <time{{ if not (.Params.evergreen) }} itemprop="dateModified" class="dt-updated updated"{{ end }} datetime="{{ .Lastmod.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Lastmod.Format "2006-01-02 15:04:05" }}</time>
{{- end }}
<div class="e-content entry-content" itemprop="articleBody">{{ .Content }}</div>
</article>
</li>
{{- end }}
</ol>
</main>
{{ end }}

View file

@ -0,0 +1,5 @@
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
---
poggies

View file

@ -0,0 +1,9 @@
{{- define "main" -}}
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" }}
<main itemprop="hasPart" itemscope itemtype="https://schema.org/SocialMediaPosting" itemid="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">
<link itemprop="isPartOf" href="{{ .Site.Params.CanonicalBaseURL }}/">
{{ partial "full-article.html" . }}
{{ partial "webmentions.html" . }}
</main>
{{ partial "prev-next.html" . -}}
{{- end }}

View file

@ -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 -}}

View file

@ -6,5 +6,7 @@ Posted <time{{ if not (.Params.evergreen) }} itemprop="dateCreated datePublished
<br>
Last updated <time itemprop="dateModified" class="dt-updated updated" datetime="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Lastmod.Format "2006-01-02" }}</time>. <a href="{{ $logURL | strings.ReplaceRE `\.md` `.gmi` }}">Changelog</a>.
{{- end }}
{{ if not (eq .Page.Section "notes") -}}
<br>
{{ partial "wordcount.html" . }}
{{ partial "wordcount.html" . -}}
{{ end }}

View file

@ -16,7 +16,7 @@
Timestamp format: <code>YYYY-MM-DD</code>, as per <cite><a href="https://www.ietf.org/rfc/rfc3339.txt">RFC 3339</a></cite> and <cite><a href="https://xkcd.com/1179/">ISO 8601</a></cite>
</p>
<ol>
{{- $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 -}}
</h3>
{{- end }}
Posted <time itemprop="datePublished" class="dt-published published" datetime="{{ .Date.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time>, updated
<time{{ if not (.Params.evergreen) }} itemprop="dateModified" class="dt-updated updated"{{ end }} datetime="{{ .Lastmod.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Lastmod.Format "2006-01-02" }}</time>
Posted <time itemprop="datePublished" class="dt-published published" datetime="{{ .Date.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time>
{{- if lt .Date .Lastmod -}}
, updated <time{{ if not (.Params.evergreen) }} itemprop="dateModified" class="dt-updated updated"{{ end }} datetime="{{ .Lastmod.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Lastmod.Format "2006-01-02" }}</time>
{{- end }}
<p class="p-summary entry-summary" itemprop="description">{{ .Description }}</p>
<p>{{- partial "wordcount.html" . -}}</p>
</article>

View file

@ -1,3 +1,7 @@
{{ $name := "post" -}}
{{- if eq .Page.Section "notes" -}}
{{- $name = "note" -}}
{{- end -}}
<aside aria-labelledby="continue-hd">
<nav aria-labelledby="continue-hd">
<h2 id="continue-hd">Continue reading</h2>
@ -6,7 +10,7 @@
<li>Previous post: <a href="{{ .Permalink }}" rel="prev">{{ .Title }}</a></li>
{{- end -}}
{{- with .NextInSection }}
<li>Next post: <a href="{{ .Permalink }}" rel="next">{{ .Title }}</a></li>
<li>Next {{ $name }}: <a href="{{ .Permalink }}" rel="next">{{ .Title }}</a></li>
{{- end }}
</ul>
</nav>

View file

@ -1,6 +1,6 @@
<section aria-labelledby="webmentions">
<h2 id="webmentions" tabindex="-1">Webmen&shy;tions</h2>
<p>This site supports <a href="https://indieweb.org/webmention">Webmentions</a>. Webmentions received for this post will appear below after I approve them. I sometimes send Webmentions to myself on behalf of linking sites that don't support them. Check the <a href="https://web.archive.org/">Wayback Machine</a> if any links are broken.</p>
<p>This site supports <a href="https://indieweb.org/webmention">Webmentions</a>. Webmentions received for this post will appear in the following list after I approve them. I sometimes send Webmentions to myself on behalf of linking sites that don't support them. Check the <a href="https://web.archive.org/">Wayback Machine</a> if any links are broken.</p>
<dl>
{{- $target := .RelPermalink | replaceRE "^/~seirdy/" "/" }}
{{ $url := printf "https://seirdy.one/webmentions/get?status=approved&target=https://seirdy.one%s" $target -}}