Skip to content

Commit 26d0273

Browse files
committed
Update hugo from 0.82.0 to 0.132.1
Make site compatible with broken changes
1 parent f259054 commit 26d0273

File tree

13 files changed

+22
-20
lines changed

13 files changed

+22
-20
lines changed

.forestry/settings.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ file_template: ":filename:"
157157
build:
158158
preview_env:
159159
- HUGO_ENV=staging
160-
- HUGO_VERSION=0.82.0
160+
- HUGO_VERSION=0.132.1
161161
preview_output_directory: public
162162
preview_docker_image: forestryio/hugo:latest
163163
mount_path: "/srv"
164164
working_dir: "/srv"
165165
instant_preview_command: hugo server --renderToDisk -d public
166-
version: 0.82.0
166+
version: 0.132.1

.github/workflows/deploy-hugo.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Setup Hugo
2929
uses: peaceiris/actions-hugo@v2
3030
with:
31-
hugo-version: "0.82.0"
31+
hugo-version: "0.132.1"
3232
extended: true
3333
- name: Build Site
3434
run: |

.github/workflows/metacatui.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Setup Hugo
3232
uses: peaceiris/actions-hugo@v2
3333
with:
34-
hugo-version: "0.82.0"
34+
hugo-version: "0.132.1"
3535
extended: true
3636
- name: Build Site
3737
run: |

themes/dataone/assets/js/helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
* @return {boolean} true if mobile, false if desktop
5252
*/
5353
block.isMobile = function(){
54-
var mobileDesktopBreakpoint = {{- .Site.Params.mobileDesktopBreakpoint -}} || 700;
54+
var mobileDesktopBreakpoint = {{- .Params.mobileDesktopBreakpoint -}} || 700;
5555
var winWidth = window.innerWidth || document.documentElement.clientWidth;
5656
if(winWidth < mobileDesktopBreakpoint){
5757
return true

themes/dataone/assets/scss/_main.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// execute all SCSS files as template, so that scss files can contain hugo
55
// templating code if needed. * SITE IS PASSED AS THE CONTEXT *
66

7-
{{ $site := .Site }}
7+
{{ $page := . }}
88

99
// ==== IMPORT ALL ASSET SCSS ====
1010
// Use a slice of file names instead of ranging through the directory because
@@ -14,7 +14,7 @@
1414
{{ $ext := ".scss" }}
1515
{{ range $name := $scssFiles }}
1616
{{ $assetPath := path.Join $scssAssetDir (print $name $ext) }}
17-
{{ $asset := resources.Get $assetPath | resources.ExecuteAsTemplate (print $name ".scss") $.Site }}
17+
{{ $asset := resources.Get $assetPath | resources.ExecuteAsTemplate (print $name ".scss") $page.Site }}
1818
{{ $asset.Content | safeCSS }}
1919
{{ end }}
2020

@@ -25,7 +25,7 @@
2525
// If the file is an .scss file, import it
2626
{{ if or (strings.HasSuffix .Name "scss") (strings.HasSuffix .Name "css") }}
2727
{{ $blockscss := path.Join $librariesdir .Name }}
28-
{{ $cssResource := readFile $blockscss | resources.FromString (print .Name ".scss") | resources.ExecuteAsTemplate (print .Name "2.scss") $site }}
28+
{{ $cssResource := readFile $blockscss | resources.FromString (print .Name ".scss") | resources.ExecuteAsTemplate (print .Name "2.scss") $page.Site }}
2929
{{ $cssResource.Content | safeCSS }}
3030
{{ end }}
3131
{{ end }}
@@ -44,7 +44,7 @@
4444
// If the file is an .scss file, import it
4545
{{ if (strings.HasSuffix .Name "scss") }}
4646
{{ $blockscss := path.Join $blocksubdir .Name }}
47-
{{ $cssResource := readFile $blockscss | resources.FromString (print .Name ".scss") | resources.ExecuteAsTemplate (print .Name "2.scss") $site }}
47+
{{ $cssResource := readFile $blockscss | resources.FromString (print .Name ".scss") | resources.ExecuteAsTemplate (print .Name "2.scss") $page.Site }}
4848
{{ $cssResource.Content | safeCSS }}
4949
{{ end }}
5050
{{ end }}

themes/dataone/assets/scss/fonts.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// The font directory relative to the location of the compiled CSS file
2-
{{- $site := .Site -}}
2+
{{- $site := . -}}
33

44
{{- $fontsDir := $site.Params.fontsDirRelCss | default "../fonts/" -}}
55

themes/dataone/assets/scss/root.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
//
6565
// Product theme colors
6666
// ==========================================================================
67-
{{ $services := where $.Site.Pages "Type" "services" }}
67+
{{ $services := where .Pages "Type" "services" }}
6868
{{ $services := where $services "Params.service_color" "!=" nil }}
6969
{{ range $service := $services }}
7070
{{ $color := $service.Params.service_color }};

themes/dataone/assets/scss/variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==== GLOBAL SPACING VARIABLES ====
22
// Screen width at which to switch from mobile view to desktop view
3-
$breakpoint : {{ .Site.Params.mobileDesktopBreakpoint }}px;
3+
$breakpoint : {{ .Params.mobileDesktopBreakpoint }}px;
44
// Overwrite the responsive font size default (used by responsive-font-size.scss)
55
$rfs-breakpoint: $breakpoint;
66
$default-border-radius : .25rem;

themes/dataone/layouts/_default/baseof.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<!-- Get the bundled javascript resources -->
5656
{{- $js := resources.Get "js/main.js" | resources.ExecuteAsTemplate "main.js" . -}}
5757
{{/* TODO: minifying the JS results in empty JS since update from 0.74.3 to 0.82.0. Do not minify for now. */}}
58-
{{/* {{- if not $page.Site.IsServer -}} */}}
58+
{{/* {{- if not hugo.IsServer -}} */}}
5959
{{/* {{- $js = $js | resources.Minify -}} */}}
6060
{{/* {{- end -}} */}}
6161
{{- $version := now.Format "2006-01-02_15.04.05_-0700" -}}

themes/dataone/layouts/partials/blocks/header/header--homepage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
var homepageHeader = document.getElementById("homepage_header");
44
if (homepageHeader) {
55

6-
{{- $homepage := .Site.GetPage "/_index.md" -}}
6+
{{- $homepage := .GetPage "/_index.md" -}}
77
{{- $headerImages := $homepage.Params.header.images -}}
88
{{- $headerImagePaths := slice -}}
99
{{- range $headerImages -}}

0 commit comments

Comments
 (0)