From 9f029f1c7031a56f11adbc3edc96021716482d11 Mon Sep 17 00:00:00 2001 From: razonyang Date: Tue, 20 Aug 2024 14:36:09 +0800 Subject: [PATCH] fix: remove usage of deprecated functions and variables of upstream Replace Sites.First with Sites.Default Replcae resources.PostCSS with css.PostCSS Require Hugo version not lower than 0.128.0 --- config.toml | 2 +- layouts/alias.html | 2 +- layouts/partials/assets/main/css-rtl.html | 2 +- layouts/partials/assets/main/css.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config.toml b/config.toml index e7386a015..c164d1f9e 100644 --- a/config.toml +++ b/config.toml @@ -1,7 +1,7 @@ [module] [module.hugoVersion] extended = true -min = "0.97.0" +min = "0.128.0" [params] breadcrumb = true diff --git a/layouts/alias.html b/layouts/alias.html index ddb3dd2f4..bf1e17810 100644 --- a/layouts/alias.html +++ b/layouts/alias.html @@ -4,7 +4,7 @@ {{- partial "assets/init/js" .Page -}} {{- partialCached "assets/main/css" .Page }} - {{- $isHome := eq .Permalink (site.Sites.First.Home.Permalink) }} + {{- $isHome := eq .Permalink (site.Sites.Default.Home.Permalink) }} {{- if $isHome }} {{- $homes := newScratch }} {{- range site.Sites }} diff --git a/layouts/partials/assets/main/css-rtl.html b/layouts/partials/assets/main/css-rtl.html index d5b736387..95d5bc4a8 100644 --- a/layouts/partials/assets/main/css-rtl.html +++ b/layouts/partials/assets/main/css-rtl.html @@ -4,7 +4,7 @@ {{- $options := dict "targetPath" "assets/main/bundle.rtl.min.css" "outputStyle" $outputStyle "includePaths" (slice "node_modules") }} {{- $config := resources.Get "main/scss/_config.scss" | resources.ExecuteAsTemplate "main/scss/_config.rtl.scss" . }} {{- $main := resources.Get "main/scss/index.scss" }} -{{- $style := slice $config $main | resources.Concat "main/scss/main.rtl.css" | toCSS $options | resources.PostCSS $postCSSOptions | fingerprint }} +{{- $style := slice $config $main | resources.Concat "main/scss/main.rtl.css" | toCSS $options | css.PostCSS $postCSSOptions | fingerprint }} {{- if hugo.IsProduction }}{{ $style = $style | resources.PostProcess }}{{ end }} {{- partial "assets/main/custom" . }} diff --git a/layouts/partials/assets/main/css.html b/layouts/partials/assets/main/css.html index cfb0bc9d4..206db6874 100644 --- a/layouts/partials/assets/main/css.html +++ b/layouts/partials/assets/main/css.html @@ -5,7 +5,7 @@ {{- $config := resources.Get "main/scss/_config.scss" | resources.ExecuteAsTemplate "main/scss/_config.scss" . }} {{- $main := resources.Get "main/scss/index.scss" }} {{- $styles := slice $config $main }} -{{- $styles := $styles | resources.Concat "main/scss/main.css" | toCSS $options | resources.PostCSS $postCSSOptions | fingerprint }} +{{- $styles := $styles | resources.Concat "main/scss/main.css" | toCSS $options | css.PostCSS $postCSSOptions | fingerprint }} {{- if hugo.IsProduction }}{{ $styles = $styles | resources.PostProcess }}{{ end }} {{- partial "assets/main/custom" . }}