by rollcat · 1y ago · 0 comments
I agree. Personally, I'm a fan of progressive enhancement.
E.g. I use this Hugo partial to hide emails; it de-obfuscates an address using JavaScript, and falls back to printing a shell command:
{{ $id := substr (sha256 .) 0 6 }}
<a id="{{ $id }}"><noscript>echo </noscript>{{ base64Encode . }}<noscript> | base64 -d -</noscript></a><script>var el = document.getElementById("{{ $id }}"); el.innerText = atob("{{ base64Encode . }}"); el.href = "mailto:" + el.innerText;</script>
(Hopefully HN will preserve all the characters.)Similar for CSS, although that one is a forever WIP...