Skip to content

Commit 6c3dd25

Browse files
authored
Merge pull request #34 from Xpirix/upgrade_to_hugo_0_139
Upgrade to hugo 0 139
2 parents 01bf52e + b1c89f1 commit 6c3dd25

File tree

7 files changed

+80
-61
lines changed

7 files changed

+80
-61
lines changed

.github/workflows/github-pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ jobs:
3030
build:
3131
runs-on: ubuntu-latest
3232
env:
33-
HUGO_VERSION: 0.126.1
33+
HUGO_VERSION: 0.139.4
3434
steps:
3535
- name: Install Hugo CLI
3636
run: |
3737
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
3838
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
3939
- name: Checkout
40-
uses: actions/checkout@v3
40+
uses: actions/checkout@v4
4141
with:
4242
submodules: recursive
4343
- name: Setup Pages

.github/workflows/playwright-e2e.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,20 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: 🛒 Checkout
17-
uses: actions/checkout@v2
18-
- name: 🧱 Hugo build
19-
uses: jakejarvis/hugo-build-action@master
17+
uses: actions/checkout@v4
18+
19+
- name: 🛠️ Setup Hugo
20+
uses: peaceiris/actions-hugo@v3
2021
with:
21-
args: --gc --config ./config.toml -b http://127.0.0.1:1313
22+
# Using the latest value doesn't work for now.
23+
# See https://github.com/peaceiris/actions-hugo/issues/652#issuecomment-2543985304
24+
# and https://github.com/peaceiris/actions-hugo/issues/662
25+
hugo-version: '0.139.4'
26+
extended: true
27+
28+
- name: 🧱 Hugo build
29+
run: hugo --gc --config ./config.toml -b http://127.0.0.1:1313
30+
2231
- name: 🕸️ Run server
2332
run: |
2433
cd public && python -m http.server 1313 &

config.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ baseURL = 'https://planet.qgis.org/'
22
languageCode = 'en-us'
33
title = 'QGIS Planet Website'
44
theme = 'hugo-bulma-blocks-theme'
5-
# Default pagination.
6-
# Can override this when needed e.g. {{ range (.Paginator 5).Pages }}
7-
paginate = 10
85

96
# See https://mertbakir.gitlab.io/hugo/syntax-highlighting-in-hugo/
107
pygmentsUseClasses = true
@@ -20,6 +17,10 @@ staticDir = ['static']
2017
# the static file
2118
enableRobotsTXT = false
2219

20+
ignoreLogs = ['warning-goldmark-raw-html']
21+
22+
[pagination]
23+
pagerSize = 10
2324

2425
# URL structure
2526
[permalinks]

flake.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 54 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,69 @@
22
description = "Development environment and build process for a Hugo app with Python requirements";
33

44
inputs = {
5-
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
66
};
77

88
outputs = { self, nixpkgs }:
99
let
10-
system = "x86_64-linux";
10+
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
11+
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
1112

