sqzass.git

sqzass

~ static site generator in Rust
git clone https://github.com/debuman/sqzass.git
commit b13b9938ace09f7bf9e73f4a767c8febb70f8d06
parent abcd30f05d6b951363d00228ed1be42c983497f8
Author: sqzer <110329244+sqzer-x@users.noreply.github.com>
Date: Sat, 25 Jul 2026 21:48:06 +0900

Open search with Ctrl/⌘+S

Requested. It costs the browser's Save Page shortcut, which is the right
trade here: nobody saves the HTML of a documentation page, and preventDefault
means Save is only lost while this site is focused.

Ctrl+K is no longer bound at all rather than bound to both — a shortcut that
silently works from a previous version is worse than one that plainly does
not, because it teaches the wrong key.

Diffstat:
Mdocs/static/js/search.js | 7+++++--
Mdocs/templates/base.html | 4+++-
2 files changed, 8 insertion(+), 3 deletion(-)

diff --git a/docs/static/js/search.js b/docs/static/js/search.js
@@ -174,8 +174,11 @@
 
   trigger.addEventListener("click", open);
 
+  /* Ctrl/⌘+S. This takes the shortcut away from the browser's Save Page,
+     deliberately: on a documentation site nobody is saving the HTML, and the
+     key is the one people already reach for. */
   document.addEventListener("keydown", function (e) {
-    if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k") {
+    if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "s") {
       e.preventDefault();
       dialog.open ? dialog.close() : open();
     }
@@ -202,5 +205,5 @@
   /* The shortcut hint is written here, not in the template, because it is a
      property of the reader's keyboard rather than of the page. */
   var mac = /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);
-  trigger.querySelector("kbd").textContent = mac ? "⌘K" : "Ctrl K";
+  trigger.querySelector("kbd").textContent = mac ? "⌘S" : "Ctrl S";
 })();
diff --git a/docs/templates/base.html b/docs/templates/base.html
@@ -46,7 +46,9 @@
   <div class="tools">
     <button id="search-trigger" class="search-trigger" type="button"
             data-index="/search-{{ page.language }}.json">
-      <span>{{ "검색" if ko else "Search" }}</span><kbd>Ctrl K</kbd>
+      {#- The label is replaced with the reader's own modifier by search.js;
+          this is the value someone with JavaScript off sees. #}
+      <span>{{ "검색" if ko else "Search" }}</span><kbd>Ctrl S</kbd>
     </button>
     {%- for t in page.translations %}
     <a href="{{ t.url }}" hreflang="{{ t.code }}">{{ t.name }}</a>