0.158.0 deprecations (#805)
* 0.158.0 changes - using same capitalization as huge docs * LanguageCode -> Locale LanguageDirection -> Direction LanguageName -> Label * language.lang to language.name * all changed functions added in 0.158.0
This commit is contained in:
@@ -29,7 +29,7 @@ jobs:
|
|||||||
- name: Setup Hugo
|
- name: Setup Hugo
|
||||||
uses: peaceiris/actions-hugo@v3
|
uses: peaceiris/actions-hugo@v3
|
||||||
with:
|
with:
|
||||||
hugo-version: 0.146.7
|
hugo-version: 0.158.0
|
||||||
extended: true
|
extended: true
|
||||||
- name: Run Hugo
|
- name: Run Hugo
|
||||||
working-directory: exampleSite
|
working-directory: exampleSite
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
hugo-version:
|
hugo-version:
|
||||||
- 'latest'
|
- 'latest'
|
||||||
- '0.146.7'
|
- '0.158.0'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Hugo Book Theme
|
# Hugo Book Theme
|
||||||
|
|
||||||
[](https://gohugo.io)
|
[](https://gohugo.io)
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||

|

|
||||||
|
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- Hugo 0.146 or higher
|
- Hugo 0.158 or higher
|
||||||
- Hugo extended version, [Installation Instructions](https://gohugo.io/installation/)
|
- Hugo extended version, [Installation Instructions](https://gohugo.io/installation/)
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
{{ $searchDataFile := printf "%s.search-data.json" .Language.Lang }}
|
{{ $searchDataFile := printf "%s.search-data.json" .Language.Name }}
|
||||||
{{ $searchData := resources.Get "search-data.json" | resources.ExecuteAsTemplate $searchDataFile . | resources.Minify | resources.Fingerprint }}
|
{{ $searchData := resources.Get "search-data.json" | resources.ExecuteAsTemplate $searchDataFile . | resources.Minify | resources.Fingerprint }}
|
||||||
{{ $searchConfig := i18n "bookSearchConfig" | default "{}" }}
|
{{ $searchConfig := i18n "bookSearchConfig" | default "{}" }}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ layout: landing
|
|||||||
# HUGO BOOK {anchor=false}
|
# HUGO BOOK {anchor=false}
|
||||||
[Hugo](https://gohugo.io) documentation theme as simple as plain book
|
[Hugo](https://gohugo.io) documentation theme as simple as plain book
|
||||||
|
|
||||||
[{{< badge style="info" title="Hugo" value="0.146" >}}](https://github.com/gohugoio/hugo/releases/tag/v0.146.7)
|
[{{< badge style="info" title="Hugo" value="0.158" >}}](https://github.com/gohugoio/hugo/releases/tag/v0.158.0)
|
||||||
[{{< badge style="default" title="License" value="MIT" >}}](https://github.com/alex-shpak/hugo-book/blob/main/LICENSE)
|
[{{< badge style="default" title="License" value="MIT" >}}](https://github.com/alex-shpak/hugo-book/blob/main/LICENSE)
|
||||||
|
|
||||||
{{<button href="/docs/example">}}Explore{{</button>}}
|
{{<button href="/docs/example">}}Explore{{</button>}}
|
||||||
|
|||||||
@@ -31,19 +31,19 @@ enableGitInfo = true
|
|||||||
# And https://gohugo.io/content-management/multilingual/#translation-by-content-directory
|
# And https://gohugo.io/content-management/multilingual/#translation-by-content-directory
|
||||||
[languages]
|
[languages]
|
||||||
[languages.en]
|
[languages.en]
|
||||||
languageName = 'English'
|
label = 'English'
|
||||||
contentDir = 'content.en'
|
contentDir = 'content.en'
|
||||||
weight = 1
|
weight = 1
|
||||||
|
|
||||||
[languages.zh]
|
[languages.zh]
|
||||||
languageName = 'Chinese'
|
label = 'Chinese'
|
||||||
contentDir = 'content.zh'
|
contentDir = 'content.zh'
|
||||||
weight = 2
|
weight = 2
|
||||||
|
|
||||||
[languages.he]
|
[languages.he]
|
||||||
languageName = 'Hebrew'
|
label = 'Hebrew'
|
||||||
contentDir = 'content.he'
|
contentDir = 'content.he'
|
||||||
languageDirection = 'rtl'
|
direction = 'rtl'
|
||||||
weight = 3
|
weight = 3
|
||||||
|
|
||||||
[menu]
|
[menu]
|
||||||
|
|||||||
@@ -30,17 +30,17 @@ markup:
|
|||||||
# And https://gohugo.io/content-management/multilingual/#translation-by-content-directory
|
# And https://gohugo.io/content-management/multilingual/#translation-by-content-directory
|
||||||
languages:
|
languages:
|
||||||
en:
|
en:
|
||||||
languageName: English
|
label: English
|
||||||
contentDir: content.en
|
contentDir: content.en
|
||||||
weight: 1
|
weight: 1
|
||||||
zh:
|
zh:
|
||||||
languageName: Chinese
|
label: Chinese
|
||||||
contentDir: content.zh
|
contentDir: content.zh
|
||||||
weight: 2
|
weight: 2
|
||||||
he:
|
he:
|
||||||
languageName: Hebrew
|
label: Hebrew
|
||||||
contentDir: content.he
|
contentDir: content.he
|
||||||
languageDirection: rtl
|
direction: rtl
|
||||||
weight: 3
|
weight: 3
|
||||||
|
|
||||||
menu:
|
menu:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[module]
|
[module]
|
||||||
[module.hugoVersion]
|
[module.hugoVersion]
|
||||||
extended = true
|
extended = true
|
||||||
min = "0.146.0"
|
min = "0.158.0"
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="{{ .Site.Language.Lang }}">
|
<html lang="{{ .Site.Language.Name }}">
|
||||||
<head>
|
<head>
|
||||||
{{ partial "docs/html-head" . }}
|
{{ partial "docs/html-head" . }}
|
||||||
{{ partial "docs/inject/head" . }}
|
{{ partial "docs/inject/head" . }}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ https://github.com/alex-shpak/hugo-book
|
|||||||
<link rel="canonical" href="{{ .Permalink }}">
|
<link rel="canonical" href="{{ .Permalink }}">
|
||||||
|
|
||||||
{{- range .Translations }}
|
{{- range .Translations }}
|
||||||
<link rel="alternate" hreflang="{{ default .Site.LanguageCode .Language.Lang }}" href="{{ .Permalink }}" title="{{ partial "docs/title" . }}">
|
<link rel="alternate" hreflang="{{ default .Site.Language.Locale .Language.Name }}" href="{{ .Permalink }}" title="{{ partial "docs/title" . }}">
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
<!-- Theme stylesheet, you can customize scss by creating `assets/custom.scss` in your website -->
|
<!-- Theme stylesheet, you can customize scss by creating `assets/custom.scss` in your website -->
|
||||||
@@ -34,7 +34,7 @@ https://github.com/alex-shpak/hugo-book
|
|||||||
|
|
||||||
<!-- Search -->
|
<!-- Search -->
|
||||||
{{- if default true .Site.Params.BookSearch -}}
|
{{- if default true .Site.Params.BookSearch -}}
|
||||||
{{- $searchJSFile := printf "%s.search.js" .Language.Lang }}
|
{{- $searchJSFile := printf "%s.search.js" .Language.Name }}
|
||||||
{{- $searchJS := resources.Get "search.js" | resources.ExecuteAsTemplate $searchJSFile . | resources.Minify | resources.Fingerprint }}
|
{{- $searchJS := resources.Get "search.js" | resources.ExecuteAsTemplate $searchJSFile . | resources.Minify | resources.Fingerprint }}
|
||||||
<script defer src="{{ "fuse.min.js" | relURL }}"></script>
|
<script defer src="{{ "fuse.min.js" | relURL }}"></script>
|
||||||
<script defer src="{{ partial "docs/links/resource-precache" $searchJS }}" {{ template "integrity" $searchJS }}></script>
|
<script defer src="{{ partial "docs/links/resource-precache" $searchJS }}" {{ template "integrity" $searchJS }}></script>
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
{{ $translations := dict }}
|
{{ $translations := dict }}
|
||||||
{{ if (eq $bookTranslatedOnly false ) }}
|
{{ if (eq $bookTranslatedOnly false ) }}
|
||||||
{{ range .Site.Home.Translations }}
|
{{ range .Site.Home.Translations }}
|
||||||
{{ $translations = merge $translations (dict .Language.Lang .) }}
|
{{ $translations = merge $translations (dict .Language.Name .) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ range .Translations }}
|
{{ range .Translations }}
|
||||||
{{ $translations = merge $translations (dict .Language.Lang .) }}
|
{{ $translations = merge $translations (dict .Language.Name .) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<ul class="book-languages">
|
<ul class="book-languages">
|
||||||
@@ -15,16 +15,16 @@
|
|||||||
<label for="languages" class="flex">
|
<label for="languages" class="flex">
|
||||||
<a role="button">
|
<a role="button">
|
||||||
<img src="{{ partial "docs/icon" "translate" }}" class="book-icon" alt="{{ partial "docs/text/i18n" "Languages" }}" />
|
<img src="{{ partial "docs/icon" "translate" }}" class="book-icon" alt="{{ partial "docs/text/i18n" "Languages" }}" />
|
||||||
{{ $.Site.Language.LanguageName }}
|
{{ $.Site.Language.Label }}
|
||||||
</a>
|
</a>
|
||||||
<img src="{{ partial "docs/icon" "chevron-right" }}" class="book-icon" alt="{{ partial "docs/text/i18n" "Expand" }}" />
|
<img src="{{ partial "docs/icon" "chevron-right" }}" class="book-icon" alt="{{ partial "docs/text/i18n" "Expand" }}" />
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
{{ range .Site.Languages }}{{ with index $translations .Lang }}
|
{{ range .Site.Languages }}{{ with index $translations .Name }}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ cond hugo.IsMultihost .Permalink .RelPermalink }}" class="flex flex-auto">
|
<a href="{{ cond hugo.IsMultihost .Permalink .RelPermalink }}" class="flex flex-auto">
|
||||||
{{ .Language.LanguageName }}
|
{{ .Language.Label }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{{ end }}{{ end }}
|
{{ end }}{{ end }}
|
||||||
|
|||||||
+2
-2
@@ -1,10 +1,10 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="{{ default .Site.Language.Lang .Site.LanguageCode }}" dir="{{ default "ltr" .Site.Language.LanguageDirection }}">
|
<html lang="{{ default .Site.Language.Name .Site.Language.Locale }}" dir="{{ default "ltr" .Site.Language.Direction }}">
|
||||||
<head>
|
<head>
|
||||||
{{ partial "docs/html-head" . }}
|
{{ partial "docs/html-head" . }}
|
||||||
{{ partial "docs/inject/head" . }}
|
{{ partial "docs/inject/head" . }}
|
||||||
</head>
|
</head>
|
||||||
<body dir="{{ default "ltr" .Site.Language.LanguageDirection }}" class="book-kind-{{ .Kind }} book-type-{{ .Type }}{{ with .Layout }} book-layout-{{ . }}{{ end }}">
|
<body dir="{{ default "ltr" .Site.Language.Direction }}" class="book-kind-{{ .Kind }} book-type-{{ .Type }}{{ with .Layout }} book-layout-{{ . }}{{ end }}">
|
||||||
<input type="checkbox" class="hidden toggle" id="menu-control" />
|
<input type="checkbox" class="hidden toggle" id="menu-control" />
|
||||||
<input type="checkbox" class="hidden toggle" id="toc-control" />
|
<input type="checkbox" class="hidden toggle" id="toc-control" />
|
||||||
<main class="container flex">
|
<main class="container flex">
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ homepage = "https://github.com/alex-shpak/hugo-book"
|
|||||||
demosite = "https://hugo-book-demo.netlify.app"
|
demosite = "https://hugo-book-demo.netlify.app"
|
||||||
tags = ["responsive", "clean", "documentation", "docs", "flexbox", "search", "mobile", "multilingual", "disqus"]
|
tags = ["responsive", "clean", "documentation", "docs", "flexbox", "search", "mobile", "multilingual", "disqus"]
|
||||||
features = []
|
features = []
|
||||||
min_version = "0.146.0"
|
min_version = "0.158.0"
|
||||||
|
|
||||||
[author]
|
[author]
|
||||||
name = "Alex Shpak"
|
name = "Alex Shpak"
|
||||||
|
|||||||
Reference in New Issue
Block a user