12-
# Importing packages from nixpkgs
13-
pkgs = import nixpkgs {
14-
inherit system;
15-
config.allowUnfree = true; # Allow unfree packages like VSCode if needed
16-
};
17-
18-
19-
mkDevShell = pkgs.mkShell {
20-
packages = with pkgs; [
21-
hugo # Hugo for building the website
22-
vscode # VSCode for development
23-
python312Packages.feedparser # Python package: feedparser
24-
python312Packages.requests # Python package: requests
25-
python312Packages.pillow # Python package: Pillow
26-
python312Packages.python-dateutil # Python package: dateutil
27-
gnumake # GNU Make for build automation
28-
];
13+
nixpkgsFor = forAllSystems (system: import nixpkgs {
14+
inherit system;
15+
config.allowUnfree = true;
16+
});
17+
18+
mkDevShell = system:
19+
let
20+
pkgs = nixpkgsFor.${system};
21+
in
22+
{
23+
default = pkgs.mkShell {
24+
packages = with pkgs; [
25+
hugo # Hugo for building the website
26+
vscode # VSCode for development
27+
python312Packages.feedparser # Python package: feedparser
28+
python312Packages.requests # Python package: requests
29+
python312Packages.pillow # Python package: Pillow
30+
python312Packages.python-dateutil # Python package: dateutil
31+
gnumake # GNU Make for build automation
32+
];
33+
34+
shellHook = ''
35+
export DIRENV_LOG_FORMAT=
36+
echo "-----------------------"
37+
echo "🌈 Your Hugo Dev Environment is ready."
38+
echo "It provides hugo and vscode for use with the QGIS Planet Website Project"
39+
echo ""
40+
echo "🪛 VSCode:"
41+
echo "--------------------------------"
42+
echo "Start vscode like this:"
43+
echo ""
44+
echo "./vscode.sh"
45+
echo ""
46+
echo "🪛 Hugo:"
47+
echo "--------------------------------"
48+
echo "Start Hugo like this:"
49+
echo ""
50+
echo "hugo server"
51+
echo "-----------------------"
52+
'';
53+
};
54+
};
2955

30-
shellHook = ''
31-
export DIRENV_LOG_FORMAT=
32-
echo "-----------------------"
33-
echo "🌈 Your Hugo Dev Environment is ready."
34-
echo "It provides hugo and vscode for use with the QGIS Planet Website Project"
35-
echo ""
36-
echo "🪛 VSCode:"
37-
echo "--------------------------------"
38-
echo "Start vscode like this:"
39-
echo ""
40-
echo "./vscode.sh"
41-
echo ""
42-
echo "🪛 Hugo:"
43-
echo "--------------------------------"
44-
echo "Start Hugo like this:"
45-
echo ""
46-
echo "hugo server"
47-
echo "-----------------------"
48-
'';
49-
};
50-
5156
in
5257
{
53-
devShells.x86_64-linux.default = mkDevShell;
58+
devShells = builtins.listToAttrs (map (system: {
59+
name = system;
60+
value = mkDevShell system;
61+
}) supportedSystems);
5462

55-
packages = {
56-
x86_64-linux = {
57-
qgis-planet-website = pkgs.callPackage ./package.nix {};
63+
packages = builtins.listToAttrs (map (system: {
64+
name = system;
65+
value = {
66+
qgis-planet-website = nixpkgsFor.${system}.callPackage ./package.nix {};
5867
};
59-
};
68+
}) supportedSystems);
6069
};
6170
}

themes/hugo-bulma-blocks-theme/layouts/maps/baseof.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<!-- styles definition-->
1616
{{- $options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" "true") -}}
1717
{{ $mainSassFile := "sass/main.sass" }}
18-
{{- $styles := resources.Get $mainSassFile | resources.ExecuteAsTemplate $mainSassFile . | resources.ToCSS $options | resources.Fingerprint "sha512" }}
18+
{{- $styles := resources.Get $mainSassFile | resources.ExecuteAsTemplate $mainSassFile . | css.Sass $options | resources.Fingerprint "sha512" }}
1919

2020

2121
<!-- scripts definition -->

themes/hugo-bulma-blocks-theme/layouts/partials/header.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
when piping them in a single line.
8282
*/}}
8383
{{ $bulmasass := resources.Get "sass/bulma.sass" }}
84-
{{ $bulmacss := $bulmasass | resources.ExecuteAsTemplate "bulma.scss" . | resources.ToCSS | resources.Minify | resources.Fingerprint }}
84+
{{ $bulmacss := $bulmasass | resources.ExecuteAsTemplate "bulma.scss" . | css.Sass | resources.Minify | resources.Fingerprint }}
8585
<link href="{{ $bulmacss.RelPermalink }}" rel="stylesheet" />
8686

8787
{{ $menucss := resources.Get "css/menu.css" }}
@@ -99,7 +99,7 @@
9999

100100
{{/* We can compile SASS too... */}}
101101
{{ $sass := resources.Get "sass/style.sass" }}
102-
{{ $style := $sass | resources.ExecuteAsTemplate "bulma.scss" . | resources.ToCSS | resources.Minify | resources.Fingerprint }}
102+
{{ $style := $sass | resources.ExecuteAsTemplate "bulma.scss" . | css.Sass | resources.Minify | resources.Fingerprint }}
103103
<link href="{{ $style.RelPermalink }}" rel="stylesheet" />
104104

105105
{{/* Fontawesome related stuff here

0 commit comments

Comments
 (0)