1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-27 14:12: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
* paragraph are section permalinks. */
/* stylelint-disable selector-max-compound-selectors -- simplest way to describe link-lists */
input,
summary,
aside > a, /* Used for section permalinks */
dt > a,
li > a,
:not(h1) + ul > li > a,
ol > li > a,
nav li > a,
.u-comment dd > a,
[itemprop="breadcrumb"] a,
[itemprop="breadcrumb"] > span {
/* stylelint-enable selector-max-compound-selectors */
padding: .75em .25em;
}
@ -338,7 +343,7 @@ html {
/* 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 */
:not(nav) > ul li > a,
:not(nav) > :not(h1) + ul li > a,
nav:not([itemprop="breadcrumb"]) li,
ol li > a {
/* stylelint-enable selector-max-compound-selectors */
@ -388,8 +393,8 @@ sup {
* space to the left that's safe to tap.
* 1.75em is the minimum required for ol numbers to fit. */
ol,
ul {
margin: 0;
ul,
li h2 + ul {
padding-left: 1.75em;
}
@ -408,6 +413,7 @@ ul ul {
/* Step 1 to making the single-line nav: remove the bullet padding. */
nav ul {
margin: 0;
padding: 0;
}
@ -531,6 +537,7 @@ samp {
/* Remove list style from data feeds. */
.h-feed > ol {
list-style-type: none;
margin: 0;
padding: 0;
}

View file

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

View file

@ -1,21 +1,39 @@
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" -}}
{{- $isNotes := false -}}
{{- $action := "Posted" -}}
{{- $shortMeta := false -}}
{{- $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") -}}
{{- $isNotes = true -}}
{{- $action = "Noted" -}}
{{- else -}}
{{- $logURL = $logURL | strings.ReplaceRE `\.md` `.gmi` -}}
{{- end -}}
{{- $needsModTime := gt (sub .Lastmod.Unix .Date.Unix) 900 -}}
{{- $needsList := or (and (not $shortMeta) $needsModTime) (not $isNotes) -}}
{{- if $needsList }}
<ul>
{{- else}}
<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 -}}
<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 }}">Changelog</a>.
{{ 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>.{{ if not $shortMeta }} <a href="{{ $logURL }}">Changelog</a>.{{ end }}
{{ if $needsList }}</li>{{ end }}
{{- end -}}
{{- if not $isNotes -}}
<br />
{{ if $needsList }}<li>{{ else }}<br />{{ end }}
{{ partial "wordcount.html" . -}}
{{ if $needsList }}</li>{{ end }}
{{- end -}}
{{- if $needsList }}
</ul>
{{- else}}
</p>
{{- end }}