Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions .github/workflows/pages.yml

This file was deleted.

1 change: 1 addition & 0 deletions scripts/check_hygiene.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 16 additions & 0 deletions site-src/README.md
Original file line number Diff line number Diff line change
@@ -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.
29 changes: 29 additions & 0 deletions site/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!doctype html>
<html lang="zh-Hans">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>页面不存在 · Page not found — Ask Key</title>
<meta name="robots" content="noindex">
<link rel="icon" href="/assets/favicon-64.png" type="image/png">
<link rel="stylesheet" href="/style.css">
<style>
.lost { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 22px; padding: 48px var(--gutter); text-align: center; }
.lost img { width: 72px; height: 72px; }
.lost h1 { margin: 0; font-family: var(--song); font-size: clamp(28px, 3vw, 40px); font-weight: 300; letter-spacing: 0.04em; }
.lost p { margin: 0; color: var(--gray); }
.lost nav { display: flex; gap: 28px; margin-top: 8px; }
</style>
</head>
<body>
<main class="lost">
<img src="/assets/icon-256.png" width="72" height="72" alt="">
<h1>这个页面不存在。</h1>
<p lang="en">This page doesn’t exist.</p>
<nav>
<a class="link" href="/zh/">回到首页</a>
<a class="link" href="/" lang="en">Back to Ask Key</a>
</nav>
</main>
</body>
</html>
2 changes: 2 additions & 0 deletions site/how/how.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@
-webkit-user-select: none;
}
.akhw-canvas {
-webkit-touch-callout: none;
user-select: none;
position: absolute;
inset: 0;
width: 100%;
Expand Down
4 changes: 2 additions & 2 deletions site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<link rel="apple-touch-icon" href="/assets/apple-touch-icon.png">
<link rel="preload" href="/assets/hero-desk.jpg" as="image">
<link rel="preload" href="/fonts/HankenGrotesk-Variable.woff2" as="font" type="font/woff2" crossorigin>
<link rel="stylesheet" href="/style.css?v=bf306ca765">
<link rel="stylesheet" href="/how/how.css?v=678740993e">
<link rel="stylesheet" href="/style.css?v=6a97785f0c">
<link rel="stylesheet" href="/how/how.css?v=68de86ac7c">
<script type="module" src="/how/how.js?v=28dba282cc"></script>
<script src="/motion.js?v=09073b35d1" defer></script>
</head>
Expand Down
9 changes: 9 additions & 0 deletions site/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
Expand Down
4 changes: 2 additions & 2 deletions site/zh/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<link rel="icon" type="image/png" href="/assets/favicon-64.png">
<link rel="apple-touch-icon" href="/assets/apple-touch-icon.png">
<link rel="preload" href="/assets/hero-desk.jpg" as="image">
<link rel="stylesheet" href="/style.css?v=bf306ca765">
<link rel="stylesheet" href="/how/how.css?v=678740993e">
<link rel="stylesheet" href="/style.css?v=6a97785f0c">
<link rel="stylesheet" href="/how/how.css?v=68de86ac7c">
<script type="module" src="/how/how.js?v=28dba282cc"></script>
<script src="/motion.js?v=09073b35d1" defer></script>
</head>
Expand Down
Loading