From a9039e1bde9cbe06b213737c508ea6917841f5d7 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Thu, 12 May 2022 17:33:12 -0700 Subject: [PATCH] Adjust image transcript approach - Use section instead of nested article - Adjust stylesheets to match above markup changes - Mention upcoming aria-details --- Makefile | 3 +- assets/css/main.css | 13 ++--- assets/css/print.css | 10 +--- content/posts/website-best-practices.gmi | 36 ++++++++------ content/posts/website-best-practices.md | 60 ++++++++++++----------- layouts/shortcodes/transcribed-image.html | 4 +- 6 files changed, 63 insertions(+), 63 deletions(-) diff --git a/Makefile b/Makefile index 71fb206..10e049f 100644 --- a/Makefile +++ b/Makefile @@ -116,7 +116,7 @@ all: test deploy .PHONY: deploy-envs deploy-envs: @$(MAKE) NO_STATIC=1 HUGO_FLAGS='--gc' USER=seirdy@envs.net WWW_ROOT=/home/seirdy/public_html GEMINI_ROOT=/home/seirdy/public_gemini HUGO_BASEURL='https://envs.net/~seirdy/' OUTPUT_DIR=public_envs hugo - @$(MAKE) NO_STATIC=1 HUGO_FLAGS='--gc' USER=seirdy@envs.net WWW_ROOT=/home/seirdy/public_html GEMINI_ROOT=/home/seirdy/public_gemini HUGO_BASEURL='https://envs.net/~seirdy/' OUTPUT_DIR=public_envs deploy + @$(MAKE) NO_STATIC=1 HUGO_FLAGS='--gc' USER=seirdy@envs.net WWW_ROOT=/home/seirdy/public_html GEMINI_ROOT=/home/seirdy/public_gemini HUGO_BASEURL='https://envs.net/~seirdy/' OUTPUT_DIR=public_envs lint-local deploy .PHONY: deploy-prod deploy-prod: @@ -126,6 +126,7 @@ deploy-prod: @$(MAKE) deploy +# linting and compression can happen in parallel .PHONY: deploy-staging deploy-staging: @$(MAKE) HUGO_BASEURL=https://staging.seirdy.one HUGO_FLAGS='--gc' DOMAIN=staging.seirdy.one USER=deploy@seirdy.one OUTPUT_DIR=public_staging clean diff --git a/assets/css/main.css b/assets/css/main.css index 745db39..f9130bc 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -199,19 +199,20 @@ kbd { /* narrow screens: remove unused figure margins * figure captions shouldn't look like regular paragraphs; there should * be some extra space. - * This does not hold true for figures in nested articles; the nested - * article should instead get the spacing. */ -article, + * This does not hold true for figures in somewhat distinct sections; the + * section should instead get the spacing. A section that constitutes a + * separate schema.org object would qualify. */ +section[itemprop="mentions"], figure { margin: 1.5em 0; } -div[itemprop="articleBody"] > article > figure { +section[itemprop="mentions"] > figure { margin: 0; } /* figcaptions should be distinct from surrounding paragraphs tho */ -article[itemtype="https://schema.org/ImageObject"] figcaption, +section[itemtype="https://schema.org/ImageObject"] figcaption, figure[itemtype="https://schema.org/ImageObject"] figcaption { contain: content; margin: 0 10%; @@ -292,7 +293,7 @@ section[role="doc-endnotes"] { } /* Contain figures that are not images. */ -:not(div[itemprop="articleBody"]) > :not(article) > figure:not([itemtype="https://schema.org/ImageObject"]) { +:not(section[itemprop="mentions"]) > figure:not([itemtype="https://schema.org/ImageObject"]) { contain: content; } diff --git a/assets/css/print.css b/assets/css/print.css index 24cc886..956b6c1 100644 --- a/assets/css/print.css +++ b/assets/css/print.css @@ -20,17 +20,9 @@ } } -/* Print: don't orphan headings - * Commented out bc most browsers don't obey this yet. */ -/* h2, */ -/* h3, */ -/* h4 { */ -/* break-after: avoid; */ -/* } */ - /* Print: don't break up self-contained items. */ figure, -article article, +section[itemprop="mentions"], li { break-inside: avoid; } diff --git a/content/posts/website-best-practices.gmi b/content/posts/website-best-practices.gmi index 12d4080..3c96f11 100644 --- a/content/posts/website-best-practices.gmi +++ b/content/posts/website-best-practices.gmi @@ -164,7 +164,7 @@ cache-control: max-age=31557600, immutable ### Inline content -In addition to HTML, CSS is also a blocking resource. You could pre-load your CSS using a "link" header. Alternatively: if your gzipped CSS is under one kilobyte, consider inlining it in the using a