Closed not-napoleon closed 1 year ago
Name | Link |
---|---|
Latest commit | c245bf44c4a4adf26e7b844a4cad0315795bf4a1 |
Latest deploy log | https://app.netlify.com/sites/hugo-digital-garden-demo/deploys/642cd3f855bd7f00080859f1 |
Deploy Preview | https://deploy-preview-13--hugo-digital-garden-demo.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Resolves https://github.com/paulmartins/hugo-digital-garden-theme/issues/11
So as discussed on the issue, I added a parameter to set the initial state for dark or light mode. I did some testing locally with private browser windows to clear the local storage and it seems to work. I also spent a while trying to add some kind of validation to ensure the parameter is set to something sensible, but honestly the Go Templates language defeated me. If you've got some pointers on how to do validation in templates, I'd be happy to take another pass at it. That said, it seems to degrade gracefully (to light mode) if the parameter is set to something bogus.
Thanks again for pointing me in the right direction on the issue.