diff options
| author | Eltrac <hi@guhub.cn> | 2025-07-19 20:31:35 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-07-19 20:31:35 +0800 |
| commit | 70050d2bab887d12451096fa38ef55d4a7597b95 (patch) | |
| tree | 0bd658d2ba6473575becf689f789582597224e3a | |
| parent | ec14784ac0d801aec905d88aa5af2a051cdc7967 (diff) | |
refactor: load fancybox and littlefoot globally
| -rw-r--r-- | assets/css/content.scss | 3 | ||||
| -rw-r--r-- | assets/css/main.scss (renamed from assets/css/global.scss) | 4 | ||||
| -rw-r--r-- | layouts/_partials/head/css.html | 8 | ||||
| -rw-r--r-- | layouts/_partials/scripts/fancybox-js.html | 6 |
4 files changed, 7 insertions, 14 deletions
diff --git a/assets/css/content.scss b/assets/css/content.scss deleted file mode 100644 index c172cc36..00000000 --- a/assets/css/content.scss +++ /dev/null @@ -1,3 +0,0 @@ -@import "components/littlefoot"; -@import "components/fancybox"; -@import "components/toc"; diff --git a/assets/css/global.scss b/assets/css/main.scss index 608e7c5c..045a4655 100644 --- a/assets/css/global.scss +++ b/assets/css/main.scss @@ -3,3 +3,7 @@ @import "utils/utility"; @import "utils/animation"; @import "markdown"; + +@import "components/littlefoot"; +@import "components/fancybox"; +@import "components/toc"; diff --git a/layouts/_partials/head/css.html b/layouts/_partials/head/css.html index 423716ea..853b05fe 100644 --- a/layouts/_partials/head/css.html +++ b/layouts/_partials/head/css.html @@ -27,12 +27,6 @@ <style>{{ .Content | safeCSS }}</style> {{ end }} -{{ with resources.Get "css/global.scss" | css.Sass | minify }} +{{ with resources.Get "css/main.scss" | css.Sass | minify }} <style>{{ .Content | safeCSS }}</style> {{ end }} - -{{- if or (in .Section "posts") (in .Section "cards") (in .Section "fictions") (in .Section "library") (eq .Type "single") }} -{{ with resources.Get "css/content.scss" | css.Sass | minify }} -<style>{{ .Content | safeCSS }}</style> -{{ end }} -{{- end }} diff --git a/layouts/_partials/scripts/fancybox-js.html b/layouts/_partials/scripts/fancybox-js.html index c9543a01..4823f30c 100644 --- a/layouts/_partials/scripts/fancybox-js.html +++ b/layouts/_partials/scripts/fancybox-js.html @@ -1,4 +1,2 @@ -{{- if or (in .Section "posts") (in .Section "cards") (in .Section "library") (eq .Type "single") }} - <script src="/js/fancybox.umd.js"></script> - <script>Fancybox.bind("[data-fancybox]");</script> -{{- end }} +<script src="/js/fancybox.umd.js"></script> +<script>Fancybox.bind("[data-fancybox]");</script> |
