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

Add prev/next post navigation links

Also adjust some margins to eliminate cut-off elements.
This commit is contained in:
Rohan Kumar 2022-05-18 17:21:48 -07:00
parent 937369b777
commit b519c5f371
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
4 changed files with 24 additions and 3 deletions

View file

@ -77,10 +77,12 @@ html {
/* Compensate for misalignment and wasted space caused by padding /* Compensate for misalignment and wasted space caused by padding
* and margin adjustments in nav children made to meet SC 2.5.5 */ * and margin adjustments in nav children made to meet SC 2.5.5 */
header > nav, header > nav {
footer > nav {
margin: 0 0 -.75em -.25em; margin: 0 0 -.75em -.25em;
} }
footer > nav {
margin: -.75em 0 0 -.25em;
}
summary { summary {
/* The tappable region of a <summary> extends across the page. /* The tappable region of a <summary> extends across the page.
@ -277,6 +279,7 @@ picture > img {
/* WCAG Technique C25: use borders to separate sections. /* WCAG Technique C25: use borders to separate sections.
* Also use "content-visibility: auto" to improve performance by * Also use "content-visibility: auto" to improve performance by
* reducing the number of DOM nodes rendered at once. */ * reducing the number of DOM nodes rendered at once. */
aside,
footer, footer,
section[aria-labelledby="webmentions"] { section[aria-labelledby="webmentions"] {
border-top: 1px solid; border-top: 1px solid;

View file

@ -6,6 +6,9 @@
list-style: none; list-style: none;
} }
/* Hide screen-only content */
aside,
/* An un-opened summary inside an article has no use in print. /* An un-opened summary inside an article has no use in print.
* Outside an article it's used in my webring list where it has some * Outside an article it's used in my webring list where it has some
* use, see below. */ * use, see below. */

View file

@ -0,0 +1,14 @@
<aside aria-labelledby="continue-hd">
<nav aria-labelledby="continue-hd">
<h2 id="continue-hd">Continue reading</h2>
<ul>
{{- with .PrevInSection }}
<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>
{{- end }}
</ul>
</nav>
<p role="separator">That's all, folks.</p>
</aside>

View file

@ -5,4 +5,5 @@
{{ partial "full-article.html" . }} {{ partial "full-article.html" . }}
{{ partial "webmentions.html" . }} {{ partial "webmentions.html" . }}
</main> </main>
{{ end }} {{ partial "prev-next.html" . -}}
{{- end }}