Skip to content

Commit b1b9008

Browse files
authored
Merge pull request #281 from dotboris/hugo-0.55-compat
Make shortcodes & example site compatible with Hugo v0.55
2 parents 6d1ac48 + 24da9d9 commit b1b9008

File tree

17 files changed

+30
-24
lines changed

17 files changed

+30
-24
lines changed

exampleSite/content/basics/installation/_index.en.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Discover what this Hugo theme is all about and the core concepts behind it.
4848

4949
renders as
5050

51-
![A Chapter](/basics/installation/images/chapter.png?classes=shadow&width=60pc)
51+
![A Chapter](/en/basics/installation/images/chapter.png?classes=shadow&width=60pc)
5252

5353
**Hugo-theme-learn** provides archetypes to create skeletons for your website. Begin by creating your first chapter page with the following command
5454

exampleSite/content/basics/installation/_index.fr.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Découvrez comment utiliser ce thème Hugo et apprenez en les concepts
4848

4949
s'affiche comme
5050

51-
![Un chapitre](/basics/installation/images/chapter.png?classes=shadow&width=60pc)
51+
![Un chapitre](/en/basics/installation/images/chapter.png?classes=shadow&width=60pc)
5252

5353
**Hugo-theme-learn** fournit des archétypes pour créer des squelettes pour votre site. Commencez par créer votre premier chapitre avec la commande suivante:
5454

exampleSite/content/basics/requirements/_index.en.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ Thanks to the simplicity of Hugo, this page is as empty as this theme needs requ
88

