From 311dfdcc6b5712dd6085287ada5ebe48e02116c4 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Wed, 26 Feb 2025 19:36:40 +0800 Subject: fix(www): css load blink, code block bg, links. --- www/layouts/partials/css-res.html | 9 +++++++++ www/layouts/partials/css.html | 10 +--------- www/layouts/partials/highlight.html | 6 ++++++ www/layouts/partials/js.html | 4 +++- 4 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 www/layouts/partials/css-res.html create mode 100644 www/layouts/partials/highlight.html (limited to 'www/layouts/partials') diff --git a/www/layouts/partials/css-res.html b/www/layouts/partials/css-res.html new file mode 100644 index 0000000..6fabf67 --- /dev/null +++ b/www/layouts/partials/css-res.html @@ -0,0 +1,9 @@ +{{ with . | minify }} + {{ if hugo.IsProduction }} + {{ with . | fingerprint }} + + {{ end }} + {{ else }} + + {{ end }} +{{ end }} diff --git a/www/layouts/partials/css.html b/www/layouts/partials/css.html index 5ddd65b..12d3353 100644 --- a/www/layouts/partials/css.html +++ b/www/layouts/partials/css.html @@ -1,9 +1 @@ -{{ with resources.Get . | minify }} - {{ if hugo.IsProduction }} - {{ with . | fingerprint }} - - {{ end }} - {{ else }} - - {{ end }} -{{ end }} +{{ partial "css-res.html" (resources.Get .) }} \ No newline at end of file diff --git a/www/layouts/partials/highlight.html b/www/layouts/partials/highlight.html new file mode 100644 index 0000000..06ab047 --- /dev/null +++ b/www/layouts/partials/highlight.html @@ -0,0 +1,6 @@ +{{ $light := resources.Get "catppuccin-latte.css" }} +{{ $dark := resources.Get "catppuccin-mocha.css" }} +{{ $dark_wrapper_before := resources.FromString "highlight-dark-wapper-before.css" `html[data-theme="dark"] {`}}} +{{ $dark_wrapper_after := resources.FromString "highlight-dark-wapper-after.css" "}"}} +{{ $highlight := slice $light $dark_wrapper_before $dark $dark_wrapper_after | resources.Concat "highlight.css" }} +{{ return $highlight }} diff --git a/www/layouts/partials/js.html b/www/layouts/partials/js.html index a4e8048..16dafa4 100644 --- a/www/layouts/partials/js.html +++ b/www/layouts/partials/js.html @@ -4,6 +4,8 @@ {{ end }} {{ else }} - + {{ with . | js.Build }} + + {{ end }} {{ end }} {{ end }} -- cgit v1.2.3