diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-01-28 16:11:12 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-01-28 16:37:36 +0100 |
commit | 292626e679e5203faf3d42f004c12027da3e4300 (patch) | |
tree | 47482ba0dbf84e17c1b134cca0c7db493c5f5fa3 /tpl | |
parent | 60d954c7854fbbe59d5f8cb7e8428e01c3763288 (diff) | |
download | hugo-292626e679e5203faf3d42f004c12027da3e4300.tar.gz hugo-292626e679e5203faf3d42f004c12027da3e4300.zip |
tpl/data: Deprecate data.GetJSON and data.GetCSV
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/data/data.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tpl/data/data.go b/tpl/data/data.go index b6b0515e8..7eb730c4c 100644 --- a/tpl/data/data.go +++ b/tpl/data/data.go @@ -25,6 +25,7 @@ import ( "strings" "github.com/gohugoio/hugo/cache/filecache" + "github.com/gohugoio/hugo/common/hugo" "github.com/gohugoio/hugo/common/maps" "github.com/gohugoio/hugo/config/security" @@ -63,6 +64,8 @@ type Namespace struct { // If you provide multiple parts for the URL they will be joined together to the final URL. // GetCSV returns nil or a slice slice to use in a short code. func (ns *Namespace) GetCSV(sep string, args ...any) (d [][]string, err error) { + hugo.Deprecate("data.GetJSON", "use resources.Get or resources.GetRemote with transform.Unmarshal.", "v0.123.0") + url, headers := toURLAndHeaders(args) cache := ns.cacheGetCSV @@ -102,6 +105,8 @@ func (ns *Namespace) GetCSV(sep string, args ...any) (d [][]string, err error) { // If you provide multiple parts they will be joined together to the final URL. // GetJSON returns nil or parsed JSON to use in a short code. func (ns *Namespace) GetJSON(args ...any) (any, error) { + hugo.Deprecate("data.GetJSON", "use resources.Get or resources.GetRemote with transform.Unmarshal.", "v0.123.0") + var v any url, headers := toURLAndHeaders(args) cache := ns.cacheGetJSON |