From 3a2cd0e2a399d7a0f5e3a72681a311f43b4be9c0 Mon Sep 17 00:00:00 2001 From: Jamie Holdstock Date: Thu, 5 Sep 2024 15:48:04 +0100 Subject: [PATCH] Update build, hugo and nginx. (#48) * build: Update GitHub actions. * docker: Use nginx 1.26 (latest stable) * build: Update to hugo 0.134.0 - Add a trailing slash to baseURL as expected by the new hugo version. - Use the newer css.Sass instead of deprecated resources.ToCSS - Use pagination.pagerSize instead of deprecated paginate --- .github/workflows/docker.yml | 2 +- Dockerfile | 4 ++-- bin/watch.sh | 2 +- config.toml | 5 +++-- themes/decred-blog/layouts/_default/baseof.html | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 77ac325..92efeed 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -5,6 +5,6 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Build run: docker build -t decred/dcrblog:$(date +%s) . diff --git a/Dockerfile b/Dockerfile index 74d286e..e3e0b59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # builder image FROM alpine:latest -ENV HUGO_VERSION 0.110.0 +ENV HUGO_VERSION 0.134.0 LABEL description="gohugo build" LABEL version="1.0" @@ -25,7 +25,7 @@ RUN rm -rf public resources RUN hugo --buildFuture # Serve image (stable nginx version) -FROM nginx:1.22 +FROM nginx:1.26 LABEL description="dcrblog server" LABEL version="1.0" diff --git a/bin/watch.sh b/bin/watch.sh index 7896865..72fa63b 100755 --- a/bin/watch.sh +++ b/bin/watch.sh @@ -14,4 +14,4 @@ hugo server \ --buildFuture \ --buildDrafts \ --disableFastRender \ - --baseURL http://localhost:1313 + --baseURL http://localhost:1313/ diff --git a/config.toml b/config.toml index 3d2706b..7046f72 100644 --- a/config.toml +++ b/config.toml @@ -3,13 +3,14 @@ languageCode = "en-us" title = "Decred Blog" theme = "decred-blog" -paginate = 5 - copyright = "[DECRED BLOG](https://blog.decred.org/) ALL RIGHTS RESERVED." # disablePathToLower is necessary to maintain backwards compatability with old blog links disablePathToLower = true +[pagination] + pagerSize = 5 + [taxonomies] author = "authors" tag = "tags" diff --git a/themes/decred-blog/layouts/_default/baseof.html b/themes/decred-blog/layouts/_default/baseof.html index af568ac..7a4b894 100644 --- a/themes/decred-blog/layouts/_default/baseof.html +++ b/themes/decred-blog/layouts/_default/baseof.html @@ -9,7 +9,7 @@ {{ block "title" . }}{{ .Site.Title }}{{ end }} {{ "" | safeHTML }} - {{ $style := resources.Get "sass/main.scss" | toCSS }} + {{ $style := resources.Get "sass/main.scss" | css.Sass }} {{ $fonts := resources.Get "css/fonts.css" }}