99
Just download latest version of [Hugo binary (> 0.25)](https://gohugo.io/getting-started/installing/) for your OS (Windows, Linux, Mac) : it's that simple.
1010

11-
![Magic](/basics/requirements/images/magic.gif?classes=shadow)
11+
![Magic](/en/basics/requirements/images/magic.gif?classes=shadow)

exampleSite/content/basics/requirements/_index.fr.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ Grâce à la simplicité d'Hugo, cette page est vide car il n'y a quasi pas de p
88

99
Téléchargez la dernière version du [binaire Hugo (> 0.25)](https://gohugo.io/getting-started/installing/) pour votre Système d'exploitation (Windows, Linux, Mac) : et c'est tout !
1010

11-
![Magic](/basics/requirements/images/magic.gif?classes=shadow)
11+
![Magic](/en/basics/requirements/images/magic.gif?classes=shadow)

exampleSite/content/basics/style-customization/_index.en.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ If you need to change this default behavior, create a new file in `layouts/parti
5353
themeVariant = "red"
5454
```
5555

56-
![Red variant](/basics/style-customization/images/red-variant.png?width=60pc)
56+
![Red variant](/en/basics/style-customization/images/red-variant.png?width=60pc)
5757

5858
### Blue variant
5959

@@ -63,7 +63,7 @@ If you need to change this default behavior, create a new file in `layouts/parti
6363
themeVariant = "blue"
6464
```
6565

66-
![Blue variant](/basics/style-customization/images/blue-variant.png?width=60pc)
66+
![Blue variant](/en/basics/style-customization/images/blue-variant.png?width=60pc)
6767

6868
### Green variant
6969

@@ -73,7 +73,7 @@ If you need to change this default behavior, create a new file in `layouts/parti
7373
themeVariant = "green"
7474
```
7575

76-
![Green variant](/basics/style-customization/images/green-variant.png?width=60pc)
76+
![Green variant](/en/basics/style-customization/images/green-variant.png?width=60pc)
7777

7878
### 'Yours‘ variant
7979

exampleSite/content/basics/style-customization/_index.fr.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Si vous avez besoin de changer ce comportement par défaut, créer un nouveau fi
5353
themeVariant = "red"
5454
```
5555

56-
![Variante rouge](/basics/style-customization/images/red-variant.png?width=60pc)
56+
![Variante rouge](/en/basics/style-customization/images/red-variant.png?width=60pc)
5757

5858
### Variante bleue
5959

@@ -63,7 +63,7 @@ Si vous avez besoin de changer ce comportement par défaut, créer un nouveau fi
6363
themeVariant = "blue"
6464
```
6565

66-
![Variante bleue](/basics/style-customization/images/blue-variant.png?width=60pc)
66+
![Variante bleue](/en/basics/style-customization/images/blue-variant.png?width=60pc)
6767

6868
### Variante verte
6969

@@ -73,7 +73,7 @@ Si vous avez besoin de changer ce comportement par défaut, créer un nouveau fi
7373
themeVariant = "green"
7474
```
7575

76-
![Variante verte](/basics/style-customization/images/green-variant.png?width=60pc)
76+
![Variante verte](/en/basics/style-customization/images/green-variant.png?width=60pc)
7777

7878
### Votre variante
7979

exampleSite/content/cont/i18n/_index.en.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ It provides:
1212
- Automatic menu generation from multilingual content
1313
- In-browser language switching
1414

15-
![I18n menu](/cont/i18n/images/i18n-menu.gif)
15+
![I18n menu](/en/cont/i18n/images/i18n-menu.gif)
1616

1717
## Basic configuration
1818

@@ -75,4 +75,4 @@ Just set `disableLanguageSwitchingButton=true` in your `config.toml`
7575
disableLanguageSwitchingButton = true
7676
```
7777

78-
![I18n menu](/cont/i18n/images/i18n-menu.gif)
78+
![I18n menu](/en/cont/i18n/images/i18n-menu.gif)

exampleSite/content/cont/i18n/_index.fr.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Il fournit :
1212
- Génération automatique du menu avec le contenu multi-langue
1313
- Modification de la langue dans le navigateur
1414

15-
![I18n menu](/cont/i18n/images/i18n-menu.gif)
15+
![I18n menu](/en/cont/i18n/images/i18n-menu.gif)
1616

1717
## Configuration simple
1818

@@ -75,4 +75,4 @@ Pour ce faire, ajouter le paramètre `disableLanguageSwitchingButton=true` dans
7575
disableLanguageSwitchingButton = true
7676
```
7777

78-
![I18n menu](/cont/i18n/images/i18n-menu.gif)
78+
![I18n menu](/en/cont/i18n/images/i18n-menu.gif)

exampleSite/content/cont/pages/_index.en.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Organize your site like [any other Hugo project](https://gohugo.io/content/organ
4545
A **Chapter** displays a page meant to be used as introduction for a set of child pages. Commonly, it contains a simple title and a catch line to define content that can be found under it.
4646
You can define any HTML as prefix for the menu. In the example below, it's just a number but that could be an [icon](https://fortawesome.github.io/Font-Awesome/).
4747

48-
![Chapter page](/cont/pages/images/pages-chapter.png?width=50pc)
48+
![Chapter page](/en/cont/pages/images/pages-chapter.png?width=50pc)
4949

5050
```markdown
5151
+++
@@ -66,7 +66,7 @@ To tell **Hugo-theme-learn** to consider a page as a chapter, set `chapter=true`
6666

6767
A **Default** page is any other content page.
6868

69-
![Default page](/cont/pages/images/pages-default.png?width=50pc)
69+
![Default page](/en/cont/pages/images/pages-default.png?width=50pc)
7070

7171
```toml
7272
+++
@@ -126,7 +126,7 @@ pre = "<i class='fab fa-github'></i> "
126126
+++
127127
```
128128

129-
![Title with icon](/cont/pages/images/frontmatter-icon.png)
129+
![Title with icon](/en/cont/pages/images/frontmatter-icon.png)
130130

131131
### Ordering sibling menu/page entries
132132

exampleSite/content/cont/pages/_index.fr.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Le fichier `_index.md` est obligatoire dans chaque dossier, c'est en quelques ro
4545
Un **Chapitre** affiche une page vouée à être une introduction pour un ensemble de pages filles. Habituellement, il va seulement contenir un titre et un résumé de la section.
4646
Vous pouvez définir n'importe quel contenu HTML comme préfixe de l'entrée du menu. Dans l'exemple ci-dessous, c'est juste un nombre mais vous pourriez utiliser une [icône](https://fortawesome.github.io/Font-Awesome/).
4747

48-
![Page Chapitre](/cont/pages/images/pages-chapter.png?width=50pc)
48+
![Page Chapitre](/en/cont/pages/images/pages-chapter.png?width=50pc)
4949

5050
```markdown
5151
+++
@@ -66,7 +66,7 @@ Pour dire à **Hugo-theme-learn** de considérer la page comme un chapitre, conf
6666

6767
Une page **Défaut** est n'importe quelle autre page.
6868

69-
![Page défaut](/cont/pages/images/pages-default.png?width=50pc)
69+
![Page défaut](/en/cont/pages/images/pages-default.png?width=50pc)
7070

7171
+++
7272
title = "Installation"
@@ -122,7 +122,7 @@ pre = "<i class='fab fa-github'></i> "
122122
+++
123123
```
124124

125-
![Titre avec icône](/cont/pages/images/frontmatter-icon.png)
125+
![Titre avec icône](/en/cont/pages/images/frontmatter-icon.png)
126126

127127
### Ordonner les entrées dans le menu
128128

layouts/shortcodes/attachments.html

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{ $_hugo_config := `{ "version": 1 }` }}
12
<section class="attachments {{ with .Get "style"}}{{.}}{{ end }}">
23
<label>
34
<i class="fas fa-paperclip" aria-hidden="true"></i>

layouts/shortcodes/button.html

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{ $_hugo_config := `{ "version": 1 }` }}
12
<a {{ with .Get "href"}} href="{{.}}" target="_blank" {{ end }} class="btn btn-default">
23
{{ $icon := .Get "icon" }}
34
{{ $iconposition := .Get "icon-position" }}

layouts/shortcodes/children.html

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{ $_hugo_config := `{ "version": 1 }` }}
12
{{ $showhidden := .Get "showhidden"}}
23
{{ $style := .Get "style" | default "li" }}
34
{{ $depth := .Get "depth" | default 1 }}
@@ -16,7 +17,7 @@
1617
{{ .Scratch.Set "pages" (.Page.Pages | union .Page.Sections) }}
1718
{{end}}
1819
{{end}}
19-
20+
2021
{{ $pages := (.Scratch.Get "pages") }}
2122

