From 4ca71181c7d12c4b48dcd92cf1a3b22dca173900 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sat, 7 Jan 2023 09:42:56 -0800 Subject: [PATCH] Add the {{r}} shortcode that renders a subreddit as a subtle (color only on hover) link, in monospace with no background --- assets/styles/root.css | 20 +++++++++++++++++++- layouts/shortcodes/r.html | 3 +++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 layouts/shortcodes/r.html diff --git a/assets/styles/root.css b/assets/styles/root.css index 9b4c19f..d1f23d9 100644 --- a/assets/styles/root.css +++ b/assets/styles/root.css @@ -117,7 +117,17 @@ a:hover { text-decoration: underline; text-underline-offset: 0.12em; } -a:visited { color: none; } +a:visited { color: rgb(var(--mid-blue)); } + +a.hover-only { + color: var(--html-color); + transition: color 0.2s; +} +a.hover-only:hover { + color: rgb(var(--mid-blue)); + text-decoration: underline; + transition: color 0.2s; +} blockquote { border-inline-start: 4px solid var(--separator-color); @@ -138,6 +148,14 @@ code { padding-inline: 0.6rem; } +code.nobg { + background: none; + border-radius: 0; + display: inline-block; + margin: 0; + padding: 0; +} + figcaption { font-size: 75%; line-height: var(--body-line-height); diff --git a/layouts/shortcodes/r.html b/layouts/shortcodes/r.html new file mode 100644 index 0000000..f45298c --- /dev/null +++ b/layouts/shortcodes/r.html @@ -0,0 +1,3 @@ +{{- $subreddit := .Get 0 -}} +r/{{ $subreddit }} +{{- "" -}}