From 09070060cdd7eaeded69942719b8727beacf37cb Mon Sep 17 00:00:00 2001 From: rawhide kobayashi Date: Wed, 8 Jan 2025 15:49:14 -0600 Subject: [PATCH] paranoia --- assets/css/custom.css | 54 ++++++++++++++++++++++++++++++------ layouts/_default/single.html | 26 ++++++++--------- layouts/partials/author.html | 39 ++++++++++++++++++++++++++ layouts/partials/badge.html | 5 ++++ 4 files changed, 103 insertions(+), 21 deletions(-) create mode 100644 layouts/partials/author.html create mode 100644 layouts/partials/badge.html diff --git a/assets/css/custom.css b/assets/css/custom.css index 7e14fc4..21707f3 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -92,7 +92,7 @@ --tw-prose-th-borders:rgba(var(--color-neutral-500), 1); --tw-prose-td-borders:rgba(var(--color-neutral-300), 1); --tw-prose-invert-body:rgba(var(--color-neutral-300), 1); - --tw-prose-invert-headings:rgba(var(--color-neutral-50), 1); + --tw-prose-invert-headings:rgba(var(--color-secondary-600), 1); --tw-prose-invert-lead:rgba(var(--color-neutral-500), 1); --tw-prose-invert-links:rgba(var(--color-secondary-600), 1); --tw-prose-invert-bold:rgba(var(--color-neutral), 1); @@ -113,11 +113,6 @@ line-height:1.75 } -.prose :where(p):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - margin-top:1.25em; - margin-bottom:1.25em; -} - /* p { background-color:rgba(var(--color-primary-900), 0.5); @@ -177,5 +172,48 @@ p { } .dark\:prose-invert:is(.dark *) :where(code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - background-color:rgba(var(--color-primary-900), 0.8); -} \ No newline at end of file + background-color:transparent; +} + +.prose :where(h2):not(:where([class~="not-prose"],[class~="not-prose"] *)) { + color:var(--tw-prose-headings); + font-weight:700; + font-size:1.5em; + margin-top:0.5em; + margin-bottom:0.2em; + line-height:1.3333333 +} + +.prose :where(h3):not(:where([class~="not-prose"],[class~="not-prose"] *)) { + color:var(--tw-prose-headings); + font-weight:600; + font-size:1.25em; + margin-top:0.5em; + margin-bottom:0.2em; + line-height:1.6 +} + +.prose :where(h4):not(:where([class~="not-prose"],[class~="not-prose"] *)) { + color:var(--tw-prose-headings); + font-weight:600; + margin-top:0.5em; + margin-bottom:0.2em; + line-height:1.5 +} + +.cool-title { + color:rgba(var(--color-primary-700), 1); + background-color:rgba(var(--color-secondary-600), 1); + padding:4px; +} + +.prose :where(hr):not(:where([class~="not-prose"],[class~="not-prose"] *)) { + border-color:var(--tw-prose-hr); + border-top-width:1px; + margin-top:0.5em; + margin-bottom:0.5em +} + +.min-w-content { + min-width:fit-content; +} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 87e4fbe..71cdfdd 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -33,12 +33,9 @@ {{ if .Params.showBreadcrumbs | default (.Site.Params.article.showBreadcrumbs | default false) }} {{ partial "breadcrumbs.html" . }} {{ end }} -

+

{{ .Title | emojify }}

-
- {{ partial "article-meta/basic.html" (dict "context" . "scope" "single") }} -
{{ $authorsData := .Site.Data.authors }} {{ $taxonomies := .Site.Taxonomies.authors }} @@ -52,10 +49,18 @@ {{ if not (.Params.showAuthorBottom | default ( .Site.Params.article.showAuthorBottom | default false)) }} - {{ if .Params.showAuthor | default (.Site.Params.article.showAuthor | default true) }} - {{ $showAuthor = 1 }} - {{ partial "author.html" . }} - {{ end }} + +
+ {{ if .Params.showAuthor | default (.Site.Params.article.showAuthor | default true) }} + {{ $showAuthor = 1 }} + {{ partial "author.html" . }} + {{ end }} +
+ {{ partial "article-meta/basic.html" (dict "context" . "scope" "single") }} +
+
+ +
{{ range $author := .Page.Params.authors }} {{ $authorData := index $authorsData $author }} @@ -68,11 +73,6 @@ {{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $taxonomyLink) }} {{- end -}} {{ end }} - - {{ if or $taxonomyLink $showAuthor }} -
- {{ end }} - {{ end }} diff --git a/layouts/partials/author.html b/layouts/partials/author.html new file mode 100644 index 0000000..d623825 --- /dev/null +++ b/layouts/partials/author.html @@ -0,0 +1,39 @@ +{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }} +
+ {{ with .Site.Params.Author.image }} + {{ $authorImage := "" }} + {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} + {{ $authorImage = resources.GetRemote . }} + {{ else }} + {{ $authorImage = resources.Get . }} + {{ end }} + {{ if $authorImage }} + {{ if not $disableImageOptimization }} + {{ $authorImage = $authorImage.Fill "192x192" }} + {{ end }} + {{ $.Site.Params.Author.name | default + {{ else }} + {{ $authorImage := resources.GetRemote . }} + {{ if not $disableImageOptimization }} + {{ $authorImage = $authorImage.Fill "192x192" }} + {{ end }} + {{ $.Site.Params.Author.name | default + {{ end }} + {{ end }} +
+ {{ with .Site.Params.Author.name | markdownify }} +
+ {{ i18n "author.byline_title" | markdownify }} +
+
+ {{ . }} +
+ {{ end }} + {{ with .Site.Params.Author.bio | markdownify }} +
{{ . }}
+ {{ end }} +
{{ partialCached "author-links.html" . }}
+
+
diff --git a/layouts/partials/badge.html b/layouts/partials/badge.html new file mode 100644 index 0000000..2b134da --- /dev/null +++ b/layouts/partials/badge.html @@ -0,0 +1,5 @@ + + + {{ . }} + + \ No newline at end of file