Skip to content

Commit

Permalink
Add a version checker
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpirix committed Dec 3, 2024
1 parent 386dc67 commit 986e336
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ 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 `v0.139.3`. 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.139.3` [here](https://github.com/gohugoio/hugo/releases/tag/v0.139.3).
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)

Expand All @@ -65,7 +65,7 @@ Example, assuming that you use a dedicated directory for your local binaries :

```sh
mkdir -p ~/apps/hugo_139/
wget https://github.com/gohugoio/hugo/releases/download/v0.139.3/hugo_extended_0.139.3_linux-amd64.deb --output-document ~/apps/hugo_128/hugo_extended_0.139.3_linux-amd64.deb
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
3 changes: 2 additions & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,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 @@ -704,4 +706,3 @@ sectionPagesMenu = 'main'
isPlainText = true
mediaType = "application/json"


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 }}

0 comments on commit 986e336

Please sign in to comment.