diff options
author | tdro <tdro@noreply.example.com> | 2023-08-26 20:47:35 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2023-08-26 21:50:13 -0400 |
commit | ff8fe1d95f50405b01087a9ca87bc274245d9232 (patch) | |
tree | 6851028024e6f09096741004777b4d3cfd343d21 | |
parent | e34429e3b6b06c1109140a7175444e278ebafe15 (diff) | |
download | canory-ff8fe1d95f50405b01087a9ca87bc274245d9232.tar.gz canory-ff8fe1d95f50405b01087a9ca87bc274245d9232.tar.bz2 canory-ff8fe1d95f50405b01087a9ca87bc274245d9232.zip |
themes/default/layouts/_default/rss: Punt fallback image logic to figure object hybrid
Cleanup related rules
-rw-r--r-- | assets/css/default.css | 60 | ||||
-rw-r--r-- | themes/default/layouts/_default/home.xslt.rss.xsl | 164 | ||||
-rw-r--r-- | themes/default/layouts/_default/rss.xml | 14 |
3 files changed, 111 insertions, 127 deletions
diff --git a/assets/css/default.css b/assets/css/default.css index 80df489..5f1ed2b 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -181,7 +181,7 @@ li:target [role="doc-backlink"][href^="#fnref\:"], color: var(--warning) !important; } -:hover:not(a):not(s):not(img):not(summary):not(nav):not(abbr):not(form):not(code):not(mark):not(td):not(nav):not(p):not(tab-bar) { +:hover:not(a):not(s):not(span):not(img):not(summary):not(nav):not(abbr):not(form):not(code):not(mark):not(td):not(nav):not(p):not(object):not(tab-bar) { border-radius: 0.5rem; } @@ -425,22 +425,23 @@ blockquote footer { } video { + width: 100%; color: #000; border-radius: 0.5rem; background-color: #000; + vertical-align: middle; box-shadow: 0 0 3px #00000060; box-shadow: 0 0 3px var(--shadow); } -video:hover { - box-shadow: 0 0 14px #00000060; - box-shadow: 0 0 14px var(--shadow); -} - video[data-orientation="portrait"] { width: 50%; } +video:focus { + filter: brightness(100%); +} + video-container { display: block; text-align: center; @@ -531,6 +532,7 @@ main, details, summary, code-block, +figure span, diagram-container { display: block; } @@ -698,28 +700,24 @@ small { opacity: 0.85; } -audio, -canvas, -iframe, -img, -svg, -video { +canvas { vertical-align: middle; } -video, audio { width: 100%; -} - -audio { margin: 0.75rem 0; + vertical-align: middle; } figure { text-align: center; } +figure object { + pointer-events: none; +} + iframe { width: 1px; min-width: 100%; @@ -728,6 +726,8 @@ iframe { background-color: #fefefe; border-radius: 0.5rem; min-height: 16rem; + user-select: none; + vertical-align: middle; } self-embed iframe { @@ -735,7 +735,8 @@ self-embed iframe { max-height: 11rem; } -img { +img, +figure object { height: auto; max-width: 100%; border-width: 1px; @@ -749,32 +750,24 @@ img { justify-content: center; align-items: center; background-color: #fefefe; + user-select: none; + vertical-align: middle; } -img:hover { +img:hover, +video:hover, +figure span:hover { box-shadow: 0 0 14px #00000060; box-shadow: 0 0 14px var(--shadow); -} - -img:hover, -video:hover { filter: brightness(90%); } -video:focus { - filter: brightness(100%); -} - -img, -iframe { - user-select: none; -} - p { line-height: 1.4; } svg { + vertical-align: middle; stroke-width: 0.08rem; } @@ -1056,10 +1049,13 @@ micro-thumbnail figure { micro-thumbnail figure > a { display: block; + text-decoration: none; } tag-card figure img, -micro-thumbnail figure img { +micro-thumbnail figure img, +micro-thumbnail figure span, +micro-thumbnail figure object { border-radius: 100%; min-width: 3.5rem; min-height: 3.5rem; diff --git a/themes/default/layouts/_default/home.xslt.rss.xsl b/themes/default/layouts/_default/home.xslt.rss.xsl index 39a0af4..d345af9 100644 --- a/themes/default/layouts/_default/home.xslt.rss.xsl +++ b/themes/default/layouts/_default/home.xslt.rss.xsl @@ -6,97 +6,97 @@ xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="1.1" > - <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/> + <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes" /> <xsl:template match="/"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" data-xml="" data-document="xhtml"> <head> - {{ printf `<title><xsl:value-of select="/rss/channel/title"/> Web Feed</title>` | safeHTML }} - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/> + {{ printf `<title><xsl:value-of select="/rss/channel/title" /> Web Feed</title>` | safeHTML }} + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> {{- partial "base-css.html" . -}} </head> <body> <column-base position="left"></column-base> <column-base position="middle"> - <main> - <nav> - <icon-button> - <a onclick="window.history.go(-1); return false;"> - <xsl:choose> - <xsl:when test="/rss/channel/atom:link[@rel='previous']/@href"> - <xsl:attribute name="href"> - <xsl:value-of select="/rss/channel/atom:link[@rel='previous']/@href"/> - </xsl:attribute> - </xsl:when> - <xsl:otherwise> - <xsl:attribute name="href">/</xsl:attribute> - </xsl:otherwise> - </xsl:choose> - {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-left.svg")) }} - <small>Back</small> - </a> - </icon-button> - <section> - <h2><xsl:value-of select="/rss/channel/title"/>'s Feed</h2> - <small>Web Feed Preview</small> - </section> - <xsl:if test="/rss/channel/atom:link[@rel='next']/@href"> - <icon-button> - <a> - <xsl:attribute name="href"> - <xsl:value-of select="/rss/channel/atom:link[@rel='next']/@href"/> - </xsl:attribute> - {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-right.svg")) }} - <small>Next</small> - </a> - </icon-button> - </xsl:if> - {{ if .Site.Menus.main }} - {{ range .Site.Menus.main }} - <icon-navigator hidden=""> - <icon-button> - <a id="nav-middle-{{ path.Base .Identifier }}" href="{{ .URL | absURL }}"> - {{ with .Identifier }} - {{ $icon := print (partial "function-paths.html").static "/icons/" . ".svg" }} - {{ safeHTML (readFile $icon) }} - {{ end }} - <small>{{ delimit (first 1 (split .Name " ")) " " }}</small> - </a> - </icon-button> - </icon-navigator> + <main> + <nav> + <icon-button> + <a onclick="window.history.go(-1); return false;"> + <xsl:choose> + <xsl:when test="/rss/channel/atom:link[@rel='previous']/@href"> + <xsl:attribute name="href"> + <xsl:value-of select="/rss/channel/atom:link[@rel='previous']/@href" /> + </xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="href">/</xsl:attribute> + </xsl:otherwise> + </xsl:choose> + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-left.svg")) }} + <small>Back</small> + </a> + </icon-button> + <section> + <h2><xsl:value-of select="/rss/channel/title" />'s Feed</h2> + <small>Web Feed Preview</small> + </section> + <xsl:if test="/rss/channel/atom:link[@rel='next']/@href"> + <icon-button> + <a> + <xsl:attribute name="href"> + <xsl:value-of select="/rss/channel/atom:link[@rel='next']/@href" /> + </xsl:attribute> + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-right.svg")) }} + <small>Next</small> + </a> + </icon-button> + </xsl:if> + {{ if .Site.Menus.main }} + {{ range .Site.Menus.main }} + <icon-navigator hidden=""> + <icon-button> + <a id="nav-middle-{{ path.Base .Identifier }}" href="{{ .URL | absURL }}"> + {{ with .Identifier }} + {{ $icon := print (partial "function-paths.html").static "/icons/" . ".svg" }} + {{ safeHTML (readFile $icon) }} + {{ end }} + <small>{{ delimit (first 1 (split .Name " ")) " " }}</small> + </a> + </icon-button> + </icon-navigator> + {{ end }} {{ end }} - {{ end }} - </nav> - <navigation-separator><hr hidden=""></hr></navigation-separator> - <xsl:for-each select="/rss/channel/item"> - <micro-card> - <micro-summary> - <micro-thumbnail> - <figure> - <a> - <xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute> - <picture> - <img> - <xsl:attribute name="alt"><xsl:value-of select="atom:author/atom:name"/></xsl:attribute> - <xsl:attribute name="title"><xsl:value-of select="atom:author/atom:name"/></xsl:attribute> - <xsl:attribute name="src"><xsl:value-of select="atom:author/atom:uri"/></xsl:attribute> - </img> - </picture> - </a> - </figure> - </micro-thumbnail> - <article> - <h2> - <a> - <xsl:attribute name="href"><xsl:value-of select="link" /></xsl:attribute> - <xsl:value-of select="title" /> - </a> - </h2> - <small>Published: <xsl:value-of select="pubDate"/></small> - </article> - </micro-summary> - </micro-card> - </xsl:for-each> + </nav> + <navigation-separator><hr hidden=""></hr></navigation-separator> + <xsl:for-each select="/rss/channel/item"> + <micro-card> + <micro-summary> + <micro-thumbnail> + <figure> + <a> + <xsl:attribute name="href"><xsl:value-of select="link" /></xsl:attribute> + <span> + <object> + <xsl:attribute name="title"><xsl:value-of select="atom:author/atom:name" /></xsl:attribute> + <xsl:attribute name="data"><xsl:value-of select="atom:author/atom:uri" /></xsl:attribute> + <xsl:value-of select="substring(atom:author/atom:name, 1, 1)" /> + </object> + </span> + </a> + </figure> + </micro-thumbnail> + <article> + <h2> + <a> + <xsl:attribute name="href"><xsl:value-of select="link" /></xsl:attribute> + <xsl:value-of select="title" /> + </a> + </h2> + <small>Published: <xsl:value-of select="pubDate" /></small> + </article> + </micro-summary> + </micro-card> + </xsl:for-each> </main> </column-base> <column-base position="right"></column-base> diff --git a/themes/default/layouts/_default/rss.xml b/themes/default/layouts/_default/rss.xml index c7bba6d..8cb5276 100644 --- a/themes/default/layouts/_default/rss.xml +++ b/themes/default/layouts/_default/rss.xml @@ -32,10 +32,6 @@ "/" $author.user "/" $author.user "-profile" (path.Ext $author.picture.profile) -}} -{{- if not (fileExists (print "public/" $image)) -}} - {{- $image = "/data/media/404.png" -}} -{{- end -}} - {{- $atomSelf := "" -}} {{- $atomPrevious := "" -}} {{- $atomNext := "" -}} @@ -87,18 +83,11 @@ "/" $author.user "/" $author.user "-profile" (path.Ext $author.picture.profile) -}} - {{- if not (fileExists (print "public/" $image)) -}} - {{- $image = "/data/media/404.png" -}} - {{- end -}} - {{- $atomAuthorUri := print $absURL $image -}} {{- $atomAuthorName := or .Params.Feed.name $author.name -}} {{- if .Params.Feed.favicon -}} {{- $favicon := print "/" (partial "function-paths.html").media "/favicon." (.Params.Feed.source | anchorize) ".png" -}} - {{- if not (fileExists (print "public/" $favicon)) -}} - {{- $favicon = "/data/media/404.png" -}} - {{- end -}} {{- $atomAuthorUri = print $absURL $favicon -}} {{- end -}} @@ -109,7 +98,7 @@ <guid>{{ .Permalink }}</guid> <description> {{ partial "function-content.html" . | html -}} - {{- print "<br>" | html -}} + {{- print "<br />" | html -}} {{- partial "rss-tags.html" . | html }} </description> <atom:author> @@ -121,5 +110,4 @@ {{ end -}} </channel> </rss> - {{- end -}} |