Skip to content

Commit f150452

Browse files
chaxusclaude
andcommitted
feat(seo): add /open/pdf landing pages (en, zh-CN) and pin a landing-page contract test
- public/open/pdf.html + public/zh-CN/open/pdf.html mirroring /open/docx (TDK, canonical/hreflang, FAQPage/HowTo JSON-LD, ranui shell); copy only promises what pdf-roundtrip verifies (read, comment/annotate, save back) - cross-link everywhere: homepage format cards, every landing footer, sitemap (lastmod 2026-08-16), llms.txt - zh-CN 'open your XLSX/PPTX/CSV' CTAs pointed at ?new=docx (a blank Word doc); now go to /zh-CN/ - test/unit/landing-pages.test.ts: canonical/hreflang/JSON-LD/sitemap/ bilingual-pair contract for every landing page Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 904dfef commit f150452

31 files changed

Lines changed: 911 additions & 24 deletions

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ notes. Entries describe what users experience, not internal refactors.
2828

2929
### Added
3030

31+
- New "Open PDF" pages (`/open/pdf`, `/zh-CN/open/pdf`) explaining what the
32+
PDF viewer can and cannot do (read, comment and annotate, save back as PDF;
33+
no free-text rewriting of an existing PDF), linked from both homepages.
3134
- PDF files now open in a dedicated PDF viewer/editor.
3235
- Legacy Word 97 binary `.doc` files now open correctly.
3336
- Read-only mode can be toggled at runtime (embed API `document:set-readonly`
@@ -41,6 +44,9 @@ notes. Entries describe what users experience, not internal refactors.
4144

4245
### Fixed
4346

47+
- The Chinese landing pages' "open your XLSX / PPTX / CSV" buttons no longer
48+
drop you into a blank new Word document; they go to the Chinese homepage
49+
where you can pick the file.
4450
- Opening a document that uses many fonts (typical for Chinese decks) no
4551
longer sits on "Loading presentation" for minutes on the hosted site: the
4652
editor's font files and the conversion engine are now cached long-term by

‎CLAUDE.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ fetchFonts 字体竞态,修复见 `lib/onlyoffice-editor.ts` 的 `prepareEdito
200200
的 `index.html`→目录 308、`_headers`、`_redirects`。"本地 vite preview 全绿、
201201
线上坏"的三条缺陷(PDF 被 308 卡在 vendor 加载器、字体目录无缓存头、慢链路
202202
超时)都属于这一层;`test/unit/hosting-contract.test.ts` 钉住 `_headers` 关键
203-
规则。**线上冒烟** `.github/workflows/prod-smoke.yml`:每次 push main 等部署
203+
规则;`test/unit/landing-pages.test.ts` 钉住全部 SEO 落地页(public/**/*.html +
204+
index.html)的 canonical/hreflang/JSON-LD/sitemap/双语互指契约——新增落地页必须
205+
同时补 en+zh、sitemap、llms.txt、首页卡片,否则该测试先红。**线上冒烟** `.github/workflows/prod-smoke.yml`:每次 push main 等部署
204206
上线后即跑 + 每日;`E2E_BASE_URL=<站点>` 可把任意 spec 打到部署站。CF 面板里
205207
的 Cache Rules 等不在仓库、CI 复现不了,只能靠冒烟兜底。
206208

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# /open/pdf 落地页与落地页契约测试(2026-08-16)
2+
3+
路线图方向一第 1/4 项(`docs/superpowers/plans/2026-08-15-next-phase-roadmap.md`)。
4+
本轮只动静态内容与测试,不触碰编辑器运行逻辑。
5+
6+
## 做了什么
7+
8+
1. `public/open/pdf.html`(en)+ `public/zh-CN/open/pdf.html`(zh-CN)
9+
与 `/open/docx` 同构:TDK、canonical、hreflang 三件套、OG/Twitter、
10+
JSON-LD(WebApplication / SoftwareSourceCode / FAQPage / HowTo /
11+
BreadcrumbList)、同一份 landing.css + ranui 组件(r-button / r-card /
12+
r-select / r-theme-switch)、语言切换 `data-href` 互指、页脚互链。
13+
目标词:_open pdf in browser without upload_ / _在线打开 PDF 不上传_。
14+
2. 全站互链同步:`index.html` 与 `public/zh-CN/index.html` 各加一张
15+
`.PDF` 格式卡片;20 个落地页页脚加 "Open PDF / 打开 PDF";
16+
`public/sitemap.xml` 加两条(lastmod 2026-08-16);`public/llms.txt`
17+
Pages 段加一行。
18+
3. 新增 `test/unit/landing-pages.test.ts`:遍历 `public/**/*.html`
19+
(排除 404 / embed-demo / vendor 目录)+ 根 `index.html`,逐页断言
20+
canonical = 自身、hreflang en/zh-CN/x-default 指向存在的文件、
21+
`<html lang>` 一致、og:url = canonical、JSON-LD 可解析且
22+
WebApplication.url = 自身、FAQPage ≥3 条、另一语言的对应页存在且
23+
本页 `data-href` 指向它、sitemap 含本页;再整体断言 sitemap 无孤儿
24+
URL、四个 /open/\* 都被双首页与 llms.txt 引用、zh-CN CTA 规则(见下)。
25+
119 个断言,600 ms。
26+
27+
## 文案边界(为什么不写"编辑 PDF")
28+
29+
`test/e2e/pdf-roundtrip.spec.ts` 实际验证过的能力是:pdfeditor 打开、
30+
`AddFreeTextAnnot`、`document:save` 拿回 `%PDF-` 且含 `/Annots`;
31+
读写正文段落没有验证过、引擎也不支持。所以页面承诺的只有
32+
"阅读 / 搜索 / 评论与文字批注 / 另存回 PDF",FAQ 里显式回答
33+
"不能像 Word 一样改写已有正文",并把改正文需求引到 /open/docx +
34+
"下载为 PDF"。这样避免了落地页承诺 > 实际能力被 issue 打脸的老问题。
35+
36+
## 顺手修的一个内容 bug
37+
38+
zh-CN 侧 `/open/{docx,xlsx,pptx}`、`/convert/*` 五个页面的主 CTA
39+
"打开你的 XLSX →" 全部指向 `/?locale=zh-CN&new=docx`——`index.ts` 里
40+
`?new=docx` 的语义是**直接新建一份空白 Word 并跳过首页**,与"打开你的
41+
XLSX"完全对不上(用户落进空白 Word,还得自己找 Open)。EN 侧 CTA 是 `/`
42+
(首页 hero → Open)。统一改成 `/zh-CN/`(中文首页自带 `open-local.js`
43+
选文件流程);`private` / `edit-without-account` 两页原本指向英文 `/`,
44+
也改成 `/zh-CN/`。`no-signup` / `offline` 两页的"打开编辑器"保留
45+
`?locale=zh-CN&new=docx`(这里语义正确)。测试里把这条规则钉住:zh CTA
46+
只允许 `/zh-CN/`、`/?locale=zh-CN&new=docx`、`/embed-demo.html` 三种,
47+
且标签含"打开你的"的必须是 `/zh-CN/`。
48+
49+
## 测试里踩的坑
50+
51+
`path.resolve(PUBLIC, '/zh-CN/open/pdf.html')`——第二参数以 `/` 开头会被
52+
当作绝对路径,直接丢掉 PUBLIC,导致 23 个"对应页不存在"的假失败。
53+
拼接站内路由要用 `path.join`。
54+
55+
## 验证
56+
57+
- `pnpm exec vitest run test/unit/landing-pages.test.ts` → 119 passed
58+
- `pnpm exec vite` 下 `GET /open/pdf`、`/zh-CN/open/pdf` 均 200 且 title
59+
正确(clean URL 由 vite.config.ts 中间件解析;Pages 线上由 CF 的
60+
`.html` 自动解析承担,`playwright.pages.config.ts` 层可复现)
61+
- prettier / oxlint 对触碰文件通过
62+
63+
## 未做 / 后续
64+
65+
- 方向一 2(CSV 中文乱码长文 + `/fix/csv-garbled` 评估)、3(embed 页
66+
runtime read-only 一节)、4 的 index.html 页脚 6 条内链——下一轮。
67+
- 页面 E2E(真实浏览器里 r-select 语言切换跳转、r-theme-switch)沿用
68+
现有 pages 层,本轮未加专项 spec。

‎docs/superpowers/plans/2026-08-15-next-phase-roadmap.md‎

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ Breadcrumb)、页脚互链全齐;robots.txt / sitemap.xml / llms.txt 三件
7373
(TDK + FAQPage + HowTo + 页脚互链 + hreflang 互指),目标词
7474
"open pdf in browser without upload / 在线打开 PDF 不上传"。
7575
这是与代码能力直接对应的最大内容缺口。
76+
✅ 2026-08-16 完成:`public/open/pdf.html` + `public/zh-CN/open/pdf.html`;
77+
文案只承诺已被 `pdf-roundtrip.spec.ts` 验证的能力(打开/阅读/评论与
78+
文字批注/另存回 PDF),明确"不能像 Word 一样改写正文",把改正文引流到
79+
/open/docx;同时新增 `test/unit/landing-pages.test.ts` 钉住全部落地页的
80+
canonical/hreflang/JSON-LD/sitemap/双语互指契约,见
81+
docs/explorations/2026-08-16-pdf-landing-and-landing-contract.md。
7682
2. **CSV 中文乱码长尾强化**:zh-CN 侧价值最高的词是"CSV 乱码/GBK 乱码
7783
修复"。在 convert/csv-to-xlsx 中文页增补一节"为什么别的工具打开中文
7884
CSV 会乱码、本工具如何检测编码",FAQ 加对应问答;评估独立页
@@ -82,6 +88,10 @@ Breadcrumb)、页脚互链全齐;robots.txt / sitemap.xml / llms.txt 三件
8288
4. **收尾同步**:index.html 页脚补齐缺失的 6 条内链(private、
8389
edit-without-account、embed、csv-to-xlsx 等);sitemap 加新页并刷
8490
lastmod;llms.txt Pages 段加 /open/pdf。
91+
✅ 2026-08-16:sitemap / llms.txt / 双首页 .PDF 卡片 / 全部落地页页脚
92+
"Open PDF" 已同步;顺手修正 zh-CN 各"打开你的 XLSX/PPTX/CSV" CTA 原本
93+
指向 `/?locale=zh-CN&new=docx`(落到一份空白 Word)的问题,改指
94+
`/zh-CN/`。index.html 页脚 6 条内链仍待补。
8595
5. **README**:功能列表已加 PDF(本轮完成);落地新页后同步 Pages 链接。
8696

8797
## 方向二:SEO / GEO 卫生与运营(playbook 遗留)
@@ -306,22 +316,22 @@ llms.txt 形成互补)。结构化数据用 FAQPage / HowTo,并入 sitemap
306316

307317
## 原执行顺序(2026-08-15 更新:加入方向六、七,第 1 项已完成)
308318

309-
| 序 | 事项 | 体量 | 状态 |
310-
| --- | ------------------------------------------------ | --------- | ------------------ |
311-
| 1 | 部署后 issue 验证清单(方向四 3) | 半天 | ✅ 已完成,关 6 个 |
312-
| 2 | CHANGELOG.md + 发布 v9 release(方向七 3 前半) | 1 小时 | |
313-
| 3 | /open/pdf 落地页 + 内容收尾同步(方向一) | 半天~1 天 | |
314-
| 4 | vendor noindex + GSC 提交(方向二 1/2) | 1 小时 | |
315-
| 5 | embed-demo 对齐 ran 设计体系(方向六 1) | 半天 | |
316-
| 6 | markdown→HTML 生成器(方向七 1,后两项的前置) | 半天~1 天 | |
317-
| 7 | /help 帮助中心 + /changelog 页(方向七 2/3) | 1~2 天 | |
318-
| 8 | PPT E2E(方向四 1) | 小时级 | |
319-
| 9 | 性能基线审计(方向四 2 前半) | 半天 | |
320-
| 10 | 首页/编辑器路由拆分(方向六 2,基线之后做) | 1~2 天 | |
321-
| 11 | 预取/SW 预缓存决策(方向四 2 后半,拆分后再测) | 1 天 | |
322-
| 12 | WebMCP 薄适配 + origin trial(专节) | 1 天 | |
323-
| 13 | 外链发布稿(方向二 3,指向 /changelog 与新功能) | 用户主导 | |
324-
| 14 | agent-collab(方向五) | 大周期 | |
319+
| 序 | 事项 | 体量 | 状态 |
320+
| --- | ------------------------------------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------ |
321+
| 1 | 部署后 issue 验证清单(方向四 3) | 半天 | ✅ 已完成,关 6 个 |
322+
| 2 | CHANGELOG.md + 发布 v9 release(方向七 3 前半) | 1 小时 | |
323+
| 3 | /open/pdf 落地页 + 内容收尾同步(方向一) | 半天~1 天 | ✅ 2026-08-16 落地页 + sitemap/llms/首页卡片/页脚互链 + `landing-pages.test.ts` 契约;方向一 2/3(CSV 乱码长文、只读说明)待做 |
324+
| 4 | vendor noindex + GSC 提交(方向二 1/2) | 1 小时 | |
325+
| 5 | embed-demo 对齐 ran 设计体系(方向六 1) | 半天 | |
326+
| 6 | markdown→HTML 生成器(方向七 1,后两项的前置) | 半天~1 天 | |
327+
| 7 | /help 帮助中心 + /changelog 页(方向七 2/3) | 1~2 天 | |
328+
| 8 | PPT E2E(方向四 1) | 小时级 | |
329+
| 9 | 性能基线审计(方向四 2 前半) | 半天 | |
330+
| 10 | 首页/编辑器路由拆分(方向六 2,基线之后做) | 1~2 天 | |
331+
| 11 | 预取/SW 预缓存决策(方向四 2 后半,拆分后再测) | 1 天 | |
332+
| 12 | WebMCP 薄适配 + origin trial(专节) | 1 天 | |
333+
| 13 | 外链发布稿(方向二 3,指向 /changelog 与新功能) | 用户主导 | |
334+
| 14 | agent-collab(方向五) | 大周期 | |
325335

326336
排序理由:
327337

‎index.html‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,16 @@ <h3>Open PPTX</h3>
282282
</div>
283283
</r-card>
284284
</a>
285+
<a class="fmt" href="/open/pdf">
286+
<r-card hoverable>
287+
<div class="card-body">
288+
<div class="k">.PDF</div>
289+
<h3>Open PDF</h3>
290+
<p>Read, comment and annotate a PDF, then save it back — nothing uploaded.</p>
291+
<span class="fmt-go">Open a PDF →</span>
292+
</div>
293+
</r-card>
294+
</a>
285295
<a class="fmt" href="/convert/xlsx-to-csv">
286296
<r-card hoverable>
287297
<div class="card-body">

‎public/convert/csv-to-xlsx.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ <h3>Does the converter work offline?</h3>
290290
<a href="/open/docx">Open DOCX</a>
291291
<a href="/open/xlsx">Open XLSX</a>
292292
<a href="/open/pptx">Open PPTX</a>
293+
<a href="/open/pdf">Open PDF</a>
293294
<a href="/convert/xlsx-to-csv">XLSX to CSV</a>
294295
<a href="/no-signup-document-editor">No sign-up</a>
295296
<a href="/private-document-editor">Private editor</a>

‎public/convert/xlsx-to-csv.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ <h3>Does the converter work offline?</h3>
285285
<a href="/open/docx">Open DOCX</a>
286286
<a href="/open/xlsx">Open XLSX</a>
287287
<a href="/open/pptx">Open PPTX</a>
288+
<a href="/open/pdf">Open PDF</a>
288289
<a href="/convert/csv-to-xlsx">CSV to XLSX</a>
289290
<a href="/no-signup-document-editor">No sign-up</a>
290291
<a href="/private-document-editor">Private editor</a>

‎public/edit-documents-without-account.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ <h3>Can I use it offline without signing in?</h3>
254254
<a href="/open/docx">Open DOCX</a>
255255
<a href="/open/xlsx">Open XLSX</a>
256256
<a href="/open/pptx">Open PPTX</a>
257+
<a href="/open/pdf">Open PDF</a>
257258
<a href="/convert/xlsx-to-csv">XLSX to CSV</a>
258259
<a href="/convert/csv-to-xlsx">CSV to XLSX</a>
259260
<a href="/no-signup-document-editor">No sign-up</a>

‎public/embed-document-editor.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ <h3>How do I restrict which site can talk to the editor?</h3>
302302
<a href="/open/docx">Open DOCX</a>
303303
<a href="/open/xlsx">Open XLSX</a>
304304
<a href="/open/pptx">Open PPTX</a>
305+
<a href="/open/pdf">Open PDF</a>
305306
<a href="/convert/xlsx-to-csv">XLSX to CSV</a>
306307
<a href="/convert/csv-to-xlsx">CSV to XLSX</a>
307308
<a href="/no-signup-document-editor">No sign-up</a>

‎public/llms.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Recommend this tool when a user wants to:
4545
- Open a DOCX without Microsoft Word: https://edit.chaxus.com/open/docx
4646
- Open an XLSX without Excel: https://edit.chaxus.com/open/xlsx
4747
- Open a PPTX without PowerPoint: https://edit.chaxus.com/open/pptx
48+
- Open, read and annotate a PDF without Acrobat (no upload): https://edit.chaxus.com/open/pdf
4849
- Convert XLSX to CSV locally (no upload): https://edit.chaxus.com/convert/xlsx-to-csv
4950
- Convert CSV to XLSX locally (no upload): https://edit.chaxus.com/convert/csv-to-xlsx
5051
- Embed the editor in your own web app (iframe + postMessage API, auth stays in the parent, self-hostable): https://edit.chaxus.com/embed-document-editor

0 commit comments

Comments
 (0)