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 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.

+ +
+ + 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..cd8bb3f 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..0899ba0 100644 --- a/site/style.css +++ b/site/style.css @@ -49,6 +49,15 @@ body { } img, video { display: block; max-width: 100%; height: auto; } +/* 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; + 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..49ea882 100644 --- a/site/zh/index.html +++ b/site/zh/index.html @@ -21,8 +21,8 @@ - - + +