Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 65ea13d

Browse files
authored
Update layout shortcodes (#1532)
1 parent 692bf5e commit 65ea13d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

layouts/shortcodes/github.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
{{ if (.Get "ref") }}
33
{{ $ref = printf "?ref=%s" (.Get "ref") }}
44
{{ end }}
5-
{{ $dataJ := getJSON "https://api.github.com/repos/" (.Get "repo") "/contents/" (.Get "file") $ref }}
6-
{{ $con := base64Decode $dataJ.content }}
5+
{{ $json := resources.GetRemote "https://api.github.com/repos/" (.Get "repo") "/contents/" (.Get "file") $ref }}
6+
{{ $data := $json | transform.Unmarshal }}
7+
{{ $con := base64Decode $data.content }}
78
{{ $content := "" }}
89
{{ $lines := split $con "\n" }}
910
{{ $startIndex := (sub ((.Get "start") | default 1 | int) 1)}}

0 commit comments

Comments
 (0)