Skip to content

Commit 00b4c68

Browse files
committed
Hugo: Update remote resource handling for version bump
1 parent 0a682c4 commit 00b4c68

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

layouts/shortcodes/dimensions.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,11 @@
33
{{ $jsPath := replace $rawJSPath "/static" "" }}
44
{{ $dimensionsRef := dict }}
55
{{ with resources.Get $jsPath }}
6-
{{ with .Err }}
7-
{{ errorf "%s" . }}
8-
{{ else }}
96
{{ $dimensionsRef = . | transform.Unmarshal }}
10-
{{ end }}
117
{{ else }}
12-
{{ errorf "Unable to get asset resource %q" $jsPath }}
8+
{{ errorf "Unable to get asset resource %q" $jsPath }}
139
{{ end }}
1410

15-
1611
<div class="row flex-xl-nowrap">
1712

1813

layouts/shortcodes/ghcode.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{{ $file := .Get 0 }}
22
{{ $params := .Get 1 }}
33
{{ $codeBlockId := printf "id-%x" (now.UnixNano) }}
4-
{{ with resources.GetRemote $file }}
4+
{{ with try (resources.GetRemote $file) }}
55
{{ with .Err }}
66
{{ errorf "%s" . }}
77
{{ else }}
88
{{ $lang := path.Ext $file | strings.TrimPrefix "." }}
99
<div id="code-block-v1" data-mf="false">
10-
{{ highlight .Content $lang $params }}
10+
{{ highlight .Value $lang $params }}
1111
</div>
1212

1313
<div class="code-block" data-mf="true" style="display: none;">
@@ -17,10 +17,10 @@
1717
<div class="code-container chroma">
1818
<button onclick="copyToClipBoard(this, {{ $codeBlockId }})" class="code-copy-button multi-line" type="button">Copy</button>
1919
<div class="highlight-v2" id="{{ $codeBlockId }}">
20-
{{ highlight .Content $lang $params }}
20+
{{ highlight .Value $lang $params }}
2121
</div>
2222
</div>
23-
</div>
23+
</div>
2424
{{ end }}
2525
{{ else }}
2626
{{ errorf "Unable to load github content from %s from %q" $file .Position}}

layouts/shortcodes/metrics.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
{{ $jsPath := replace $rawJSPath "/static" "" }}
44
{{ $metricsRef := dict }}
55
{{ with resources.Get $jsPath }}
6-
{{ with .Err }}
7-
{{ errorf "%s" . }}
8-
{{ else }}
96
{{ $metricsRef = . | transform.Unmarshal }}
10-
{{ end }}
117
{{ else }}
128
{{ errorf "Unable to get asset resource %q" $jsPath }}
139
{{ end }}

0 commit comments

Comments
 (0)