From 1e7b2008e8b1e209a06fa027203834b6345d0da7 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Tue, 29 Dec 2020 13:12:57 -0800 Subject: [PATCH] Indieweb: add u-photo and h-entry where relevant Inspired by the h-entry implementation on Charlie Owen's personal website: https://whalecoiner.com The u-photo re-uses the 32px favicon that the browser has already cached, so it shouldn't bloat up the page anymore. These changes required a bit of additional CSS. I snuck in come color changes too. --- .hintrc | 9 ++++++++- content/_index.md | 4 ++-- layouts/partials/indieweb-author.html | 1 + layouts/partials/indieweb-icon.html | 1 + layouts/shortcodes/indieweb-author.html | 4 ++++ layouts/shortcodes/indieweb-icon.html | 3 +++ themes/etch-custom/assets/css/dark.css | 10 ++++++++-- themes/etch-custom/assets/css/main.css | 11 +++++++++-- themes/etch-custom/layouts/_default/single.html | 4 ++-- themes/etch-custom/layouts/partials/header.html | 2 +- 10 files changed, 39 insertions(+), 10 deletions(-) create mode 120000 layouts/partials/indieweb-author.html create mode 120000 layouts/partials/indieweb-icon.html create mode 100644 layouts/shortcodes/indieweb-author.html create mode 100644 layouts/shortcodes/indieweb-icon.html diff --git a/.hintrc b/.hintrc index a271d22..476e17c 100644 --- a/.hintrc +++ b/.hintrc @@ -15,7 +15,14 @@ "hints": { "apple-touch-icons": "off", "axe/other": "error", - "compat-api/css": "error", + "compat-api/css": [ + "error", + { + "ignore": [ + "filter" + ] + } + ], "compat-api/html": [ "error", { diff --git a/content/_index.md b/content/_index.md index 883ee0e..badcddf 100644 --- a/content/_index.md +++ b/content/_index.md @@ -11,8 +11,8 @@ Seirdy ====== It me! This is the personal website for -Rohan -Kumar, a.k.a. Seirdy (online handle). +{{% indieweb-icon %}}Rohan +Kumar, a.k.a. Seirdy (online handle). Other versions of this website ------------------------------ diff --git a/layouts/partials/indieweb-author.html b/layouts/partials/indieweb-author.html new file mode 120000 index 0000000..b620fb8 --- /dev/null +++ b/layouts/partials/indieweb-author.html @@ -0,0 +1 @@ +../shortcodes/indieweb-author.html \ No newline at end of file diff --git a/layouts/partials/indieweb-icon.html b/layouts/partials/indieweb-icon.html new file mode 120000 index 0000000..3dbe2fd --- /dev/null +++ b/layouts/partials/indieweb-icon.html @@ -0,0 +1 @@ +../shortcodes/indieweb-icon.html \ No newline at end of file diff --git a/layouts/shortcodes/indieweb-author.html b/layouts/shortcodes/indieweb-author.html new file mode 100644 index 0000000..0da1e42 --- /dev/null +++ b/layouts/shortcodes/indieweb-author.html @@ -0,0 +1,4 @@ + +{{ $favicon := resources.Get "/favicon.png" | resources.Fingerprint "md5" -}} + diff --git a/layouts/shortcodes/indieweb-icon.html b/layouts/shortcodes/indieweb-icon.html new file mode 100644 index 0000000..adc7447 --- /dev/null +++ b/layouts/shortcodes/indieweb-icon.html @@ -0,0 +1,3 @@ + +{{ $favicon := resources.Get "/favicon.png" | resources.Fingerprint "md5" -}} +Rohan Kumar diff --git a/themes/etch-custom/assets/css/dark.css b/themes/etch-custom/assets/css/dark.css index 4d01349..96f53ab 100644 --- a/themes/etch-custom/assets/css/dark.css +++ b/themes/etch-custom/assets/css/dark.css @@ -4,12 +4,18 @@ color: #fff; } + /* IndieWeb u-photo should be distinct from the background */ + .u-photo { + -webkit-filter: invert(100%); + filter: invert(100%); + } + a { - color: #0af; + color: #4af; } a:visited { - color: #d7c; + color: #d7f; } a:active { diff --git a/themes/etch-custom/assets/css/main.css b/themes/etch-custom/assets/css/main.css index 76ede3a..d5e610b 100644 --- a/themes/etch-custom/assets/css/main.css +++ b/themes/etch-custom/assets/css/main.css @@ -67,16 +67,23 @@ nav li { h1, h2, h3 { - line-height: 1.25em; + line-height: 1.75rem; } -img { +img:not(.u-photo) { display: block; height: auto; margin: auto; max-width: 100%; } +.u-photo { + display: inline-block; + height: 1em; + vertical-align: -0.1em; + width: 1em; +} + pre, code { border: 1px solid #bbb; diff --git a/themes/etch-custom/layouts/_default/single.html b/themes/etch-custom/layouts/_default/single.html index 1d1197f..54220f5 100644 --- a/themes/etch-custom/layouts/_default/single.html +++ b/themes/etch-custom/layouts/_default/single.html @@ -5,10 +5,10 @@

{{ .Title }}

{{ $lastmod := .Lastmod -}} {{ if lt .Date $lastmod -}} - Originally posted by .
+ Originally posted by {{- partial "indieweb-author.html" -}}.
Last updated . Changelog {{ else -}} - Posted . + Posted by {{- partial "indieweb-author.html" -}}. {{ end }}
diff --git a/themes/etch-custom/layouts/partials/header.html b/themes/etch-custom/layouts/partials/header.html index 9f5aef5..19c7d3d 100644 --- a/themes/etch-custom/layouts/partials/header.html +++ b/themes/etch-custom/layouts/partials/header.html @@ -2,7 +2,7 @@