diff --git a/.github/workflows/playwright-e2e.yml b/.github/workflows/playwright-e2e.yml index b3e054e38..da2062563 100644 --- a/.github/workflows/playwright-e2e.yml +++ b/.github/workflows/playwright-e2e.yml @@ -15,10 +15,16 @@ jobs: steps: - name: πŸ›’ Checkout uses: actions/checkout@v2 - - name: 🧱 Hugo build - uses: jakejarvis/hugo-build-action@master + + - name: πŸ› οΈ Setup Hugo + uses: peaceiris/actions-hugo@v3 with: - args: --gc --config ./config.toml -b http://127.0.0.1:1313 + hugo-version: 'latest' # We will be alerted if our code has deprecated functions + extended: true + + - name: 🧱 Hugo build + run: hugo --gc --config ./config.toml -b http://127.0.0.1:1313 + - name: πŸ•ΈοΈ Run server run: | cd public && python -m http.server 1313 & diff --git a/Makefile b/Makefile index ff84466d7..3a5c6b095 100644 --- a/Makefile +++ b/Makefile @@ -63,13 +63,13 @@ hugo-run-dev: ## Run the server at localhost:1313 with hugo # U T I L S C O M M A N D S # ---------------------------------------------------------------------------- -csv/schedule.csv scripts/schedule.ics data/conf.json: +assets/csv/schedule.csv scripts/schedule.ics data/conf.json: python scripts/update-schedule.py clearschedule: - $(RM) csv/schedule.csv data/conf.json + $(RM) assets/csv/schedule.csv data/conf.json -schedule: clearschedule csv/schedule.csv scripts/schedule.ics data/conf.json ## Update schedule after release +schedule: clearschedule assets/csv/schedule.csv scripts/schedule.ics data/conf.json ## Update schedule after release git pull --autostash --rebase git commit -a -m "Update for $(shell jq -r '.release' data/conf.json)/$(shell jq -r '.ltrrelease' data/conf.json) point releases" diff --git a/README.md b/README.md index 939b45dc3..9fd46a34f 100644 --- a/README.md +++ b/README.md @@ -48,25 +48,25 @@ the extended version to build SCSS/SASS.: this feature is not available in your current Hugo version, see https://goo.gl/YMrWcn for more information ``` -Currently, the website requires Hugo with a minimum version of `0.126.1` and a maximum version of `0.128.2`. Ensure you have a compatible version installed to avoid any build issues. +Currently, the website requires Hugo with a minimum version of `v0.139.0`. Ensure you have a compatible version installed to avoid any build issues. -You can find the extended version `v0.126.1` [here](https://github.com/gohugoio/hugo/releases/tag/v0.126.1). +You can find the extended version `v0.139.0` [here](https://github.com/gohugoio/hugo/releases/tag/v0.139.0). ![Download](./img/hugo-download.png) ### 🐧 Linux: -Download the deb above and then do +Download the latest version and then do -``sudo dpkg -i hugo_extended_0.126.1_linux-amd64.deb`` +``sudo dpkg -i hugo_extended__linux-amd64.deb`` **πŸ“ Note:** if your system has another version of Hugo, no need to mess up with docker, snap, nix. Just extract the binaries somewhere with `dpkg -x` . Example, assuming that you use a dedicated directory for your local binaries : ```sh -mkdir -p ~/apps/hugo_128/ -wget https://github.com/gohugoio/hugo/releases/download/v0.128.0/hugo_extended_0.128.0_linux-amd64.deb --output-document ~/apps/hugo_128/hugo_extended_0.128.0_linux-amd64.deb -dpkg -x hugo_extended_0.128.0_linux-amd64.deb +mkdir -p ~/apps/hugo_139/ +wget https://github.com/gohugoio/hugo/releases/download/v0.139.0/hugo_extended_0.139.3_linux-amd64.deb --output-document ~/apps/hugo_128/hugo_extended_0.139.3_linux-amd64.deb +dpkg -x hugo_extended_0.139.3_linux-amd64.deb ~/apps/hugo_128/usr/local/bin/hugo server ``` diff --git a/csv/schedule.csv b/assets/csv/schedule.csv similarity index 100% rename from csv/schedule.csv rename to assets/csv/schedule.csv diff --git a/config.toml b/config.toml index 2c391ec5e..45ffc3d2f 100644 --- a/config.toml +++ b/config.toml @@ -5,7 +5,8 @@ title = 'QGIS Web Site' theme = 'hugo-bulma-blocks-theme' # Default pagination. # Can override this when needed e.g. {{ range (.Paginator 5).Pages }} -paginate = 50 +[pagination] + paginate = 50 # See https://mertbakir.gitlab.io/hugo/syntax-highlighting-in-hugo/ pygmentsUseClasses = true @@ -29,6 +30,8 @@ enableRobotsTXT = false submenu = 'submenus' [params] +# Min hugo version +minHugoVersion = "0.139.0" # Brand colours: primary1 = "#589632" primary2 = "#55828b" @@ -703,4 +706,3 @@ sectionPagesMenu = 'main' isPlainText = true mediaType = "application/json" - diff --git a/img/hugo-download.png b/img/hugo-download.png index 1f1b299d7..4ce4f10a1 100644 Binary files a/img/hugo-download.png and b/img/hugo-download.png differ diff --git a/scripts/update-schedule.py b/scripts/update-schedule.py index bc0f3c8dd..181ada26c 100755 --- a/scripts/update-schedule.py +++ b/scripts/update-schedule.py @@ -152,7 +152,7 @@ def adduid(ev, uid): rows.append([event, lr, ltr, dev, date, weekno, weeks]) -o = open("csv/schedule.csv", "w") +o = open("assets/csv/schedule.csv", "w") o.write('"Event","Latest","Long-Term Repo","Freeze","Date","Week #","Weeks"\n') diff --git a/themes/hugo-bulma-blocks-theme/README.md b/themes/hugo-bulma-blocks-theme/README.md index c37f13d65..faebd325b 100644 --- a/themes/hugo-bulma-blocks-theme/README.md +++ b/themes/hugo-bulma-blocks-theme/README.md @@ -249,7 +249,7 @@ You can find the extended version in the [releases page](https://github.com/gohu Download the deb above and then do -``sudo dpkg -i hugo_extended_0.126.1_linux-amd64.deb`` +``sudo dpkg -i hugo_extended__linux-amd64.deb`` ### πŸͺŸ Windows: diff --git a/themes/hugo-bulma-blocks-theme/layouts/index.html b/themes/hugo-bulma-blocks-theme/layouts/index.html index f35bf0d39..0b44fd3b7 100644 --- a/themes/hugo-bulma-blocks-theme/layouts/index.html +++ b/themes/hugo-bulma-blocks-theme/layouts/index.html @@ -7,3 +7,9 @@ {{ partial "explore.html" . }} {{ partial "funders-simple.html" . }} {{ partial "footer.html" . }} + + +{{- $minHugoVersion := .Site.Params.minHugoVersion }} +{{- if lt hugo.Version $minHugoVersion }} + {{- errorf "This website requires Hugo v%s or later." $minHugoVersion }} +{{- end }} diff --git a/themes/hugo-bulma-blocks-theme/layouts/maps/baseof.html b/themes/hugo-bulma-blocks-theme/layouts/maps/baseof.html index 7ace3cd64..089d54ae0 100644 --- a/themes/hugo-bulma-blocks-theme/layouts/maps/baseof.html +++ b/themes/hugo-bulma-blocks-theme/layouts/maps/baseof.html @@ -15,7 +15,7 @@ {{- $options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" "true") -}} {{ $mainSassFile := "sass/main.sass" }} - {{- $styles := resources.Get $mainSassFile | resources.ExecuteAsTemplate $mainSassFile . | resources.ToCSS $options | resources.Fingerprint "sha512" }} + {{- $styles := resources.Get $mainSassFile | resources.ExecuteAsTemplate $mainSassFile . | css.Sass $options | resources.Fingerprint "sha512" }} diff --git a/themes/hugo-bulma-blocks-theme/layouts/partials/header.html b/themes/hugo-bulma-blocks-theme/layouts/partials/header.html index 28651e328..9d77a379d 100644 --- a/themes/hugo-bulma-blocks-theme/layouts/partials/header.html +++ b/themes/hugo-bulma-blocks-theme/layouts/partials/header.html @@ -81,7 +81,7 @@ when piping them in a single line. */}} {{ $bulmasass := resources.Get "sass/bulma.sass" }} - {{ $bulmacss := $bulmasass | resources.ExecuteAsTemplate "bulma.scss" . | resources.ToCSS | resources.Minify | resources.Fingerprint }} + {{ $bulmacss := $bulmasass | resources.ExecuteAsTemplate "bulma.scss" . | css.Sass | resources.Minify | resources.Fingerprint }} {{ $menucss := resources.Get "css/menu.css" }} @@ -99,7 +99,7 @@ {{/* We can compile SASS too... */}} {{ $sass := resources.Get "sass/style.sass" }} - {{ $style := $sass | resources.ExecuteAsTemplate "bulma.scss" . | resources.ToCSS | resources.Minify | resources.Fingerprint }} + {{ $style := $sass | resources.ExecuteAsTemplate "bulma.scss" . | css.Sass | resources.Minify | resources.Fingerprint }} {{/* Fontawesome related stuff here diff --git a/themes/hugo-bulma-blocks-theme/layouts/shortcodes/csv-table.html b/themes/hugo-bulma-blocks-theme/layouts/shortcodes/csv-table.html index 8a2a2bcfd..a28a005ec 100644 --- a/themes/hugo-bulma-blocks-theme/layouts/shortcodes/csv-table.html +++ b/themes/hugo-bulma-blocks-theme/layouts/shortcodes/csv-table.html @@ -1,9 +1,20 @@ {{ $data := 0 }} -{{ with .Get "file" }} - {{ $data = getCSV "," . }} +{{ $path := .Get "file" }} +{{ with resources.Get $path }} + {{ if . }} + {{ with . | transform.Unmarshal }} + {{ $data = . }} + {{ else }} + {{ printf "Error unmarshalling data from: %s" $path }} + {{ end }} + {{ else }} + {{ printf "Error: Resource not found at %s" $path }} + {{ end }} {{ else }} {{ $data = .Inner | unmarshal }} {{ end }} + +{{ if $data }}
@@ -27,3 +38,6 @@
+{{ else }} +

Error: No data available

+{{ end }}