From 121909e809b425de5474b9bc4fcbc4910b01515a Mon Sep 17 00:00:00 2001 From: "W.T. Chang" <1546333+wtchangdm@users.noreply.github.com> Date: Thu, 18 Jul 2024 23:33:44 +0800 Subject: [PATCH] fix warning caused by getJSON --- layouts/shortcodes/codeberg.html | 2 +- layouts/shortcodes/github.html | 2 +- layouts/shortcodes/gitlab.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/shortcodes/codeberg.html b/layouts/shortcodes/codeberg.html index bd52323b..ce6a8c33 100644 --- a/layouts/shortcodes/codeberg.html +++ b/layouts/shortcodes/codeberg.html @@ -1,6 +1,6 @@ {{ $id := delimit (slice "codeberg" (partial "functions/uid.html" .)) "-" }} {{- $codebergURL := print "https://codeberg.org/api/v1/repos/" (.Get "repo") -}} -{{- $codebergData := getJSON ($codebergURL) -}} +{{- $codebergData := resources.GetRemote $codebergURL | transform.Unmarshal -}} {{- $codebergColors := .Site.Data.codebergColors -}} {{- with $codebergData -}} diff --git a/layouts/shortcodes/github.html b/layouts/shortcodes/github.html index 2daecd68..56146975 100644 --- a/layouts/shortcodes/github.html +++ b/layouts/shortcodes/github.html @@ -1,6 +1,6 @@ {{ $id := delimit (slice "github" (partial "functions/uid.html" .)) "-" }} {{- $githubURL := print "https://api.github.com/repos/" (.Get "repo") -}} -{{- $githubData := getJSON ($githubURL) -}} +{{- $githubData := resources.GetRemote $githubURL | transform.Unmarshal -}} {{- $githubColors := .Site.Data.githubColors -}} {{- with $githubData -}} diff --git a/layouts/shortcodes/gitlab.html b/layouts/shortcodes/gitlab.html index 5b6153c5..12f08808 100644 --- a/layouts/shortcodes/gitlab.html +++ b/layouts/shortcodes/gitlab.html @@ -1,7 +1,7 @@ {{ $id := delimit (slice "gitlab" (partial "functions/uid.html" .)) "-" }} {{- $gitlabURL := print (default "https://gitlab.com/" (.Get "baseURL")) "api/v4/projects/" (.Get "projectID") -}} -{{- $gitLabData := getJSON ($gitlabURL) -}} +{{- $gitLabData := resources.GetRemote $gitlabURL | transform.Unmarshal -}} {{- with $gitLabData -}}