From 24cebfc02bbc9c9d45e154335d9172c93c3d8d6f Mon Sep 17 00:00:00 2001 From: sudoHG Date: Tue, 13 Oct 2026 18:59:17 +0800 Subject: [PATCH 1/4] Stop deploying the website with GitHub Pages (#160) The site moves to Cloudflare Pages, which builds site/ from main through its own Git integration, because Cloudflare's network is more reliable than GitHub Pages for visitors in mainland China. GitHub Pages is switched off for the repository, so this workflow would only fail. --- .github/workflows/pages.yml | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 .github/workflows/pages.yml diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml deleted file mode 100644 index 1e01858..0000000 --- a/.github/workflows/pages.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Website - -on: - push: - branches: [main] - paths: - - "site/**" - - ".github/workflows/pages.yml" - workflow_dispatch: - -permissions: - contents: read - -concurrency: - group: pages - cancel-in-progress: false - -jobs: - deploy: - runs-on: ubuntu-latest - timeout-minutes: 10 - permissions: - contents: read - pages: write - id-token: write - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - - uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0 - - uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 - with: - path: site - - id: deployment - uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1 From 5f744cf1da8f7222dbfdbfd0b63b6ca920bae2ef Mon Sep 17 00:00:00 2001 From: sudoHG Date: Tue, 13 Oct 2026 19:08:40 +0800 Subject: [PATCH 2/4] Serve a not-found page and document the Cloudflare Pages deploy (#160) --- scripts/check_hygiene.py | 1 + site-src/README.md | 16 ++++++++++++++++ site/404.html | 29 +++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 site-src/README.md create mode 100644 site/404.html diff --git a/scripts/check_hygiene.py b/scripts/check_hygiene.py index 11d8576..a847f1f 100644 --- a/scripts/check_hygiene.py +++ b/scripts/check_hygiene.py @@ -22,6 +22,7 @@ "README.zh-CN.md", # Simplified Chinese README. "site/index.html", # Language switcher on the English website (#160). "site/zh/index.html", # Simplified Chinese website (#160). + "site/404.html", # Bilingual not-found page of the website (#160). "docs/glossary.md", # Chinese UI terms alongside English glossary prose (#67). "Sources/AskKeyAppKit/Resources/zh-Hans.lproj/InfoPlist.strings", # Localized product name. "Tests/AskKeyAppTests/AgentClientConnectionPolicyTests.swift", # Chinese client connection errors. diff --git a/site-src/README.md b/site-src/README.md new file mode 100644 index 0000000..4d50284 --- /dev/null +++ b/site-src/README.md @@ -0,0 +1,16 @@ +# Website source and deployment + +`site/` is the website at https://askkey.sudohg.com, served as is: static HTML, CSS, a small script and assets. The only bundled code is the "How it works" film; its source and build are in [`how/`](how/README.md). + +## Deploying + +The site is a Cloudflare Pages project named `askkey` (Direct Upload), with the custom domain `askkey.sudohg.com`. Nothing deploys automatically: after a change to `site/` is merged into `main`, the maintainer (or an agent with the maintainer's approval) deploys that commit from a clean checkout: + +```sh +npx wrangler pages deploy site --project-name askkey --branch main \ + --commit-hash "$(git rev-parse HEAD)" --commit-message "$(git log -1 --format=%s)" +``` + +Wrangler reads a Cloudflare API token with Pages write access from `CLOUDFLARE_API_TOKEN` and the account from `CLOUDFLARE_ACCOUNT_ID`. Never put the token in a file, an argument or a log. + +Before deploying, run `npm run stamp` in `how/` if any CSS or JS changed, so pages never pair with a cached old file, and check both pages in a browser. diff --git a/site/404.html b/site/404.html new file mode 100644 index 0000000..e60184a --- /dev/null +++ b/site/404.html @@ -0,0 +1,29 @@ + + + + + + 页面不存在 · Page not found — Ask Key + + + + + + +
+ +

这个页面不存在。

+

This page doesn’t exist.

+ +
+ + From 25f76ff93f58b1fcb4fd06454f7e3cc1430d8106 Mon Sep 17 00:00:00 2001 From: sudoHG Date: Tue, 13 Oct 2026 19:12:25 +0800 Subject: [PATCH 3/4] Keep decorative pictures out of long-press menus and drag (#160) --- site/how/how.css | 2 ++ site/index.html | 4 ++-- site/style.css | 8 ++++++++ site/zh/index.html | 4 ++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/site/how/how.css b/site/how/how.css index 81f6489..07c2b7a 100644 --- a/site/how/how.css +++ b/site/how/how.css @@ -89,6 +89,8 @@ -webkit-user-select: none; } .akhw-canvas { + -webkit-touch-callout: none; + user-select: none; position: absolute; inset: 0; width: 100%; diff --git a/site/index.html b/site/index.html index b172f46..9be7769 100644 --- a/site/index.html +++ b/site/index.html @@ -22,8 +22,8 @@ - - + + diff --git a/site/style.css b/site/style.css index a4838fc..d18f424 100644 --- a/site/style.css +++ b/site/style.css @@ -49,6 +49,14 @@ body { } img, video { display: block; max-width: 100%; height: auto; } +/* Pictures here are scenery, not content to save: no long-press menu, no + force-click preview and no dragging a copy off the page. */ +.hero-image img, .slip .imp, .stone img, .pass img, .hub-core img, .akhw-poster img, .download img { + pointer-events: none; + -webkit-touch-callout: none; + -webkit-user-drag: none; + user-select: none; +} a { color: inherit; } p { text-wrap: pretty; } code, pre { font-family: var(--mono); } diff --git a/site/zh/index.html b/site/zh/index.html index 843fe78..c0cc7a2 100644 --- a/site/zh/index.html +++ b/site/zh/index.html @@ -21,8 +21,8 @@ - - + + From d6b5497fcccbcb9a426481a30b669fe53f527e77 Mon Sep 17 00:00:00 2001 From: sudoHG Date: Tue, 13 Oct 2026 19:13:59 +0800 Subject: [PATCH 4/4] Apply the no-preview rule to every picture on the site (#160) --- site/index.html | 2 +- site/style.css | 7 ++++--- site/zh/index.html | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/site/index.html b/site/index.html index 9be7769..cd8bb3f 100644 --- a/site/index.html +++ b/site/index.html @@ -22,7 +22,7 @@ - + diff --git a/site/style.css b/site/style.css index d18f424..0899ba0 100644 --- a/site/style.css +++ b/site/style.css @@ -49,9 +49,10 @@ body { } img, video { display: block; max-width: 100%; height: auto; } -/* Pictures here are scenery, not content to save: no long-press menu, no - force-click preview and no dragging a copy off the page. */ -.hero-image img, .slip .imp, .stone img, .pass img, .hub-core img, .akhw-poster img, .download img { +/* Pictures on this site are part of the design, not content to save: no + long-press menu, no force-click preview and no dragging a copy off the + page. Clicks on a picture inside a link still reach the link. */ +img { pointer-events: none; -webkit-touch-callout: none; -webkit-user-drag: none; diff --git a/site/zh/index.html b/site/zh/index.html index c0cc7a2..49ea882 100644 --- a/site/zh/index.html +++ b/site/zh/index.html @@ -21,7 +21,7 @@ - +