From 07d30e2d401dc74a8512697023ac0b2cb677717e Mon Sep 17 00:00:00 2001 From: felix Date: Thu, 23 Jul 2026 10:41:20 +0800 Subject: [PATCH] docs: add official guide links --- README.md | 6 ++++++ tests/repository-identity.test.mjs | 21 +++++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b796245..ca0d32e 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,12 @@ CC Theme is an open-source macOS app for installing ready-made Codex themes in C It is an independent, unofficial, open-source project—not a prompt library, concept gallery, or general-purpose AI theme generator. This repository contains the CC Theme app, host-specific Adapters, shared contracts, and release metadata. Production theme packages are maintained in the separate [CC Theme Themes](https://github.com/quanzhankeji/cc-theme-themes) registry and published as Release assets; theme media does not enter this Git source tree. +## Official guides + +- [Browse ready-made and custom ChatGPT Desktop themes](https://cc-theme.app/en/chatgpt-desktop/themes) +- [Improve Codex dark mode readability](https://cc-theme.app/en/guides/fix-unreadable-codex-dark-mode) +- [Add an image or video background to ChatGPT Desktop](https://cc-theme.app/en/guides/safe-image-background-codex-mac) + ## Demo https://github.com/user-attachments/assets/5877f113-c50f-4457-84e1-89fb7c195df8 diff --git a/tests/repository-identity.test.mjs b/tests/repository-identity.test.mjs index 1b39dc3..746f7ed 100644 --- a/tests/repository-identity.test.mjs +++ b/tests/repository-identity.test.mjs @@ -8,6 +8,11 @@ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); const extension = ".cctheme"; const mimeType = "application/vnd.cc-theme.theme+zip"; const officialWebsite = "https://cc-theme.app"; +const officialGuideUrls = [ + "https://cc-theme.app/en/chatgpt-desktop/themes", + "https://cc-theme.app/en/guides/fix-unreadable-codex-dark-mode", + "https://cc-theme.app/en/guides/safe-image-background-codex-mac", +]; const allowedReadmeHosts = new Set(["cc-theme.app", "docs.github.com", "github.com"]); async function json(relative) { @@ -129,17 +134,21 @@ test("repository metadata points to the new repository and controlled official w assert.equal(metadata.bugs.url, "https://github.com/quanzhankeji/cc-theme/issues", relative); } const readmes = [ - ["README.md", `Official website: [cc-theme.app](${officialWebsite})`], - ["README.zh-CN.md", `官方网站:[cc-theme.app](${officialWebsite})`], + ["README.md", `Official website: [cc-theme.app](${officialWebsite})`, [officialWebsite, ...officialGuideUrls]], + ["README.zh-CN.md", `官方网站:[cc-theme.app](${officialWebsite})`, [officialWebsite]], ]; - for (const [relative, expectedWebsiteLine] of readmes) { + for (const [relative, expectedWebsiteLine, expectedOfficialUrls] of readmes) { const readme = await fs.readFile(path.join(root, relative), "utf8"); assert.match(readme, /github\.com\/quanzhankeji\/cc-theme/); assert.match(readme, /`\.cctheme`/); const websiteClaims = readme.split(/\r?\n/).filter((line) => /\bwebsite\b|官方网站|官网/i.test(line)); assert.deepEqual(websiteClaims, [expectedWebsiteLine], `${relative}: official website claim`); assert.equal(readme.split(expectedWebsiteLine).length - 1, 1, `${relative}: official website count`); - assert.doesNotMatch(readme.replace(expectedWebsiteLine, ""), /cc-theme\.app/i, `${relative}: unbound official domain`); + const readmeWithoutApprovedOfficialReferences = expectedOfficialUrls.slice(1).reduce( + (content, url) => content.replaceAll(url, ""), + readme.replace(expectedWebsiteLine, ""), + ); + assert.doesNotMatch(readmeWithoutApprovedOfficialReferences, /cc-theme\.app/i, `${relative}: unbound official domain`); const absoluteUrls = [...readme.matchAll(/https?:\/\/[^\s<>()\]]+/g)].map(([url]) => url); const officialUrls = []; @@ -150,7 +159,7 @@ test("repository metadata points to the new repository and controlled official w if (url.hostname === "cc-theme.app") { officialUrls.push(value); assert.equal(url.origin, officialWebsite, `${relative}: official website origin`); - assert.equal(url.pathname, "/", `${relative}: official website path`); + assert.equal(expectedOfficialUrls.includes(value), true, `${relative}: unapproved official website URL ${value}`); assert.equal(url.username, "", `${relative}: official website username`); assert.equal(url.password, "", `${relative}: official website password`); assert.equal(url.port, "", `${relative}: official website port`); @@ -158,7 +167,7 @@ test("repository metadata points to the new repository and controlled official w assert.equal(url.hash, "", `${relative}: official website fragment`); } } - assert.deepEqual(officialUrls, [officialWebsite], `${relative}: canonical HTTPS website URL`); + assert.deepEqual(officialUrls, expectedOfficialUrls, `${relative}: canonical HTTPS website URLs`); assert.doesNotMatch(readme, /Web Studio|online editor|在线编辑器/i); } });