The global keydown handler calls event.key.toLowerCase() without checking
that event.key is defined. Some keydown events carry no key property
(browser autofill, IME composition, some mobile virtual keyboards), which
throws TypeError: Cannot read properties of undefined (reading
'toLowerCase') and breaks the handler for that keystroke.
Add a truthiness guard before calling toLowerCase(), matching the style
already used for the other event.key comparisons in the same handler.
No behavior change for real Cmd/Ctrl+K presses.
The dropdown panel only closed through its own X button. Escape already
dismissed it, so the missing pointer equivalent left the panel stuck open
over the page after a stray tap.
Close it on any click landing outside the panel and outside the labels that
toggle it. Both early returns are load-bearing. A label forwards a synthetic
click to its checkbox, so without skipping the input the menu closes in the
same gesture that opened it. And without skipping the opener, opening then
closing with the hamburger leaves the panel open, because this handler and
the label's default action cancel each other out.
The fullscreen panel needs no special case. It covers the viewport, so
every click lands inside it and the handler stays inert.
JSON-encode i18n strings injected into appearance.js (#3040), resolve
and publish the original author image for the JSON-LD schema (#3037),
and anchor avatar crops to Center so small and zoomed framings match
(#3016).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Add reading progress bar for articles
* Let page-level showReadingProgress override the site setting
Hugo's default treats false as empty, so a page-level false could not
disable the bar once it was enabled site-wide. Resolve the value by
initialising from the site setting and overriding it only when the
front matter parameter is actually present, and use the same resolved
boolean in single.html and head.html.
* Guard the reading progress handler and mark the listener passive
The script loads in the head without defer, so the scroll listener is
registered before the progress bar element exists. A scroll event fired
during parsing, such as when the browser restores the scroll position on
reload, would throw. Bail out when the element is missing, matching the
guard in background-blur.js, and mark the scroll listener passive as
toc.html already does.
Dynamically update the appearance switcher accessibility labels and tooltips using the native i18n variables so that the UI correctly reflects the user's localized language instead of hardcoded English strings.
When a user opens the search modal and starts typing immediately, executeQuery() is triggered. Since buildIndex() is asynchronous, the fuse variable might still be undefined when .search() is called. Added safety checks for fuse initialization.