Netlify Status Kit upgrade issue [solved]

I am trying to work with netlify status kit. It seemed to work on version 0.17 but I sent a pull request to upgrade to 0.24. The pull request was accepted but I’m not sure that the website is still working. I am new to go and hugo but I am familiar with other languages and administer our jekyll website.

After using an archetype to create a new incident, the website fails on this request to index into the .Site.Data. The .Params is nil on the main index page.

I’ve noticed that on line 11 of the above page, the type is of Page('Incidents') where on line 23 it is of Page('title of new page i created in content\incidents'). The latter has the .Params context parameter and first does not.

I ended up guarding the nil code spot with an if isset .Params "severity" but can someone please explain how the Page('Incidents') is even showing up in the active when I have resolved set to true and also why the .Params value is not being sent with the call to the partial?



I hit a build error on the same request. Interestingly, if I change the line to:

{{- $alert := .Params.severity -}}

The severity string appears where expected in the template. (This isn’t the desired behavior for the template, but it isolates that .Params.severity is generating the proper string in this location.)

Similarly, if I isolate the index call on .Site.Data.severity.alerts by passing it a matching string:

{{- $alert := index .Site.Data.severity.alerts "ok" -}}

that works as well, generating the expected string.

I’ve confirmed this behavior on a new site forked from the statuskit, as well as a known working site when I try building with 0.24 instead of the existing site’s default 0.17.

It seems like the issue is with the way the parameters are passed to the index function, but the docs do demo the exact same syntax. I’m off to dinner now, but I may be able to take a closer look tomorrow.

See my comment here:

1 Like

Thanks @bep - It would have taken me a long time to pick up on the pages difference. Thanks for the tip.