From 781f910f99e9adc05515241ee49b0dc62d89a615 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Tue, 3 May 2022 21:30:20 -0700 Subject: [PATCH] POSH: replace some divs with
s, add

- Put webmention list items in

- make doc-endnotes a section again - make doc-preface a section with a heading apart from the TOC. --- content/posts/website-best-practices.md | 5 ++- layouts/partials/full-article.html | 18 ++++---- layouts/partials/processed-content.html | 14 ++++++- layouts/partials/webmentions.html | 56 +++++++++++++------------ 4 files changed, 54 insertions(+), 39 deletions(-) diff --git a/content/posts/website-best-practices.md b/content/posts/website-best-practices.md index f8ba7f4..3916819 100644 --- a/content/posts/website-best-practices.md +++ b/content/posts/website-best-practices.md @@ -17,7 +17,8 @@ sitemap: featured: true title: Best practices for inclusive textual websites --- -

+
+

Before you begin

The following applies to minimal websites that focus primarily on text. It does not apply to websites that have a lot of non-textual content. It also does not apply to websites that focus more on generating revenue or pleasing investors than being inclusive. @@ -25,7 +26,7 @@ This is a "living document" that I add to as I receive feedback. See the updated

If you find the article too long, just read the introduction and conclusion. The table of contents should help you skim.

-
+
{{}} diff --git a/layouts/partials/full-article.html b/layouts/partials/full-article.html index 07d2349..8ee624b 100644 --- a/layouts/partials/full-article.html +++ b/layouts/partials/full-article.html @@ -1,10 +1,10 @@
-
-

{{ .Title }}

- {{ partial "post-meta.html" . }} -
-
-
- {{ partial "processed-content" . -}} -
-
+
+

{{ .Title }}

+ {{ partial "post-meta.html" . }} +
+
+
+ {{ partial "processed-content" . -}} +
+ diff --git a/layouts/partials/processed-content.html b/layouts/partials/processed-content.html index b68130c..85863ae 100644 --- a/layouts/partials/processed-content.html +++ b/layouts/partials/processed-content.html @@ -10,9 +10,19 @@ --> {{- $referencesWithoutHeading := `(

)` -}} -{{- $referencesWithHeading := printf `
+{{- $referencesWithHeading := printf `

%s

` ($footnote_heading) -}} +{{- $endnotesClosingDiv := `

+ + +
` -}} + +{{- $endnotesClosingSection := printf `

+ + +` -}} + {{- $endnote := `(role="doc-endnote"|class="footnote-(back)?ref")` -}} {{- $noEndnote := printf "" -}} @@ -28,4 +38,4 @@ {{- $repeatedFootnoteBacklinksBad := `` -}} {{- $repeatedFootnoteBacklinksGood := `` -}} -{{- .Content | replaceRE $referencesWithoutHeading $referencesWithHeading | replaceRE $endnote $noEndnote | replaceRE $tocHeadingOutside $tocHeadingInside | replaceRE $footnoteBacklinksBad $footnoteBacklinksGood | replaceRE $repeatedFootnoteBacklinksBad $repeatedFootnoteBacklinksGood | safeHTML -}} +{{- .Content | replaceRE $referencesWithoutHeading $referencesWithHeading | replaceRE $endnotesClosingDiv $endnotesClosingSection | replaceRE $endnote $noEndnote | replaceRE $tocHeadingOutside $tocHeadingInside | replaceRE $footnoteBacklinksBad $footnoteBacklinksGood | replaceRE $repeatedFootnoteBacklinksBad $repeatedFootnoteBacklinksGood | safeHTML -}} diff --git a/layouts/partials/webmentions.html b/layouts/partials/webmentions.html index a7885dc..6887904 100644 --- a/layouts/partials/webmentions.html +++ b/layouts/partials/webmentions.html @@ -8,36 +8,40 @@ {{ range $webmentions -}} {{ $webmention := . -}} {{ if (eq $webmention.type "like") -}} -
  • +
  • {{- else -}} -
  • +
  • {{- end }} - -
    - {{ if (eq $webmention.type "like") -}} - {{- if $webmention.author_name -}} - {{ $webmention.author_name }} - {{- else if $webmention.title -}} - {{ $webmention.title -}} - {{- else -}} - {{ $webmention.source -}} - {{- end }} -
    liked this - {{- else -}} - - {{- if $webmention.title -}} - {{- $webmention.title | truncate 200 -}} - {{- else -}} - {{- $webmention.source | strings.TrimPrefix "https://" | strings.TrimPrefix "www." | strings.TrimRight "/" | truncate 35 -}} - {{- end -}} - - {{- if $webmention.author_name }} +

    + +
    + {{ if (eq $webmention.type "like") -}} + {{ if $webmention.author_name -}} + {{ $webmention.author_name }} + {{ else if $webmention.title -}} + {{ $webmention.title -}} + {{ else -}} + {{ $webmention.source -}} + {{ end -}} + liked this + {{ else -}} + + + {{ if $webmention.title -}} + {{ $webmention.title | truncate 200 -}} + {{ else -}} + {{- $webmention.source | strings.TrimPrefix "https://" | strings.TrimPrefix "www." | strings.TrimRight "/" | truncate 35 -}} + {{ end }} + + + {{- if $webmention.author_name }} by - {{- end -}} - {{- end }} -

  • + {{- end -}} + {{- end }} +

    + {{ else -}} -
  • This post doesn't have any approved Webmentions yet.

  • +
  • This post doesn't have any approved Webmentions yet.

  • {{- end }}