Fix Hugo deprecation error (#7372)

* Update Hugo installed in CI from `v0.92.1` to `v0.139.3`

The version in CI is close to 3 years old, which means it does not
encounter the same problems that newer installations of Hugo do.

* Fix Hugo deprecation error

I got the following error when building the documentation with Hugo
`v0.139.3`:

```
ERROR deprecated: data.GetJSON was deprecated in Hugo v0.123.0 and will be removed in Hugo 0.140.0. use resources.Get or resources.GetRemote with transform.Unmarshal.
```

I fixed the error by implementing the change the error recommended.
This commit is contained in:
Alex Hedges 2024-12-04 03:41:45 -05:00 committed by GitHub
parent d489743006
commit af8d5b9ce6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -232,8 +232,8 @@ jobs:
with:
python-version-file: .github/python-version.txt
- run: |
wget -q https://github.com/gohugoio/hugo/releases/download/v0.92.1/hugo_extended_0.92.1_Linux-64bit.deb
echo "a9440adfd3ecce40089def287dee4e42ffae252ba08c77d1ac575b880a079ce6 hugo_extended_0.92.1_Linux-64bit.deb" | sha256sum -c
wget -q https://github.com/gohugoio/hugo/releases/download/v0.139.3/hugo_extended_0.139.3_linux-amd64.deb
echo "3e58800d1fee57269208d07d104ae1a6ab886615344099f2dca0c6ad5279bc11 hugo_extended_0.139.3_linux-amd64.deb" | sha256sum -c
sudo dpkg -i hugo*.deb
- run: pip install -e .[dev]
- run: ./docs/build.py

View file

@ -3,7 +3,7 @@
<asciinema-player id="asciinema-player" src="/recordings/{{ $file }}.cast" font-size="13px" poster="npt:{{ .Get "poster" }}" preload></asciinema-player>
{{- if .Get "instructions" -}}
{{- $instructions_file := print "static/recordings/" $file "_instructions.json" -}}
{{ $data := getJSON $instructions_file }}
{{ $data := resources.Get $instructions_file | transform.Unmarshal }}
<article class="panel">
<p class="panel-heading">
Video Content