diff --git a/.forestry/settings.yml b/.forestry/settings.yml index 94e75156..36ff35d6 100644 --- a/.forestry/settings.yml +++ b/.forestry/settings.yml @@ -157,10 +157,10 @@ file_template: ":filename:" build: preview_env: - HUGO_ENV=staging - - HUGO_VERSION=0.82.0 + - HUGO_VERSION=0.132.1 preview_output_directory: public preview_docker_image: forestryio/hugo:latest mount_path: "/srv" working_dir: "/srv" instant_preview_command: hugo server --renderToDisk -d public -version: 0.82.0 +version: 0.132.1 diff --git a/.github/workflows/deploy-hugo.yaml b/.github/workflows/deploy-hugo.yaml index db04e90b..417fd944 100644 --- a/.github/workflows/deploy-hugo.yaml +++ b/.github/workflows/deploy-hugo.yaml @@ -28,7 +28,7 @@ jobs: - name: Setup Hugo uses: peaceiris/actions-hugo@v2 with: - hugo-version: "0.82.0" + hugo-version: "0.132.1" extended: true - name: Build Site run: | diff --git a/.github/workflows/metacatui.yml b/.github/workflows/metacatui.yml index c95a26b4..7f52c98a 100644 --- a/.github/workflows/metacatui.yml +++ b/.github/workflows/metacatui.yml @@ -31,7 +31,7 @@ jobs: - name: Setup Hugo uses: peaceiris/actions-hugo@v2 with: - hugo-version: "0.82.0" + hugo-version: "0.132.1" extended: true - name: Build Site run: | diff --git a/themes/dataone/assets/js/helpers.js b/themes/dataone/assets/js/helpers.js index 02549693..46a6b649 100644 --- a/themes/dataone/assets/js/helpers.js +++ b/themes/dataone/assets/js/helpers.js @@ -51,7 +51,7 @@ * @return {boolean} true if mobile, false if desktop */ block.isMobile = function(){ - var mobileDesktopBreakpoint = {{- .Site.Params.mobileDesktopBreakpoint -}} || 700; + var mobileDesktopBreakpoint = {{- .Params.mobileDesktopBreakpoint -}} || 700; var winWidth = window.innerWidth || document.documentElement.clientWidth; if(winWidth < mobileDesktopBreakpoint){ return true diff --git a/themes/dataone/assets/scss/_main.scss b/themes/dataone/assets/scss/_main.scss index e4050dc2..8b76a5d2 100644 --- a/themes/dataone/assets/scss/_main.scss +++ b/themes/dataone/assets/scss/_main.scss @@ -4,7 +4,7 @@ // execute all SCSS files as template, so that scss files can contain hugo // templating code if needed. * SITE IS PASSED AS THE CONTEXT * -{{ $site := .Site }} +{{ $page := . }} // ==== IMPORT ALL ASSET SCSS ==== // Use a slice of file names instead of ranging through the directory because @@ -14,7 +14,7 @@ {{ $ext := ".scss" }} {{ range $name := $scssFiles }} {{ $assetPath := path.Join $scssAssetDir (print $name $ext) }} - {{ $asset := resources.Get $assetPath | resources.ExecuteAsTemplate (print $name ".scss") $.Site }} + {{ $asset := resources.Get $assetPath | resources.ExecuteAsTemplate (print $name ".scss") $page.Site }} {{ $asset.Content | safeCSS }} {{ end }} @@ -25,7 +25,7 @@ // If the file is an .scss file, import it {{ if or (strings.HasSuffix .Name "scss") (strings.HasSuffix .Name "css") }} {{ $blockscss := path.Join $librariesdir .Name }} - {{ $cssResource := readFile $blockscss | resources.FromString (print .Name ".scss") | resources.ExecuteAsTemplate (print .Name "2.scss") $site }} + {{ $cssResource := readFile $blockscss | resources.FromString (print .Name ".scss") | resources.ExecuteAsTemplate (print .Name "2.scss") $page.Site }} {{ $cssResource.Content | safeCSS }} {{ end }} {{ end }} @@ -44,7 +44,7 @@ // If the file is an .scss file, import it {{ if (strings.HasSuffix .Name "scss") }} {{ $blockscss := path.Join $blocksubdir .Name }} - {{ $cssResource := readFile $blockscss | resources.FromString (print .Name ".scss") | resources.ExecuteAsTemplate (print .Name "2.scss") $site }} + {{ $cssResource := readFile $blockscss | resources.FromString (print .Name ".scss") | resources.ExecuteAsTemplate (print .Name "2.scss") $page.Site }} {{ $cssResource.Content | safeCSS }} {{ end }} {{ end }} diff --git a/themes/dataone/assets/scss/fonts.scss b/themes/dataone/assets/scss/fonts.scss index c58def37..8d260f56 100644 --- a/themes/dataone/assets/scss/fonts.scss +++ b/themes/dataone/assets/scss/fonts.scss @@ -1,5 +1,5 @@ // The font directory relative to the location of the compiled CSS file -{{- $site := .Site -}} +{{- $site := . -}} {{- $fontsDir := $site.Params.fontsDirRelCss | default "../fonts/" -}} diff --git a/themes/dataone/assets/scss/root.scss b/themes/dataone/assets/scss/root.scss index a36b1fc7..13efeb9b 100644 --- a/themes/dataone/assets/scss/root.scss +++ b/themes/dataone/assets/scss/root.scss @@ -64,7 +64,7 @@ // // Product theme colors // ========================================================================== - {{ $services := where $.Site.Pages "Type" "services" }} + {{ $services := where .Pages "Type" "services" }} {{ $services := where $services "Params.service_color" "!=" nil }} {{ range $service := $services }} {{ $color := $service.Params.service_color }}; diff --git a/themes/dataone/assets/scss/variables.scss b/themes/dataone/assets/scss/variables.scss index 369c38f1..a6f0e27a 100644 --- a/themes/dataone/assets/scss/variables.scss +++ b/themes/dataone/assets/scss/variables.scss @@ -1,6 +1,6 @@ // ==== GLOBAL SPACING VARIABLES ==== // Screen width at which to switch from mobile view to desktop view -$breakpoint : {{ .Site.Params.mobileDesktopBreakpoint }}px; +$breakpoint : {{ .Params.mobileDesktopBreakpoint }}px; // Overwrite the responsive font size default (used by responsive-font-size.scss) $rfs-breakpoint: $breakpoint; $default-border-radius : .25rem; diff --git a/themes/dataone/layouts/_default/baseof.html b/themes/dataone/layouts/_default/baseof.html index 31b2a9ea..7bb17e3e 100644 --- a/themes/dataone/layouts/_default/baseof.html +++ b/themes/dataone/layouts/_default/baseof.html @@ -55,7 +55,7 @@ {{- $js := resources.Get "js/main.js" | resources.ExecuteAsTemplate "main.js" . -}} {{/* TODO: minifying the JS results in empty JS since update from 0.74.3 to 0.82.0. Do not minify for now. */}} - {{/* {{- if not $page.Site.IsServer -}} */}} + {{/* {{- if not hugo.IsServer -}} */}} {{/* {{- $js = $js | resources.Minify -}} */}} {{/* {{- end -}} */}} {{- $version := now.Format "2006-01-02_15.04.05_-0700" -}} diff --git a/themes/dataone/layouts/partials/blocks/header/header--homepage.js b/themes/dataone/layouts/partials/blocks/header/header--homepage.js index 387de740..2ec4b707 100644 --- a/themes/dataone/layouts/partials/blocks/header/header--homepage.js +++ b/themes/dataone/layouts/partials/blocks/header/header--homepage.js @@ -3,7 +3,7 @@ var homepageHeader = document.getElementById("homepage_header"); if (homepageHeader) { - {{- $homepage := .Site.GetPage "/_index.md" -}} + {{- $homepage := .GetPage "/_index.md" -}} {{- $headerImages := $homepage.Params.header.images -}} {{- $headerImagePaths := slice -}} {{- range $headerImages -}} diff --git a/themes/dataone/layouts/partials/blocks/toc/toc.js b/themes/dataone/layouts/partials/blocks/toc/toc.js index 6959a728..1f63397d 100644 --- a/themes/dataone/layouts/partials/blocks/toc/toc.js +++ b/themes/dataone/layouts/partials/blocks/toc/toc.js @@ -39,7 +39,7 @@ classActive = "active", // The screen size at which to define "desktop" vs "mobile" - mobileDesktopBreakpoint = {{- .Site.Params.mobileDesktopBreakpoint -}} || 700; + mobileDesktopBreakpoint = {{- $site.Params.mobileDesktopBreakpoint -}} || 700; /** * initialize - Functions to run once the HTML elements are loaded. diff --git a/themes/dataone/layouts/partials/functions/roundMillsOrThous.html b/themes/dataone/layouts/partials/functions/roundMillsOrThous.html index 7b7c8fa9..03d18fce 100644 --- a/themes/dataone/layouts/partials/functions/roundMillsOrThous.html +++ b/themes/dataone/layouts/partials/functions/roundMillsOrThous.html @@ -1,8 +1,8 @@ {{- $return := 0 -}} {{- with . -}} - {{- $millions := div . 1000000.0 | lang.NumFmt 1 -}} - {{- $thousands := div . 1000.0 | lang.NumFmt 1 -}} + {{- $millions := div . 1000000.0 | lang.FormatNumberCustom 1 -}} + {{- $thousands := div . 1000.0 | lang.FormatNumberCustom 1 -}} {{- if ge $millions 1 -}} {{- $return = print $millions " M" -}} diff --git a/themes/dataone/layouts/partials/head.html b/themes/dataone/layouts/partials/head.html index 8ed32cdc..ec16eb21 100644 --- a/themes/dataone/layouts/partials/head.html +++ b/themes/dataone/layouts/partials/head.html @@ -1,5 +1,6 @@ + {{- $page := . -}} {{- $pageTitle := .Title -}} {{- if not $pageTitle -}} @@ -8,7 +9,7 @@ {{- if not $pageTitle -}} {{ $pageTitle = .Params.fullname -}} {{- end -}} - +