Skip to content

armgit / Wake

Public Imported from GitHub
0

All your AI agent sessions in one place — browse, search, resume. Rust + GPUI.

Rust

feat(web): SEO metadata, Chinese social card, one URL per page

Corey Chiuca04917fa961
diff --git a/web/README.md b/web/README.md
index 74feee5..6a5d1ef 100644
--- a/web/README.md
+++ b/web/README.md
@@ -15,7 +15,8 @@ pnpm build # static site in dist/
- **Download links** are resolved at build time from the GitHub API: the newest release that has all six packages. If the API can't be reached, the links are built from the version in the root `Cargo.toml`. Set `GITHUB_TOKEN` in Vercel to avoid the anonymous rate limit.
- **The docs and changelog** read `../docs/mcp.md`, `../docs/cli.md` and `../CHANGELOG.md` directly. Links between the docs are rewritten to the site's pages; other repo links go to GitHub. `[Unreleased]` is left out of the changelog page. Each also exists under `/zh/` with Chinese navigation and labels; the body stays in English, with a note saying so, and links between the pages stay in the visitor's language.
- **Copy** for the home page, in both languages, is `src/lib/copy.ts`. The search demo's sessions are made up, in `src/lib/demo-data.ts`.
-- **`public/og.png`** is the social card, a screenshot of the hero at 1200×630.
+- **`public/og.png`** and **`public/og-zh.png`** are the social cards (English and Chinese), screenshots of the hero at 1200×630.
+- **SEO**: titles, descriptions and keywords per language are in `src/lib/copy.ts`; `src/layouts/Base.astro` writes canonical and hreflang links (with x-default), Open Graph and Twitter tags, and any JSON-LD a page passes in (the home page describes the app as a `SoftwareApplication` with its FAQ, doc pages as `TechArticle`, with the doc's first paragraph as the description). Every URL ends in a slash; Vercel redirects the bare form. `public/robots.txt` points at the sitemap.
## Deploying
diff --git a/web/astro.config.mjs b/web/astro.config.mjs
index c4aa22e..f71d604 100644
--- a/web/astro.config.mjs
+++ b/web/astro.config.mjs
@@ -6,7 +6,8 @@ import { rewriteRepoLinks } from './src/lib/rehype-repo-links.mjs';
export default defineConfig({
site: 'https://wake.cool',
- trailingSlash: 'ignore',
+ // One URL per page: /docs/mcp/ (Vercel redirects /docs/mcp there, see vercel.json)
+ trailingSlash: 'always',
devToolbar: { enabled: false },
build: { format: 'directory' },
i18n: {
diff --git a/web/public/og-zh.png b/web/public/og-zh.png
new file mode 100644
index 0000000..91e9450
Binary files /dev/null and b/web/public/og-zh.png differ
diff --git a/web/public/robots.txt b/web/public/robots.txt
new file mode 100644
index 0000000..347d646
--- /dev/null
+++ b/web/public/robots.txt
@@ -0,0 +1,4 @@
+User-agent: *
+Allow: /
+
+Sitemap: https://wake.cool/sitemap-index.xml
diff --git a/web/public/site.webmanifest b/web/public/site.webmanifest
new file mode 100644
index 0000000..a8c6ca9
--- /dev/null
+++ b/web/public/site.webmanifest
@@ -0,0 +1,13 @@
+{
+ "name": "Wake",
+ "short_name": "Wake",
+ "description": "Search and resume every coding-agent conversation on your machine.",
+ "start_url": "/",
+ "display": "browser",
+ "background_color": "#0b1730",
+ "theme_color": "#0b1730",
+ "icons": [
+ { "src": "/icon-192.png", "sizes": "192x192", "type": "image/png" },
+ { "src": "/icon-512.png", "sizes": "512x512", "type": "image/png" }
+ ]
+}
diff --git a/web/scripts/sync-assets.mjs b/web/scripts/sync-assets.mjs
index e01a090..580f139 100644
--- a/web/scripts/sync-assets.mjs
+++ b/web/scripts/sync-assets.mjs
@@ -23,7 +23,8 @@ await Promise.all(
const svg = path.join(assets, 'icon.svg');
await copyFile(svg, path.join(pub, 'favicon.svg'));
-for (const size of [180, 512]) {
+// 32: PNG favicon fallback; 180: apple-touch-icon; 192 / 512: web manifest.
+for (const size of [32, 180, 192, 512]) {
await sharp(svg, { density: 300 }).resize(size, size).png().toFile(path.join(pub, `icon-${size}.png`));
}
diff --git a/web/src/components/ChangelogPage.astro b/web/src/components/ChangelogPage.astro
index f9857e5..4ddfdac 100644
--- a/web/src/components/ChangelogPage.astro
+++ b/web/src/components/ChangelogPage.astro
@@ -55,7 +55,7 @@ const released = versions.filter((v) => !/unreleased/i.test(v.version));
<Base
lang={lang}
title={`${t.changelog} — Wake`}
- description="Every Wake release and what changed in it."
+ description={COPY[lang].changelogDescription}
alternate={localePath(lang === 'en' ? 'zh' : 'en', '/changelog')}
>
<main class="doc-page">
diff --git a/web/src/components/DocPage.astro b/web/src/components/DocPage.astro
index 6400f9d..5b2b753 100644
--- a/web/src/components/DocPage.astro
+++ b/web/src/components/DocPage.astro
@@ -19,13 +19,41 @@ const nav = [
];
const toc = headings.filter((h) => h.depth === 2 || h.depth === 3);
const path = `/docs/${entry.id}`;
+
+// The doc's own opening paragraph, as plain text, is its description in search results.
+const firstParagraph = (entry.body ?? '')
+ .split(/\n\s*\n/)
+ .map((block) => block.trim())
+ .find((block) => block && !/^(#|\||```|>|-\s|\*\s|<)/.test(block));
+const plain = (firstParagraph ?? '')
+ .replace(/\[([^\]]+)\]\([^)]*\)/g, '$1')
+ .replace(/[`*_]/g, '')
+ .replace(/\s+/g, ' ')
+ .trim();
+const description =
+ plain.length > 158 ? `${plain.slice(0, 155).replace(/\s+\S*$/, '').replace(/[\s,;:—–-]+$/, '')}…` : plain;
+const pageTitle = /\bWake\b/.test(title) ? title : `${title} — Wake`;
+const jsonLd = [
+ {
+ '@context': 'https://schema.org',
+ '@type': 'TechArticle',
+ headline: title,
+ description,
+ url: new URL(localePath(lang, path), Astro.site).href,
+ inLanguage: 'en',
+ author: { '@type': 'Person', name: 'Corey Chiu', url: 'https://coreychiu.com' },
+ isPartOf: { '@type': 'WebSite', name: 'Wake', url: new URL(localePath(lang, '/'), Astro.site).href },
+ },
+];
---
<Base
lang={lang}
- title={`${title} — Wake`}
- description={`Wake documentation: ${title}.`}
+ title={pageTitle}
+ description={description}
alternate={localePath(lang === 'en' ? 'zh' : 'en', path)}
+ ogType="article"
+ jsonLd={jsonLd}
>
<main class="doc-page">
<div class="wrap doc-layout">
diff --git a/web/src/components/Home.astro b/web/src/components/Home.astro
index 6dc147d..f34a363 100644
--- a/web/src/components/Home.astro
+++ b/web/src/components/Home.astro
@@ -9,15 +9,59 @@ import More from './More.astro';
import Principles from './Principles.astro';
import Faq from './Faq.astro';
import Download from './Download.astro';
-import type { Lang } from '../lib/copy';
+import { COPY, localePath, type Lang } from '../lib/copy';
+import { getRelease, REPO_URL } from '../lib/release';
interface Props {
lang: Lang;
}
const { lang } = Astro.props;
+const t = COPY[lang];
+const release = await getRelease();
+const site = Astro.site!;
+const home = new URL(localePath(lang, '/'), site).href;
+
+// What search engines read about the app: free, open source, which systems, which version.
+const jsonLd = [
+ {
+ '@context': 'https://schema.org',
+ '@type': 'SoftwareApplication',
+ name: 'Wake',
+ url: home,
+ description: t.description,
+ image: new URL(lang === 'zh' ? '/og-zh.png' : '/og.png', site).href,
+ applicationCategory: 'DeveloperApplication',
+ operatingSystem: 'macOS 14+, Linux, Windows',
+ softwareVersion: release.version,
+ ...(release.date ? { datePublished: release.date.slice(0, 10) } : {}),
+ downloadUrl: release.url,
+ license: 'https://opensource.org/licenses/MIT',
+ isAccessibleForFree: true,
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'USD' },
+ author: { '@type': 'Person', name: 'Corey Chiu', url: 'https://coreychiu.com' },
+ sameAs: [REPO_URL],
+ inLanguage: t.htmlLang,
+ },
+ {
+ '@context': 'https://schema.org',
+ '@type': 'WebSite',
+ name: 'Wake',
+ url: home,
+ inLanguage: t.htmlLang,
+ },
+ {
+ '@context': 'https://schema.org',
+ '@type': 'FAQPage',
+ mainEntity: t.faq.items.map((item) => ({
+ '@type': 'Question',
+ name: item.q,
+ acceptedAnswer: { '@type': 'Answer', text: item.a },
+ })),
+ },
+];
---
-<Base lang={lang} alternate={lang === 'en' ? '/zh/' : '/'}>
+<Base lang={lang} alternate={lang === 'en' ? '/zh/' : '/'} jsonLd={jsonLd}>
<main>
<Hero lang={lang} />
<Agents lang={lang} />
diff --git a/web/src/layouts/Base.astro b/web/src/layouts/Base.astro
index 77d2635..4ef0219 100644
--- a/web/src/layouts/Base.astro
+++ b/web/src/layouts/Base.astro
@@ -12,14 +12,29 @@ interface Props {
description?: string;
/** Path of this page in the other language, when there is one. */
alternate?: string;
+ /** Open Graph type: the home page is a website, a doc page an article. */
+ ogType?: 'website' | 'article';
+ /** Keep the page out of search results (the 404 page). */
+ noindex?: boolean;
+ /** schema.org objects, written out as JSON-LD. */
+ jsonLd?: Record<string, unknown>[];
}
-const { lang, title, description, alternate } = Astro.props;
+const { lang, title, description, alternate, ogType = 'website', noindex = false, jsonLd = [] } = Astro.props;
const t = COPY[lang];
const pageTitle = title ?? t.title;
const pageDescription = description ?? t.description;
const canonical = new URL(Astro.url.pathname, Astro.site);
-const ogImage = new URL('/og.png', Astro.site);
+
+// Both language versions of this page, for hreflang; English is the fallback for everyone else.
+const other = alternate ? new URL(alternate, Astro.site) : null;
+const enUrl = lang === 'en' ? canonical : other;
+const zhUrl = lang === 'zh' ? canonical : other;
+
+const ogImage = new URL(lang === 'zh' ? '/og-zh.png' : '/og.png', Astro.site);
+const ogLocale = lang === 'zh' ? 'zh_CN' : 'en_US';
+const ogLocaleAlt = lang === 'zh' ? 'en_US' : 'zh_CN';
+const ld = (o: Record<string, unknown>) => JSON.stringify(o).replace(/</g, '\\u003c');
---
<!doctype html>
@@ -29,25 +44,47 @@ const ogImage = new URL('/og.png', Astro.site);
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{pageTitle}</title>
<meta name="description" content={pageDescription} />
+ <meta name="keywords" content={t.keywords} />
+ <meta name="author" content="Corey Chiu" />
+ {noindex && <meta name="robots" content="noindex" />}
<meta name="theme-color" content="#0b1730" />
+ <meta name="color-scheme" content="dark" />
<link rel="canonical" href={canonical} />
{
- alternate && (
+ enUrl && zhUrl && (
<>
- <link rel="alternate" hreflang={lang === 'en' ? 'zh-Hans' : 'en'} href={new URL(alternate, Astro.site)} />
- <link rel="alternate" hreflang={t.htmlLang} href={canonical} />
+ <link rel="alternate" hreflang="en" href={enUrl} />
+ <link rel="alternate" hreflang="zh-Hans" href={zhUrl} />
+ <link rel="alternate" hreflang="x-default" href={enUrl} />
</>
)
}
+ <link rel="sitemap" href="/sitemap-index.xml" />
+
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
+ <link rel="icon" href="/icon-32.png" type="image/png" sizes="32x32" />
<link rel="apple-touch-icon" href="/icon-180.png" />
- <meta property="og:type" content="website" />
+ <link rel="manifest" href="/site.webmanifest" />
+
+ <meta property="og:type" content={ogType} />
<meta property="og:site_name" content="Wake" />
<meta property="og:title" content={pageTitle} />
<meta property="og:description" content={pageDescription} />
<meta property="og:url" content={canonical} />
+ <meta property="og:locale" content={ogLocale} />
+ {enUrl && zhUrl && <meta property="og:locale:alternate" content={ogLocaleAlt} />}
<meta property="og:image" content={ogImage} />
+ <meta property="og:image:type" content="image/png" />
+ <meta property="og:image:width" content="1200" />
+ <meta property="og:image:height" content="630" />
+ <meta property="og:image:alt" content={t.ogAlt} />
<meta name="twitter:card" content="summary_large_image" />
+ <meta name="twitter:title" content={pageTitle} />
+ <meta name="twitter:description" content={pageDescription} />
+ <meta name="twitter:image" content={ogImage} />
+ <meta name="twitter:image:alt" content={t.ogAlt} />
+
+ {jsonLd.map((o) => <script type="application/ld+json" set:html={ld(o)} />)}
</head>
<body>
<Nav lang={lang} alternate={alternate} />
diff --git a/web/src/lib/copy.ts b/web/src/lib/copy.ts
index 32a3524..1f9d20b 100644
--- a/web/src/lib/copy.ts
+++ b/web/src/lib/copy.ts
@@ -6,14 +6,18 @@ export type Lang = 'en' | 'zh';
const en = {
htmlLang: 'en',
- title: 'Wake — every coding-agent conversation, one search away',
+ title: 'Wake — Search and resume Claude Code, Codex & Cursor sessions',
description:
- 'Wake gathers the conversations you have with Claude Code, Codex, Cursor and many other coding agents into one window. Search all of them and pick sessions back up in your terminal. Local and read-only.',
+ 'Free, open-source app that puts your Claude Code, Codex, Cursor and Gemini CLI sessions in one window. Search them all, resume any in your terminal. Local only.',
+ keywords:
+ 'Claude Code, Codex, Cursor, Gemini CLI, coding agent, AI coding, session history, chat history, resume session, full-text search, MCP server, Wake',
+ ogAlt: 'Wake: find any coding-agent conversation in seconds',
+ changelogDescription: 'Every Wake release and what changed in it.',
nav: { home: 'Home', download: 'Free download', docs: 'Docs', changelog: 'Changelog', github: 'GitHub', star: 'Star Wake on GitHub', language: 'Language' },
hero: {
title: 'Find any coding‑agent conversation in seconds.',
lede:
- 'Wake reads the history that Claude Code, Codex, Cursor and many other agents keep on your computer. Search all of it at once and pick sessions back up in your terminal. Read-only, and nothing leaves your machine.',
+ 'Wake reads the history that Claude Code, Codex, Cursor and many other agents keep on your computer. Search all of it at once and pick sessions back up in your terminal. Read‑only, and nothing leaves your machine.',
cta: 'Free download',
docs: 'Read the docs',
free: 'Open source, MIT licensed',
@@ -174,9 +178,13 @@ export type Copy = typeof en;
const zh: Copy = {
htmlLang: 'zh-Hans',
- title: 'Wake:和 coding agent 聊过的每一句,几秒就能翻出来',
+ title: 'Wake — 搜索、恢复 Claude Code、Codex、Cursor 的会话记录',
description:
- 'Claude Code、Codex、Cursor 这些 coding agent 的对话记录,Wake 都收进一个窗口:全文搜索,能恢复的会话点一下就回到终端接着聊。只读,数据不出本机。',
+ '免费开源的桌面应用:把 Claude Code、Codex、Cursor、Gemini CLI 等 coding agent 的会话记录收进一个窗口,全文搜索,一键回到终端接着聊。只读,数据不出本机。',
+ keywords:
+ 'Claude Code, Codex, Cursor, Gemini CLI, coding agent, AI 编程, 会话记录, 聊天记录, 历史记录搜索, 恢复会话, 全文搜索, MCP, Wake',
+ ogAlt: 'Wake:和 coding agent 聊过的每一句,几秒就能翻出来',
+ changelogDescription: 'Wake 每个版本的更新内容。',
nav: { home: '首页', download: '免费下载', docs: '文档', changelog: '更新日志', github: 'GitHub', star: '在 GitHub 上给 Wake 点 Star', language: '语言' },
hero: {
title: '和 coding agent 聊过的每一句,\n几秒就能翻出来。',
@@ -336,4 +344,10 @@ const zh: Copy = {
export const COPY: Record<Lang, Copy> = { en, zh };
/** The same page in a given language: Chinese pages live under /zh. */
-export const localePath = (lang: Lang, path: string) => (lang === 'zh' ? `/zh${path === '/' ? '/' : path}` : path);
+export function localePath(lang: Lang, path: string): string {
+ // Every page URL ends in a slash (astro.config trailingSlash: 'always'); a #hash stays after it.
+ const [p, hash] = path.split('#');
+ const withSlash = p.endsWith('/') ? p : `${p}/`;
+ const localized = lang === 'zh' ? `/zh${withSlash === '/' ? '/' : withSlash}` : withSlash;
+ return hash === undefined ? localized : `${localized}#${hash}`;
+}
diff --git a/web/src/lib/rehype-repo-links.mjs b/web/src/lib/rehype-repo-links.mjs
index 7fdb2e1..90c2c86 100644
--- a/web/src/lib/rehype-repo-links.mjs
+++ b/web/src/lib/rehype-repo-links.mjs
@@ -3,7 +3,7 @@
// them for the site: the two docs that have pages here point at those pages, anything
// else in the repo points at GitHub.
const REPO = 'https://github.com/iAmCorey/Wake';
-const PAGES = { 'mcp.md': '/docs/mcp', 'cli.md': '/docs/cli', 'CHANGELOG.md': '/changelog' };
+const PAGES = { 'mcp.md': '/docs/mcp/', 'cli.md': '/docs/cli/', 'CHANGELOG.md': '/changelog/' };
function rewrite(href, file) {
if (/^(?:[a-z]+:|#|\/)/i.test(href)) return href;
diff --git a/web/src/pages/404.astro b/web/src/pages/404.astro
index 4dfe14b..5db020d 100644
--- a/web/src/pages/404.astro
+++ b/web/src/pages/404.astro
@@ -2,12 +2,12 @@
import Base from '../layouts/Base.astro';
---
-<Base lang="en" title="Not found — Wake">
+<Base lang="en" title="Not found — Wake" noindex>
<main class="doc-page">
<div class="wrap prose">
<h1>Nothing here</h1>
- <p>This page doesn't exist. <a href="/">Go to the home page</a> or <a href="/docs/mcp">read the docs</a>.</p>
- <p lang="zh-Hans">这个页面不存在。<a href="/zh/">回到首页</a>,或者<a href="/zh/docs/mcp">看看文档</a>。</p>
+ <p>This page doesn't exist. <a href="/">Go to the home page</a> or <a href="/docs/mcp/">read the docs</a>.</p>
+ <p lang="zh-Hans">这个页面不存在。<a href="/zh/">回到首页</a>,或者<a href="/zh/docs/mcp/">看看文档</a>。</p>
</div>
</main>
</Base>
diff --git a/web/vercel.json b/web/vercel.json
index 57a4ba3..bad169a 100644
--- a/web/vercel.json
+++ b/web/vercel.json
@@ -4,6 +4,7 @@
"installCommand": "pnpm install --frozen-lockfile",
"buildCommand": "pnpm run build",
"outputDirectory": "dist",
+ "trailingSlash": true,
"headers": [
{
"source": "/_astro/(.*)",