Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to hugo 0 139 #34

Merged
merged 3 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ jobs:
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.126.1
HUGO_VERSION: 0.139.4
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Pages
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/playwright-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🛒 Checkout
uses: actions/checkout@v2
- name: 🧱 Hugo build
uses: jakejarvis/hugo-build-action@master
uses: actions/checkout@v4

- name: 🛠️ Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
args: --gc --config ./config.toml -b http://127.0.0.1:1313
# Using the latest value doesn't work for now.
# See https://github.com/peaceiris/actions-hugo/issues/652#issuecomment-2543985304
# and https://github.com/peaceiris/actions-hugo/issues/662
hugo-version: '0.139.4'
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
7 changes: 4 additions & 3 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ baseURL = 'https://planet.qgis.org/'
languageCode = 'en-us'
title = 'QGIS Planet Website'
theme = 'hugo-bulma-blocks-theme'
# Default pagination.
# Can override this when needed e.g. {{ range (.Paginator 5).Pages }}
paginate = 10

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

ignoreLogs = ['warning-goldmark-raw-html']

[pagination]
pagerSize = 10

# URL structure
[permalinks]
Expand Down
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

99 changes: 54 additions & 45 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,69 @@
description = "Development environment and build process for a Hugo app with Python requirements";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};

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

# Importing packages from nixpkgs
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true; # Allow unfree packages like VSCode if needed
};


mkDevShell = pkgs.mkShell {
packages = with pkgs; [
hugo # Hugo for building the website
vscode # VSCode for development
python312Packages.feedparser # Python package: feedparser
python312Packages.requests # Python package: requests
python312Packages.pillow # Python package: Pillow
python312Packages.python-dateutil # Python package: dateutil
gnumake # GNU Make for build automation
];
nixpkgsFor = forAllSystems (system: import nixpkgs {
inherit system;
config.allowUnfree = true;
});

mkDevShell = system:
let
pkgs = nixpkgsFor.${system};
in
{
default = pkgs.mkShell {
packages = with pkgs; [
hugo # Hugo for building the website
vscode # VSCode for development
python312Packages.feedparser # Python package: feedparser
python312Packages.requests # Python package: requests
python312Packages.pillow # Python package: Pillow
python312Packages.python-dateutil # Python package: dateutil
gnumake # GNU Make for build automation
];

shellHook = ''
export DIRENV_LOG_FORMAT=
echo "-----------------------"
echo "🌈 Your Hugo Dev Environment is ready."
echo "It provides hugo and vscode for use with the QGIS Planet Website Project"
echo ""
echo "🪛 VSCode:"
echo "--------------------------------"
echo "Start vscode like this:"
echo ""
echo "./vscode.sh"
echo ""
echo "🪛 Hugo:"
echo "--------------------------------"
echo "Start Hugo like this:"
echo ""
echo "hugo server"
echo "-----------------------"
'';
};
};

shellHook = ''
export DIRENV_LOG_FORMAT=
echo "-----------------------"
echo "🌈 Your Hugo Dev Environment is ready."
echo "It provides hugo and vscode for use with the QGIS Planet Website Project"
echo ""
echo "🪛 VSCode:"
echo "--------------------------------"
echo "Start vscode like this:"
echo ""
echo "./vscode.sh"
echo ""
echo "🪛 Hugo:"
echo "--------------------------------"
echo "Start Hugo like this:"
echo ""
echo "hugo server"
echo "-----------------------"
'';
};

in
{
devShells.x86_64-linux.default = mkDevShell;
devShells = builtins.listToAttrs (map (system: {
name = system;
value = mkDevShell system;
}) supportedSystems);

packages = {
x86_64-linux = {
qgis-planet-website = pkgs.callPackage ./package.nix {};
packages = builtins.listToAttrs (map (system: {
name = system;
value = {
qgis-planet-website = nixpkgsFor.${system}.callPackage ./package.nix {};
};
};
}) supportedSystems);
};
}
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
Loading