chore: update VSCode extensions and improve asset loading in templates

This commit is contained in:
Cell
2026-05-29 18:11:19 +08:00
parent bc3fb3a717
commit 20f59e0fe2
5 changed files with 15 additions and 8 deletions
+2 -1
View File
@@ -5,6 +5,7 @@
"lruihao.hugo-partials-refs", "lruihao.hugo-partials-refs",
"tamasfe.even-better-toml", "tamasfe.even-better-toml",
"casualjim.gotemplate", "casualjim.gotemplate",
"SomewhatStationery.some-sass" "SomewhatStationery.some-sass",
"gruntfuggly.todo-tree"
] ]
} }
+2 -2
View File
@@ -6,12 +6,12 @@
{{- $math = dict "enable" false -}} {{- $math = dict "enable" false -}}
{{- end -}} {{- end -}}
{{- /* {{- /*
Mathematical formulas rendering: Mathematical formulas rendering:
- KaTeX server-side rendering - KaTeX server-side rendering
- MathJax client-side rendering - MathJax client-side rendering
Regular passthrough rendering: Regular passthrough rendering:
- [todo] support more features in future - support more features in future
*/ -}} */ -}}
{{- if $math.enable | and (ne hugo.Context.MarkupScope "home") -}} {{- if $math.enable | and (ne hugo.Context.MarkupScope "home") -}}
{{- if eq $math.type "katex" -}} {{- if eq $math.type "katex" -}}
+3 -3
View File
@@ -127,7 +127,7 @@
{{- $math := .Store.Get "math" -}} {{- $math := .Store.Get "math" -}}
{{- if .Store.Get "hasKaTeX" | and (not $isArchivesOrOffline) -}} {{- if .Store.Get "hasKaTeX" | and (not $isArchivesOrOffline) -}}
{{- $source := $cdn.katexCSS | default "lib/katex/katex.min.css" -}} {{- $source := $cdn.katexCSS | default "lib/katex/katex.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Preload" true | dict "Page" . "Data" | partial "store/style.html" -}} {{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/style.html" -}}
{{- /* Copy-tex extension */ -}} {{- /* Copy-tex extension */ -}}
{{- if $math.katex.copyTex -}} {{- if $math.katex.copyTex -}}
{{- $source := $cdn.katexCopyTexJS | default "lib/katex/copy-tex.min.js" -}} {{- $source := $cdn.katexCopyTexJS | default "lib/katex/copy-tex.min.js" -}}
@@ -178,7 +178,7 @@
{{- /* Mapbox GL */ -}} {{- /* Mapbox GL */ -}}
{{- if .Store.Get "hasMapbox" -}} {{- if .Store.Get "hasMapbox" -}}
{{- $source := $cdn.mapboxGLCSS | default "lib/mapbox-gl/mapbox-gl.css" -}} {{- $source := $cdn.mapboxGLCSS | default "lib/mapbox-gl/mapbox-gl.css" -}}
{{- dict "Source" $source "Minify" hugo.IsProduction "Fingerprint" $fingerprint "Preload" true | dict "Page" . "Data" | partial "store/style.html" -}} {{- dict "Source" $source "Minify" hugo.IsProduction "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/style.html" -}}
{{- $source = $cdn.mapboxGLJS | default "lib/mapbox-gl/mapbox-gl.js" -}} {{- $source = $cdn.mapboxGLJS | default "lib/mapbox-gl/mapbox-gl.js" -}}
{{- dict "Source" $source "Minify" hugo.IsProduction "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}} {{- dict "Source" $source "Minify" hugo.IsProduction "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- dict "Source" "lib/mapbox-gl/mapbox-gl-language.js" "Minify" hugo.IsProduction "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}} {{- dict "Source" "lib/mapbox-gl/mapbox-gl-language.js" "Minify" hugo.IsProduction "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
@@ -190,7 +190,7 @@
{{- if (.Store.Get "hasAplayer") | or (.Store.Get "hasMusic") -}} {{- if (.Store.Get "hasAplayer") | or (.Store.Get "hasMusic") -}}
{{- /* APlayer */ -}} {{- /* APlayer */ -}}
{{- $source := $cdn.aplayerCSS | default "lib/aplayer/APlayer.min.css" -}} {{- $source := $cdn.aplayerCSS | default "lib/aplayer/APlayer.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Preload" true | dict "Page" . "Data" | partial "store/style.html" -}} {{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/style.html" -}}
{{- $options := dict "targetPath" "lib/aplayer/dark.min.css" -}} {{- $options := dict "targetPath" "lib/aplayer/dark.min.css" -}}
{{- dict "Source" "lib/aplayer/dark.scss" "ToCSS" $options "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/style.html" -}} {{- dict "Source" "lib/aplayer/dark.scss" "ToCSS" $options "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/style.html" -}}
{{- $source := $cdn.aplayerJS | default "lib/aplayer/APlayer.min.js" -}} {{- $source := $cdn.aplayerJS | default "lib/aplayer/APlayer.min.js" -}}
+8 -1
View File
@@ -121,7 +121,7 @@
{{- $options = dict "Context" . "ToCSS" $toCSS | merge $options -}} {{- $options = dict "Context" . "ToCSS" $toCSS | merge $options -}}
{{- partial "plugin/style.html" $options -}} {{- partial "plugin/style.html" $options -}}
{{- /* Theme CSS */ -}} {{- /* Theme main CSS */ -}}
{{- $options := dict "Source" "scss/main.scss" "Fingerprint" $fingerprint -}} {{- $options := dict "Source" "scss/main.scss" "Fingerprint" $fingerprint -}}
{{- $toCSS := dict "targetPath" "css/main.min.css" "enableSourceMap" true -}} {{- $toCSS := dict "targetPath" "css/main.min.css" "enableSourceMap" true -}}
{{- $options = dict "Context" . "ToCSS" $toCSS | merge $options -}} {{- $options = dict "Context" . "ToCSS" $toCSS | merge $options -}}
@@ -137,6 +137,13 @@
{{- $options := dict "Source" $source "Fingerprint" $fingerprint "Preload" true -}} {{- $options := dict "Source" $source "Fingerprint" $fingerprint "Preload" true -}}
{{- partial "plugin/style.html" $options -}} {{- partial "plugin/style.html" $options -}}
{{- /* Preload main theme bundle */ -}}
{{- $mainResource := dict "Resource" (resources.Get "js/main.ts") "Build" true | partial "function/js-build.html" -}}
{{- with $fingerprint -}}
{{- $mainResource = $mainResource | fingerprint . -}}
{{- end -}}
<link rel="preload" href="{{ $mainResource.RelPermalink }}" as="script">
{{- /* ========== SEO: Structured Data (Schema.org) ========== */ -}} {{- /* ========== SEO: Structured Data (Schema.org) ========== */ -}}
{{- $params := partial "function/params.html" -}} {{- $params := partial "function/params.html" -}}
-1
View File
@@ -11,7 +11,6 @@
<meta name="robots" content="noodp" /> <meta name="robots" content="noodp" />
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title> <title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
{{- partial "base/head/index.html" . -}} {{- partial "base/head/index.html" . -}}
{{- /* TODO preload script https://developer.mozilla.org/zh-CN/docs/Web/HTML/Attributes/rel/preload */ -}}
</head> </head>
<body data-instant-intensity="viewport" data-header-desktop="{{ .Site.Params.header.desktopMode }}" data-header-mobile="{{ .Site.Params.header.mobileMode }}"> <body data-instant-intensity="viewport" data-header-desktop="{{ .Site.Params.header.desktopMode }}" data-header-mobile="{{ .Site.Params.header.mobileMode }}">
{{- /* Body wrapper */ -}} {{- /* Body wrapper */ -}}