2223
{{if eq $sortTerm "Weight"}}
@@ -38,7 +39,7 @@
3839

3940
{{ define "childs" }}
4041
{{ range .menu }}
41-
{{ if and .Params.hidden (not $.showhidden) }}
42+
{{ if and .Params.hidden (not $.showhidden) }}
4243
{{else}}
4344
{{if not .IsHome}}
4445
{{if hasPrefix $.style "h"}}
@@ -74,7 +75,7 @@
7475
{{else}}
7576
{{ .Scratch.Set "pages" .Pages }}
7677
{{end}}
77-
78+
7879
{{ $pages := (.Scratch.Get "pages") }}
7980

8081
{{if eq $.sortTerm "Weight"}}

layouts/shortcodes/expand.html

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{ $_hugo_config := `{ "version": 1 }` }}
12
<div class="expand">
23
<div class="expand-label" style="cursor: pointer;" onclick="$h = $(this);$h.next('div').slideToggle(100,function () {$h.children('i').attr('class',function () {return $h.next('div').is(':visible') ? 'fas fa-chevron-down' : 'fas fa-chevron-right';});});">
34
<i style="font-size:x-small;" class="fas fa-chevron-right"></i>

layouts/shortcodes/mermaid.html

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
{{ $_hugo_config := `{ "version": 1 }` }}
12
<div class="mermaid" align="{{ if .Get "align" }}{{ .Get "align" }}{{ else }}center{{ end }}">{{ safeHTML .Inner }}</div>

layouts/shortcodes/notice.html

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
{{ $_hugo_config := `{ "version": 1 }` }}
12
<div class="notices {{ .Get 0 }}" {{ if len .Params | eq 2 }} id="{{ .Get 1 }}" {{ end }}>{{ .Inner }}</div>

netlify.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[build.environment]
66
HUGO_THEME = "repo"
77
HUGO_THEMESDIR = "/opt/build"
8-
HUGO_VERSION = "0.50"
8+
HUGO_VERSION = "0.55.5"
99

1010
[context.production.environment]
1111
HUGO_BASEURL = "https://learn.netlify.com/"

0 commit comments

Comments
 (0)