Skip to content

Commit

Permalink
Merge pull request #487 from Xpirix/update_hugo_version
Browse files Browse the repository at this point in the history
Update hugo version to v0.139.0
  • Loading branch information
Xpirix authored Dec 9, 2024
2 parents e8f2592 + 986e336 commit 8b5c086
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 22 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/playwright-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 &
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_<latest>_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
```

Expand Down
File renamed without changes.
6 changes: 4 additions & 2 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -29,6 +30,8 @@ enableRobotsTXT = false
submenu = 'submenus'

[params]
# Min hugo version
minHugoVersion = "0.139.0"
# Brand colours:
primary1 = "#589632"
primary2 = "#55828b"
Expand Down Expand Up @@ -703,4 +706,3 @@ sectionPagesMenu = 'main'
isPlainText = true
mediaType = "application/json"


Binary file modified img/hugo-download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion scripts/update-schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
2 changes: 1 addition & 1 deletion themes/hugo-bulma-blocks-theme/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_<latest>_linux-amd64.deb``

### 🪟 Windows:

Expand Down
6 changes: 6 additions & 0 deletions themes/hugo-bulma-blocks-theme/layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@
{{ partial "explore.html" . }}
{{ partial "funders-simple.html" . }}
{{ partial "footer.html" . }}

<!-- See https://discourse.gohugo.io/t/how-to-set-minimum-hugo-version/44755 -->
{{- $minHugoVersion := .Site.Params.minHugoVersion }}
{{- if lt hugo.Version $minHugoVersion }}
{{- errorf "This website requires Hugo v%s or later." $minHugoVersion }}
{{- end }}
2 changes: 1 addition & 1 deletion themes/hugo-bulma-blocks-theme/layouts/maps/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<!-- styles definition-->
{{- $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" }}


<!-- scripts definition -->
Expand Down
4 changes: 2 additions & 2 deletions themes/hugo-bulma-blocks-theme/layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
<link href="{{ $bulmacss.RelPermalink }}" rel="stylesheet" />

{{ $menucss := resources.Get "css/menu.css" }}
Expand All @@ -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 }}
<link href="{{ $style.RelPermalink }}" rel="stylesheet" />

{{/* Fontawesome related stuff here
Expand Down
18 changes: 16 additions & 2 deletions themes/hugo-bulma-blocks-theme/layouts/shortcodes/csv-table.html
Original file line number Diff line number Diff line change
@@ -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 }}
<div class="schedule-container">
<table class="roadmap">
<thead>
Expand All @@ -27,3 +38,6 @@
</tbody>
</table>
</div>
{{ else }}
<p>Error: No data available</p>
{{ end }}

0 comments on commit 8b5c086

Please sign in to comment.