From 422f416612f6c65a232ca947eff21179ae2a508a Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Wed, 11 Sep 2024 11:57:49 +0800 Subject: [PATCH] align with latest Hugo. Hugo is a piece of shit! --- exampleSiteMultilingual/hugo.toml | 8 +++++--- layouts/_default/single.html | 6 +++--- layouts/partials/footer.html | 18 +++++++++--------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/exampleSiteMultilingual/hugo.toml b/exampleSiteMultilingual/hugo.toml index f4be162..8a0757e 100644 --- a/exampleSiteMultilingual/hugo.toml +++ b/exampleSiteMultilingual/hugo.toml @@ -3,11 +3,13 @@ languageCode = "en-us" defaultContentLanguage = "en" title = "Anubis2 Demo Site" theme = "anubis2" -paginate = 5 - disqusShortname = "" -[author] +[pagination] +pagerSize = 5 + + +[params.author] name = "Junyi" email = "me@junyi.dev" location = "Singapore" diff --git a/layouts/_default/single.html b/layouts/_default/single.html index c9a53af..296faa9 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -23,8 +23,8 @@ {{ $readNextPosts := 3}} - {{ if isset .Site.Params "readnextposts" }} - {{ $readNextPosts = .Site.Params.readNextPosts }} + {{ if site.Params.readNextPosts }} + {{ $readNextPosts = site.Params.readNextPosts }} {{ end }} {{ if gt $readNextPosts 0 }} @@ -56,7 +56,7 @@ {{ partial "resource.html" (dict "context" . "type" "js" "filename" "js/load-mermaid.js") }} {{ $colorTheme := "light" }} - {{ if and (isset site.Params "colortheme") (ne site.Params.colortheme "") }} + {{ if and (site.Params.colortheme) (ne site.Params.colortheme "") }} {{ $colorTheme = site.Params.colortheme | lower }} {{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 5a01e1f..1a0917d 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -5,23 +5,23 @@ {{ end }}