Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: update from GetJSON to GetRemote #778

Closed
5 tasks
SallyMcGrath opened this issue Jul 5, 2024 · 1 comment
Closed
5 tasks

Chore: update from GetJSON to GetRemote #778

SallyMcGrath opened this issue Jul 5, 2024 · 1 comment

Comments

@SallyMcGrath
Copy link
Member

SallyMcGrath commented Jul 5, 2024

GetJSON is deprecated in https://github.com/gohugoio/hugo/releases/tag/v0.123.0
We should use instead GetRemote

Here's an example in #773 :

https://github.com/CodeYourFuture/curriculum/pull/773/files?file-filters%5B%5D=.html&show-viewed-files=true

It's basically the same except

  1. You now have to put headers inside a dict called "headers"
  2. You now always have to unmarshal your response eg response.Content | transform.Unmarshal (basically like JSON.parse() )

On the upside, apparently soon we will have richer access to headers in response.Data

Places this touches

@SallyMcGrath
Copy link
Member Author

I did all these in #824 #820 #815

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

1 participant