Skip to content

Commit 207a371

Browse files
Copilottjeerdijk
andcommitted
Update Hugo from 0.126.1 to 0.152.2 and fix deprecated features
Co-authored-by: tjeerdijk <26492048+tjeerdijk@users.noreply.github.com>
1 parent 5aacdeb commit 207a371

3 files changed

Lines changed: 44 additions & 2 deletions

File tree

layouts/partials/css.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- Include all theme CSS filenames here -->
22
{{- $page := . -}}
33

4-
{{- $inServerMode := .Site.IsServer -}}
4+
{{- $inServerMode := hugo.IsServer -}}
55
{{- $sass := (slice "theme-css/fresh/core.scss") -}}
66
{{- $cssOpts := cond ($inServerMode) (dict "enableSourceMap" true) (dict "outputStyle" "compressed") -}}
77

layouts/partials/javascript.html

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{{- $inServerMode := hugo.IsServer -}}
2+
3+
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
4+
5+
<!-- Custom JS -->
6+
<!-- All JS files under static/js are included -->
7+
{{- $jsFiles := resources.Match "js/*.js" -}}
8+
{{- if $inServerMode -}}
9+
{{- $js := $jsFiles | resources.Concat "js/bundle.js" }}
10+
<script type="text/javascript" src={{ $js.RelPermalink }}></script>
11+
{{ else }}
12+
{{- $js := $jsFiles | resources.Concat "js/bundle.js" | resources.Minify }}
13+
<script type="text/javascript" src={{ $js.RelPermalink }}></script>
14+
{{- end -}}
15+
16+
<script type="text/javascript">setupShortcuts(maxLevel={{ default 2 .Page.Params.shortcutDepth }});</script>
17+
18+
{{- if .HasShortcode "youtube" }}
19+
<script type="text/javascript">
20+
var buttons = document.getElementsByClassName("video-transcript-button");
21+
var i;
22+
23+
for (i = 0; i < buttons.length; i++) {
24+
buttons[i].addEventListener("click", function() {
25+
this.classList.toggle("active");
26+
var content = this.nextElementSibling;
27+
if (content.style.display === "block") {
28+
content.style.display = "none";
29+
} else {
30+
content.style.display = "block";
31+
}
32+
});
33+
}
34+
</script>
35+
{{ end -}}
36+
37+
{{- if .HasShortcode "mermaid" }}
38+
<script type="module">
39+
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10.1.0/dist/mermaid.esm.min.mjs';
40+
mermaid.initialize({ startOnLoad: true });
41+
</script>
42+
{{ end -}}

netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[build.environment]
2-
HUGO_VERSION = "0.126.1"
2+
HUGO_VERSION = "0.152.2"

0 commit comments

Comments
 (0)