aboutsummaryrefslogtreecommitdiff
path: root/www/layouts/partials
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-02-26 19:36:40 +0800
committerYuqian Yang <crupest@crupest.life>2025-02-26 19:36:40 +0800
commit311dfdcc6b5712dd6085287ada5ebe48e02116c4 (patch)
tree37053cfe69bc7a115d849f61223cf51dedb99e80 /www/layouts/partials
parent0c885ba1bf30ce8308880f926be85b6f5a499fa6 (diff)
downloadcrupest-311dfdcc6b5712dd6085287ada5ebe48e02116c4.tar.gz
crupest-311dfdcc6b5712dd6085287ada5ebe48e02116c4.tar.bz2
crupest-311dfdcc6b5712dd6085287ada5ebe48e02116c4.zip
fix(www): css load blink, code block bg, links.
Diffstat (limited to 'www/layouts/partials')
-rw-r--r--www/layouts/partials/css-res.html9
-rw-r--r--www/layouts/partials/css.html10
-rw-r--r--www/layouts/partials/highlight.html6
-rw-r--r--www/layouts/partials/js.html4
4 files changed, 19 insertions, 10 deletions
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 }}
+ <link href="{{ .RelPermalink }}" rel="stylesheet" integrity="{{ .Data.Integrity }}">
+ {{ end }}
+ {{ else }}
+ <link href="{{ .RelPermalink }}" rel="stylesheet">
+ {{ 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 }}
- <link href="{{ .RelPermalink }}" rel="stylesheet" integrity="{{ .Data.Integrity }}">
- {{ end }}
- {{ else }}
- <link href="{{ .RelPermalink }}" rel="stylesheet">
- {{ 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 @@
<script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}"></script>
{{ end }}
{{ else }}
- <script src="{{ (. | js.Build dict) .RelPermalink }}"></script>
+ {{ with . | js.Build }}
+ <script src="{{ .RelPermalink }}"></script>
+ {{ end }}
{{ end }}
{{ end }}