Skip to content

Commit 4aafdfb

Browse files
authored
Merge pull request #498 from espressif/chore/update_theme_submodule
Update versions of Hugo and blowfish
2 parents 3ea94aa + 6bdb7b9 commit 4aafdfb

File tree

8 files changed

+102
-8
lines changed

8 files changed

+102
-8
lines changed

.github/workflows/cron-deploy-hugo-site.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
- name: Install Hugo CLI
3232
env:
33-
HUGO_VERSION: 0.135.0
33+
HUGO_VERSION: 0.147.5
3434
run: |
3535
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
3636
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb

.github/workflows/deploy-production.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
- name: Install Hugo CLI
3333
env:
34-
HUGO_VERSION: 0.135.0
34+
HUGO_VERSION: 0.147.5
3535
run: |
3636
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
3737
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb

.github/workflows/pr-build-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
steps:
1818
- name: Install Hugo CLI
1919
env:
20-
HUGO_VERSION: 0.135.0
20+
HUGO_VERSION: 0.147.5
2121
run: |
2222
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
2323
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb

.gitlab/ci/build_hugo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
build_hugo:
22
stage: build_hugo
3-
image: "${CI_TEMPLATE_REGISTRY_HOST}/pages/hugo/hugo_extended:0.135.0"
3+
image: "hugomods/hugo:debian-base-0.147.5"
44
tags:
55
- build_docs
66
rules:

layouts/_default/single.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
{{ if .Params.showHero | default (.Site.Params.article.showHero | default false) }}
66
{{ $heroStyle := .Params.heroStyle }}
77
{{ if not $heroStyle }}{{ $heroStyle = .Site.Params.article.heroStyle }}{{ end }}
8-
{{ $heroStyle := print "partials/hero/" $heroStyle ".html" }}
9-
{{ if templates.Exists $heroStyle }}
8+
{{ $heroStyle := print "hero/" $heroStyle ".html" }}
9+
{{ if templates.Exists ( printf "partials/%s" $heroStyle ) }}
1010
{{ partial $heroStyle . }}
1111
{{ else }}
12-
{{ partial "partials/hero/basic.html" . }}
12+
{{ partial "hero/basic.html" . }}
1313
{{ end }}
1414
{{ end }}
1515

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{{/*
2+
Copied from Hugo v0.146
3+
Source: https://github.com/gohugoio/hugo/blob/83cfdd78ca6469e6d7265323d9fad1448880e559/tpl/tplimpl/embedded/templates/_shortcodes/figure.html
4+
*/}}
5+
6+
<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
7+
{{- if .Get "link" -}}
8+
<a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>
9+
{{- end -}}
10+
11+
{{- $u := urls.Parse (.Get "src") -}}
12+
{{- $src := $u.String -}}
13+
{{- if not $u.IsAbs -}}
14+
{{- with or (.Page.Resources.Get $u.Path) (resources.Get $u.Path) -}}
15+
{{- $src = .RelPermalink -}}
16+
{{- end -}}
17+
{{- end -}}
18+
19+
<img src="{{ $src }}"
20+
{{- if or (.Get "alt") (.Get "caption") }}
21+
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
22+
{{- end -}}
23+
{{- with .Get "width" }} width="{{ . }}"{{ end -}}
24+
{{- with .Get "height" }} height="{{ . }}"{{ end -}}
25+
{{- with .Get "loading" }} loading="{{ . }}"{{ end -}}
26+
><!-- Closing img tag -->
27+
{{- if .Get "link" }}</a>{{ end -}}
28+
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
29+
<figcaption>
30+
{{ with (.Get "title") -}}
31+
<h4>{{ . }}</h4>
32+
{{- end -}}
33+
{{- if or (.Get "caption") (.Get "attr") -}}<p>
34+
{{- .Get "caption" | markdownify -}}
35+
{{- with .Get "attrlink" }}
36+
<a href="{{ . }}">
37+
{{- end -}}
38+
{{- .Get "attr" | markdownify -}}
39+
{{- if .Get "attrlink" }}</a>{{ end }}</p>
40+
{{- end }}
41+
</figcaption>
42+
{{- end }}
43+
</figure>

layouts/shortcodes/figure.html

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }}
2+
{{ if .Get "default" }}
3+
{{ partial "hugo-embedded/shortcodes/figure-default.html" . }}
4+
{{ else }}
5+
{{- $url := urls.Parse (.Get "src") }}
6+
{{- $altText := .Get "alt" }}
7+
{{- $caption := .Get "caption" }}
8+
{{- $href := .Get "href" }}
9+
{{- $class := .Get "class" }}
10+
{{- $target := .Get "target" | default "_blank" }}
11+
{{- $nozoom := .Get "nozoom" | default false -}}
12+
13+
<figure>
14+
{{- with $href }}<a href="{{ . }}" {{ with $target }}target="{{ . }}"{{ end }}>{{ end -}}
15+
{{- if findRE "^https?" $url.Scheme }}
16+
<img class="my-0 rounded-md{{ with $nozoom }} nozoom{{ end }}{{ with $class }} {{ . }}{{ end }}" src="{{ $url.String }}" alt="{{ $altText }}" />
17+
{{- else }}
18+
{{- $resource := "" }}
19+
{{- if $.Page.Resources.GetMatch ($url.String) }}
20+
{{- $resource = $.Page.Resources.GetMatch ($url.String) }}
21+
{{- else if resources.GetMatch ($url.String) }}
22+
{{- $resource = resources.Get ($url.String) }}
23+
{{- end }}
24+
{{- with $resource }}
25+
{{- if or $disableImageOptimization (eq .MediaType.SubType "svg")}}
26+
<img
27+
class="my-0 rounded-md{{ with $nozoom }} nozoom{{ end }}{{ with $class }} {{ . }}{{ end }}"
28+
src="{{ .RelPermalink }}"
29+
alt="{{ $altText }}"
30+
/>
31+
{{- else }}
32+
<img
33+
class="my-0 rounded-md{{ with $nozoom }} nozoom{{ end }}{{ with $class }} {{ . }}{{ end }}"
34+
srcset="
35+
{{ (.Resize "330x").RelPermalink }} 330w,
36+
{{ (.Resize "660x").RelPermalink }} 660w,
37+
{{ (.Resize "1024x").RelPermalink }} 1024w,
38+
{{ (.Resize "1320x").RelPermalink }} 2x"
39+
src="{{ (.Resize "660x").RelPermalink }}"
40+
data-zoom-src="{{ (.Resize "1320x").RelPermalink }}"
41+
alt="{{ $altText }}"
42+
/>
43+
{{- end }}
44+
{{- else }}
45+
<img class="my-0 rounded-md{{ with $nozoom }} nozoom{{ end }}{{ with $class }} {{ . }}{{ end }}" src="{{ $url.String }}" alt="{{ $altText }}" />
46+
{{- end }}
47+
{{- end }}
48+
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
49+
{{ if $href }}</a>{{ end }}
50+
</figure>
51+
{{- end -}}

themes/blowfish

Submodule blowfish updated 78 files

0 commit comments

Comments
 (0)