diff options
Diffstat (limited to 'www/layouts/partials')
-rw-r--r-- | www/layouts/partials/css-res.html | 9 | ||||
-rw-r--r-- | www/layouts/partials/css.html | 10 | ||||
-rw-r--r-- | www/layouts/partials/highlight.html | 6 | ||||
-rw-r--r-- | www/layouts/partials/js.html | 4 |
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 }} |