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

Use lists instead of <br /> when relevant

This required some style updates.
This commit is contained in:
Rohan Kumar 2022-10-19 14:42:13 -07:00
parent 170165d845
commit 04600cb92b
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
3 changed files with 34 additions and 9 deletions

View file

@ -232,14 +232,19 @@ html {
* - links that directly follow h2 without being contained in a * - links that directly follow h2 without being contained in a
* paragraph are section permalinks. */ * paragraph are section permalinks. */
/* stylelint-disable selector-max-compound-selectors -- simplest way to describe link-lists */
input, input,
summary, summary,
aside > a, /* Used for section permalinks */ aside > a, /* Used for section permalinks */
dt > a, dt > a,
li > a, :not(h1) + ul > li > a,
ol > li > a,
nav li > a,
.u-comment dd > a, .u-comment dd > a,
[itemprop="breadcrumb"] a, [itemprop="breadcrumb"] a,
[itemprop="breadcrumb"] > span { [itemprop="breadcrumb"] > span {
/* stylelint-enable selector-max-compound-selectors */
padding: .75em .25em; padding: .75em .25em;
} }
@ -338,7 +343,7 @@ html {
/* Lists of links should have some spacing so tap targets don't overlap. */ /* Lists of links should have some spacing so tap targets don't overlap. */
/* stylelint-disable selector-max-compound-selectors -- simplest way to describe link-lists */ /* stylelint-disable selector-max-compound-selectors -- simplest way to describe link-lists */
:not(nav) > ul li > a, :not(nav) > :not(h1) + ul li > a,
nav:not([itemprop="breadcrumb"]) li, nav:not([itemprop="breadcrumb"]) li,
ol li > a { ol li > a {
/* stylelint-enable selector-max-compound-selectors */ /* stylelint-enable selector-max-compound-selectors */
@ -388,8 +393,8 @@ sup {
* space to the left that's safe to tap. * space to the left that's safe to tap.
* 1.75em is the minimum required for ol numbers to fit. */ * 1.75em is the minimum required for ol numbers to fit. */
ol, ol,
ul { ul,
margin: 0; li h2 + ul {
padding-left: 1.75em; padding-left: 1.75em;
} }
@ -408,6 +413,7 @@ ul ul {
/* Step 1 to making the single-line nav: remove the bullet padding. */ /* Step 1 to making the single-line nav: remove the bullet padding. */
nav ul { nav ul {
margin: 0;
padding: 0; padding: 0;
} }
@ -531,6 +537,7 @@ samp {
/* Remove list style from data feeds. */ /* Remove list style from data feeds. */
.h-feed > ol { .h-feed > ol {
list-style-type: none; list-style-type: none;
margin: 0;
padding: 0; padding: 0;
} }

View file

@ -23,7 +23,7 @@
{{ .Title }} {{ .Title }}
</a> </a>
</h2> </h2>
{{- .Scratch.Set "noCanonical" true -}} {{- .Scratch.Set "shortMeta" true -}}
{{- partial "post-meta.html" . }} {{- partial "post-meta.html" . }}
{{- if eq .Section "notes" }} {{- if eq .Section "notes" }}
<div class="e-content entry-content" itemprop="articleBody"> <div class="e-content entry-content" itemprop="articleBody">

View file

@ -1,21 +1,39 @@
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" -}} {{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" -}}
{{- $isNotes := false -}} {{- $isNotes := false -}}
{{- $action := "Posted" -}} {{- $action := "Posted" -}}
{{- $shortMeta := false -}}
{{- $logURL := printf "%scontent/%s" .Site.Params.logUrlPrefix .File.Path -}} {{- $logURL := printf "%scontent/%s" .Site.Params.logUrlPrefix .File.Path -}}
{{- if .Scratch.Get "shortMeta" -}}
{{- $shortMeta = true -}}
{{- end -}}
{{- if or (eq .Page.Section "notes") (eq .Page.Title "Notes") -}} {{- if or (eq .Page.Section "notes") (eq .Page.Title "Notes") -}}
{{- $isNotes = true -}} {{- $isNotes = true -}}
{{- $action = "Noted" -}} {{- $action = "Noted" -}}
{{- else -}} {{- else -}}
{{- $logURL = $logURL | strings.ReplaceRE `\.md` `.gmi` -}} {{- $logURL = $logURL | strings.ReplaceRE `\.md` `.gmi` -}}
{{- end -}} {{- end -}}
{{- $needsModTime := gt (sub .Lastmod.Unix .Date.Unix) 900 -}}
{{- $needsList := or (and (not $shortMeta) $needsModTime) (not $isNotes) -}}
{{- if $needsList }}
<ul>
{{- else}}
<p> <p>
{{- $action }} <time{{ if not (.Params.evergreen) }} itemprop="dateCreated datePublished" class="dt-published published"{{ end }} datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time> by {{ partial "indieweb-author.html" -}}{{ if not (.Scratch.Get "noCanonical") }} on his <a rel="canonical" itemprop="url" class="u-url url" href="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">Website</a>{{- with .OutputFormats.Get "gemtext" -}}{{- printf " " -}}and <a rel="syndication" class="u-syndication" href="{{replace .Permalink "/gemini" "" 1 | safeURL}}">Gemini capsule</a>{{ end }}{{- end -}}. {{- end }}
{{ if $needsList }}<li>{{ end }}
{{- $action }} <time{{ if not (.Params.evergreen) }} itemprop="dateCreated datePublished" class="dt-published published"{{ end }} datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time> by {{ partial "indieweb-author.html" -}}{{ if not $shortMeta }} on his <a rel="canonical" itemprop="url" class="u-url url" href="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">Website</a>{{- with .OutputFormats.Get "gemtext" -}}{{- printf " " -}}and <a rel="syndication" class="u-syndication" href="{{replace .Permalink "/gemini" "" 1 | safeURL}}">Gemini capsule</a>{{ end }}{{- end -}}.
{{ if $needsList }}</li>{{ end }}
{{- if gt (sub .Lastmod.Unix .Date.Unix) 900 -}} {{- if gt (sub .Lastmod.Unix .Date.Unix) 900 -}}
<br /> {{ if $needsList }}<li>{{ end }}
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 }}">Changelog</a>. Last updated <time itemprop="dateModified" class="dt-updated updated" datetime="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Lastmod.Format "2006-01-02" }}</time>.{{ if not $shortMeta }} <a href="{{ $logURL }}">Changelog</a>.{{ end }}
{{ if $needsList }}</li>{{ end }}
{{- end -}} {{- end -}}
{{- if not $isNotes -}} {{- if not $isNotes -}}
<br /> {{ if $needsList }}<li>{{ else }}<br />{{ end }}
{{ partial "wordcount.html" . -}} {{ partial "wordcount.html" . -}}
{{ if $needsList }}</li>{{ end }}
{{- end -}} {{- end -}}
{{- if $needsList }}
</ul>
{{- else}}
</p> </p>
{{- end }}