Skip to content

Commit d4966d6

Browse files
committed
fix: replaced getJSON with transform.Unmarshal
1 parent 88b032a commit d4966d6

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

layouts/shortcodes/dimensions.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11

22
{{ $jsPath := .Get "path" }}
3-
{{ $dimensionsRef := getJSON $jsPath }}
3+
{{ $dimensionsRef := dict }}
4+
{{ with resources.Get $jsPath }}
5+
{{ with .Err }}
6+
{{ errorf "%s" . }}
7+
{{ else }}
8+
{{ $dimensionsRef = . | transform.Unmarshal }}
9+
{{ end }}
10+
{{ else }}
11+
{{ warnf "Unable to get remote resource %q" $jsPath }}
12+
{{ end }}
13+
414

515
<div class="row flex-xl-nowrap">
616

layouts/shortcodes/metrics.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11

22
{{ $jsPath := .Get "path" }}
3-
{{ $metricsRef := getJSON $jsPath }}
3+
{{ $metricsRef := dict }}
4+
{{ with resources.Get $jsPath }}
5+
{{ with .Err }}
6+
{{ errorf "%s" . }}
7+
{{ else }}
8+
{{ $metricsRef = . | transform.Unmarshal }}
9+
{{ end }}
10+
{{ else }}
11+
{{ warnf "Unable to get remote resource %q" $jsPath }}
12+
{{ end }}
13+
414

515

616

0 commit comments

Comments
 (0)