Browse Source

Fix deprecation warnings (#913)

### Prerequisites

Put an `x` into the box(es) that apply:

- [x] This pull request fixes warnings.
- [ ] This pull request adds a feature.
- [ ] This pull request introduces breaking change.

### Description

This PR fixes warnings emitted by hugo.
It raises the min required version for the theme to 0.124.0, I hope this
is o.k. for you.

#### Contributors

- [x] Add yourself to `CONTRIBUTORS.md` if you aren't on it already
Andreas Deininger 1 year ago
parent
commit
759cc94563

+ 1 - 1
.editorconfig

@@ -1,4 +1,4 @@
-# http://editorconfig.org
+# https://editorconfig.org
 
 # this file is the top-most editorconfig file
 root = true

+ 2 - 1
CONTRIBUTORS.md

@@ -142,4 +142,5 @@
 - [Shaked8634](https://github.com/shaked8634)  
 - [Leo Heimann Ruiz](https://leo.heitmannruiz.org/)
 - [Antoine "Toinux" Wam](https://github.com/itzwam)
-- [Reberti Carvalho Soares](https://github.com/RebertiCS)
+- [Reberti Carvalho Soares](https://github.com/RebertiCS)
+- [Andreas Deininger](https://github.com/deining)

+ 1 - 1
config.toml → hugo.toml

@@ -2,4 +2,4 @@ baseURL = "https://example.com/"
 
 [module]
 [module.hugoVersion]
-min = "0.77.0"
+min = "0.124.0"

+ 2 - 2
i18n/de.toml

@@ -25,7 +25,7 @@ other = "{{ .Count }} Minuten Lesezeit"
 other = "Seite nicht gefunden"
 
 [page_does_not_exist]
-other = "Tut mir Leid, die Seite existiert leider nicht."
+other = "Tut mir leid, die Seite existiert leider nicht."
 
 [head_back]
 other = "Du kannst hier zurück zur <a href=\"{{ . }}\">Startseite</a>."
@@ -61,4 +61,4 @@ other = "Warnung"
 other = "Fehler"
 
 [link_to_heading]
-other = "Link to heading"
+other = "Link zu Überschrift"

+ 3 - 3
layouts/_default/baseof.html

@@ -37,7 +37,7 @@
   {{ if not .Site.Params.hideColorSchemeToggle }}
   {{ errorf "Invalid configuration. Default JS scripts are disabled, but 'hideColorSchemeToggle' is false." }}
   {{end}}
-  {{ else if .Site.IsServer }}
+  {{ else if hugo.IsServer }}
   {{ $script := resources.Get "js/coder.js" }}
   <script src="{{ $script.RelPermalink }}"></script>
   {{ else }}
@@ -46,7 +46,7 @@
   {{ end }}
 
   {{ range .Site.Params.customJS }}
-  {{ if $.Site.IsServer }}
+  {{ if hugo.IsServer }}
   {{ $script := resources.Get . }}
   <script src="{{ $script.RelPermalink }}"></script>
   {{ else }}
@@ -56,7 +56,7 @@
   {{ end }}
 
   {{ range .Site.Params.customRemoteJS }}
-  {{ if $.Site.IsServer }}
+  {{ if hugo.IsServer }}
   {{ $script := resources.GetRemote . }}
   <script src="{{ $script.RelPermalink }}"></script>
   {{ else }}

+ 1 - 1
layouts/partials/head/color-scheme.html

@@ -1,5 +1,5 @@
 {{ if or (eq .Site.Params.colorScheme "auto") (eq .Site.Params.colorScheme "dark") }}
-  {{ if .Site.IsServer }}
+  {{ if hugo.IsServer }}
     {{ $cssOpts := (dict "targetPath" "css/coder-dark.css" "enableSourceMap" true ) }}
     {{ $styles := resources.Get "scss/coder-dark.scss" | resources.ExecuteAsTemplate "style.coder-dark.css" . | toCSS $cssOpts }}
     <link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">

+ 2 - 2
layouts/partials/head/custom-styles.html

@@ -1,5 +1,5 @@
  {{ range .Site.Params.customCSS }}
-  {{ if $.Site.IsServer }}
+  {{ if hugo.IsServer }}
     {{ $styles := resources.Get . }}
     <link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
   {{ else }}
@@ -10,7 +10,7 @@
 
 {{ range .Site.Params.customSCSS }}
   {{/* We don't change the targetPath to because it's transparent to users */}}
-  {{ if $.Site.IsServer }}
+  {{ if hugo.IsServer }}
     {{ $cssOpts := (dict "enableSourceMap" true ) }}
     {{ $styles := resources.Get . | toCSS $cssOpts }}
     <link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">

+ 2 - 2
layouts/partials/head/theme-styles.html

@@ -2,7 +2,7 @@
 <link rel="preload" href="/fonts/fa-regular-400.woff2" as="font" type="font/woff2" crossorigin>
 <link rel="preload" href="/fonts/fa-solid-900.woff2" as="font" type="font/woff2" crossorigin>
 
-{{ if .Site.IsServer }}
+{{ if hugo.IsServer }}
   {{ $cssOpts := (dict "targetPath" "css/coder.css" "enableSourceMap" true ) }}
   {{ $styles := resources.Get "scss/coder.scss" | resources.ExecuteAsTemplate "style.coder.css" . | toCSS $cssOpts }}
   <link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
@@ -13,7 +13,7 @@
 {{ end }}
 
 {{ if .Site.Params.rtl }}
-  {{ if .Site.IsServer }}
+  {{ if hugo.IsServer }}
     {{ $cssOpts := (dict "targetPath" "css/coder-rtl.css" "enableSourceMap" true ) }}
     {{ $styles := resources.Get "scss/coder-rtl.scss" | resources.ExecuteAsTemplate "style.coder-rtl.css" . | toCSS $cssOpts }}
     <link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">

+ 2 - 2
layouts/partials/header.html

@@ -5,7 +5,7 @@
       {{ .Title }}
     </a>
     {{ end }}
-    {{ if or .Site.Menus.main .Site.IsMultiLingual }}
+    {{ if or .Site.Menus.main hugo.IsMultilingual }}
       <input type="checkbox" id="menu-toggle" />
       <label class="menu-button float-right" for="menu-toggle">
         <i class="fa-solid fa-bars fa-fw" aria-hidden="true"></i>
@@ -18,7 +18,7 @@
             </li>
           {{ end }}
         {{ end }}
-        {{ if .Site.IsMultiLingual }}
+        {{ if hugo.IsMultilingual }}
           {{ $node := . }}
           {{ .Scratch.Set "separator" true }}
           {{ range (default .Site.Home.AllTranslations .Translations) }}

+ 1 - 1
netlify.toml

@@ -3,7 +3,7 @@ publish = "exampleSite/public"
 command = "cd exampleSite && hugo --themesDir=../.. --baseURL $URL"
 
 [build.environment]
-HUGO_VERSION = "0.124.1"
+HUGO_VERSION = "0.126.1"
 HUGO_THEME = "repo"
 
 [context.deploy-preview]

+ 1 - 1
theme.toml

@@ -21,7 +21,7 @@ features = [
   "single-column",
   "syntax-highlighting"
 ]
-min_version = "0.120.0"
+min_version = "0.124.0"
 
 [author]
 name = "Luiz F. A. de Prá"