Skip to content

Commit 12ca3c8

Browse files
t-lopoettering
authored andcommitted
hugo: bump version to 0.147.8, address deprecations
This change bumps the Hugo version used to build web pages to v0.147.8 and addresses build issues introduced by functions deprecated in newer hugo versions: - .Site.IsMultiLingual => hugo.IsMultilingual - resources.ToCSS => css.Sass Templates and partials that use deprecated functions are now overridden in layout/. Lastly, symlink from content/ to the Readme was removed as Hugo does noti support symlinks anymore, and replaced by "mounts" in config.toml. The Hugo version was bumped in gh-pages.yml. Signed-off-by: Thilo Fromm <[email protected]>
1 parent af776dc commit 12ca3c8

File tree

6 files changed

+85
-3
lines changed

6 files changed

+85
-3
lines changed

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup Hugo
2222
uses: peaceiris/actions-hugo@v2
2323
with:
24-
hugo-version: '0.104.3'
24+
hugo-version: '0.147.8'
2525
extended: true
2626

2727
- name: Build

website/config.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,8 @@ theme = "hugo-book"
3131
BookCommitPath = 'commit'
3232
BookEditPath = 'edit/main'
3333
BookIndexPage = 'README.md'
34+
35+
[modules]
36+
[[module.mounts]]
37+
source = '../README.md'
38+
target = 'content/_index.md'

website/content/_index.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

website/layouts/404.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
<html lang="{{ .Site.Language.Lang }}">
3+
4+
<head>
5+
{{ partial "docs/html-head" . }}
6+
{{ partial "docs/inject/head" . }}
7+
8+
<style>
9+
.not-found {
10+
text-align: center;
11+
}
12+
.not-found h1 {
13+
margin: .25em 0 0 0;
14+
opacity: .25;
15+
font-size: 40vmin;
16+
}
17+
</style>
18+
</head>
19+
20+
<body>
21+
<main class="flex justify-center not-found">
22+
<div>
23+
<h1>404</h1>
24+
<h2>Page Not Found</h2>
25+
<h3>
26+
<a href="{{ .Site.Home.RelPermalink }}">{{ .Site.Title }}</a>
27+
</h3>
28+
</div>
29+
</main>
30+
31+
{{ partial "docs/inject/body" . }}
32+
{{ template "_internal/google_analytics.html" . }}
33+
</body>
34+
35+
</html>

website/layouts/partials/docs/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="flex flex-wrap justify-between">
2-
{{ if .Site.IsMultiLingual }}
2+
{{ if hugo.IsMultilingual }}
33
{{ partial "docs/languages" . }}
44
{{ end }}
55

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<meta charset="UTF-8">
2+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
3+
<meta name="description" content="{{ default .Summary .Description }}">
4+
<meta name="theme-color" content="#FFFFFF">
5+
6+
{{- template "_internal/opengraph.html" . -}}
7+
8+
<title>{{ partial "docs/title" . }} | {{ .Site.Title -}}</title>
9+
10+
{{- $manifest := resources.Get "manifest.json" | resources.ExecuteAsTemplate "manifest.json" . }}
11+
<link rel="manifest" href="{{ $manifest.RelPermalink }}">
12+
<link rel="icon" href="{{ "favicon.png" | relURL }}" type="image/x-icon">
13+
14+
{{- range .Translations }}
15+
<link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}" title="{{ partial "docs/title" . }}">
16+
{{ end -}}
17+
18+
<!-- Theme stylesheet, you can customize scss by creating `assets/custom.scss` in your website -->
19+
{{- $styles := resources.Get "book.scss" | resources.ExecuteAsTemplate "book.scss" . | css.Sass | resources.Minify | resources.Fingerprint }}
20+
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}">
21+
22+
{{- if default true .Site.Params.BookSearch }}
23+
{{- $searchJSFile := printf "%s.search.js" .Language.Lang }}
24+
{{- $searchJS := resources.Get "search.js" | resources.ExecuteAsTemplate $searchJSFile . | resources.Minify | resources.Fingerprint }}
25+
<script defer src="{{ $searchJS.RelPermalink }}" integrity="{{ $searchJS.Data.Integrity }}"></script>
26+
{{ end -}}
27+
28+
{{- if .Site.Params.BookServiceWorker }}
29+
{{- $swJS := resources.Get "sw-register.js" | resources.ExecuteAsTemplate "sw.js" . | resources.Minify | resources.Fingerprint }}
30+
<script defer src="{{ $swJS.RelPermalink }}" integrity="{{ $swJS.Data.Integrity }}"></script>
31+
{{ end -}}
32+
33+
{{- template "_internal/google_analytics.html" . -}}
34+
35+
<!-- RSS -->
36+
{{- with .OutputFormats.Get "rss" -}}
37+
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
38+
{{ end -}}
39+
40+
{{ "<!--" | safeHTML }}
41+
Made with Book Theme
42+
https://github.com/alex-shpak/hugo-book
43+
{{ "-->" | safeHTML }}

0 commit comments

Comments
 (0)