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
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Interview Compass

**工程师的面试与晋升指南**

**A guide to engineering interviews and promotions.**

**工程师的面试与晋升指南**

[![Build and deploy](https://github.com/Liyuk/interview-compass/actions/workflows/deploy.yml/badge.svg)](https://github.com/Liyuk/interview-compass/actions/workflows/deploy.yml)
[![Code: MIT](https://img.shields.io/badge/code-MIT-blue)](LICENSE)
[![Content: CC BY-NC-SA 4.0](https://img.shields.io/badge/content-CC_BY--NC--SA_4.0-lightgrey)](CONTENT-LICENSE.md)

**先看清岗位,再讲清证据。**

**Know the role. Show the evidence.**

**先看清岗位,再讲清证据。**

一套面向候选人、面试官与管理者的双语面试和晋升参考。看懂岗位要解决什么、问题想判断什么,再用有上下文、能核实的经历说明能力与匹配度。

A bilingual interview and promotion reference for candidates, interviewers, and hiring managers. Understand what the role needs and what a question is testing, then use contextual, checkable experience to explain capability and fit.

**[打开中文站点](https://liyuk.github.io/interview-compass/)** · **[Open the English site](https://liyuk.github.io/interview-compass/en/)**
**[Open the English site](https://liyuk.github.io/interview-compass/)** · **[打开中文站点](https://liyuk.github.io/interview-compass/zh/)**

## Built from practice

Expand Down Expand Up @@ -62,7 +62,7 @@ npm ci
npm run dev
```

The site has Chinese and English routes for the home page, six goal-based paths, curated question sets, a filterable full library, a user guide, the questioning framework, an eight-domain capability map, role, scenario and topic views, and question pages. Question cards distinguish individually reviewed analysis from shared reading prompts. Stage profiles describe role-specific behaviors, evidence to inspect, and the distinction between professional-contributor and management paths. First-time visitors can select one of six engineering specializations and a responsibility stage, then browse strictly matching questions and search results. The header always allows changing the target or viewing all questions. A shared link temporarily overrides the local choice without overwriting it. Search uses Pagefind per language and reviewed role–stage combination. The Pages base path is `/interview-compass/`; the Chinese site is at `/interview-compass/` and English at `/interview-compass/en/`.
The site has English routes at the root and Chinese routes under `/zh/` for the home page, six goal-based paths, curated question sets, a filterable question library, guides, an eight-domain capability map, role, scenario and topic views, and question pages. Question cards distinguish reviewed analysis from shared reading prompts. Stage profiles describe role-specific behaviors and evidence across professional-contributor and management paths. Visitors can select an engineering specialization and responsibility stage, then browse matching questions and search results. The header keeps the target controls available, and shared links preserve each recipient’s saved preference. Search uses Pagefind by language and reviewed role–stage combination. The GitHub Pages base path is `/interview-compass/`.

Each question page can generate a structured analysis prompt for a user-selected external AI tool. The site does not collect answers or send them anywhere. The question library also has a compact public data feed for selected question cards. The companion skill at `skills/interview-compass-coach/` uses that feed for question lookup and follows the same evidence and privacy limits.

Expand Down
10 changes: 10 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import { defineConfig } from 'astro/config';
import sitemap from '@astrojs/sitemap';

export default defineConfig({
site: 'https://liyuk.github.io',
base: '/interview-compass',
integrations: [
sitemap({
i18n: {
defaultLocale: 'en',
locales: { en: 'en', zh: 'zh-CN' },
},
filter: (page) => !/\/(?:en|search|404)(?:\/|\.html?$)/.test(new URL(page).pathname),
}),
],
});
19 changes: 19 additions & 0 deletions docs/seo-geo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SEO and GEO setup

The static site emits self-referencing canonical URLs, reciprocal `en` and `zh-CN` alternates, localized XML sitemap entries, page descriptions, social metadata, and JSON-LD for visible page content. Search and not-found pages are marked `noindex`; the sitemap omits them.

The build deploys to the GitHub Pages project path `/interview-compass/`. `public/llms.txt` is served under that path and gives AI crawlers a short map of the main pages. It is a convenience file, not a ranking signal or a Google AI Search requirement. Google says its AI search features use the same indexing and SEO foundations as Search and do not require special AI files or schema.

## Hosting boundary

The project repository cannot publish `https://liyuk.github.io/robots.txt`, which belongs to the user-site root rather than this project's `/interview-compass/` directory. Robots policy for the whole `liyuk.github.io` host must be managed in the user-site repository. This project keeps indexable HTML crawlable and exposes its sitemap at `https://liyuk.github.io/interview-compass/sitemap-index.xml`.

## Validation

Build output can confirm generated tags, URLs, sitemap entries, JSON-LD, redirects, and the LLM index. Search Console and live crawler reports require access to the deployed property; this repository alone cannot confirm indexing, rankings, or citations in answer engines.

## References

- [Google: AI features and your website](https://developers.google.com/search/docs/appearance/ai-features) — AI search uses the same indexing foundations as Search and does not require special AI files or markup.
- [Google: localized versions of your pages](https://developers.google.com/search/docs/specialty/international/localized-versions) — language alternates must be reciprocal and include each version.
- [Astro: sitemap integration](https://docs.astro.build/en/guides/integrations-guide/sitemap/) — localized sitemap alternate links.
78 changes: 78 additions & 0 deletions docs/superpowers/plans/2026-11-02-default-english-zh-prefix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Default English and `/zh` Paths Implementation Plan

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** Make English the default site language, serve Chinese under `/zh/`, edit site copy to be concise and natural, and complete the site's SEO/GEO foundations.

**Architecture:** Swap the localized Astro page trees while leaving shared data endpoints in place. Centralize the new locale prefixes in route generation and retain legacy URL redirects. Refine shared UI and guide copy in both languages. Generate canonical and alternate language metadata, a localized sitemap and page-accurate structured data for indexable pages.

**Tech Stack:** Astro 7, TypeScript, Markdown.

**Spec:** `docs/superpowers/specs/2026-11-02-default-english-zh-prefix-design.md`

## Global Constraints

- English uses root paths; Chinese uses `/zh/`.
- Old `/en/` routes redirect to root English routes. Chinese root routes collide with the new English routes and therefore cannot redirect while root serves English.
- Do not change question data, evaluation logic, data structures, or visual design.
- Retain necessary factual boundaries and safety notices while removing redundant defensive copy.
- Use SEO fundamentals as the GEO baseline; describe any `llms.txt` as an optional index, not a Google ranking feature.
- Honor the GitHub Pages `/interview-compass` base for every absolute URL.
- Do not add or run tests; run Astro static checks and build for verification.

## Review Focus

- Base path `/interview-compass/` remains present on generated internal links.
- Pagination and localized search links resolve to the correct language tree.
- Language switching preserves the current page when an equivalent route exists.
- Legacy routes do not shadow the new localized pages.
- Localized metadata uses the language and canonical URL matching the served route.
- Canonicals, sitemap entries and JSON-LD URLs include the deployment base and configured site origin.
- Search, not-found and redirect pages do not become indexable canonical content.
- JSON-LD contains only claims represented by visible page content.

---

### Task 1: Swap localized page trees and preserve legacy routes

**Files:**
- Move English page files from `src/pages/en/` to their corresponding paths under `src/pages/`.
- Move existing localized root page files under `src/pages/zh/`.
- Keep `src/pages/data/` shared and add redirects for previous `/en/` paths.

- [ ] Move the 33 English pages to root paths and the 33 Chinese pages under `/zh/`, excluding shared data endpoints.
- [ ] Add `/en/` compatibility redirects to the corresponding root routes.
- [ ] Check page tree collisions and ensure all static route entry points remain represented.

### Task 2: Update locale path generation and metadata

**Files:**
- Modify `src/lib/routes.ts`.
- Modify `src/lib/locale-paths.ts` only if required by route switching.
- Modify `src/layouts/SiteLayout.astro` for canonical, alternate locale metadata, robots directives and JSON-LD.
- Modify `astro.config.mjs` and `package.json` for localized sitemap generation if supported by the installed Astro version.
- Add `public/robots.txt` and a concise `public/llms.txt` only when their deployed paths are valid for this GitHub Pages project site.

- [ ] Make English the unprefixed locale and prefix Chinese paths with `/zh`.
- [ ] Ensure language switches, breadcrumbs, pagination, search and canonical links target the new paths.
- [ ] Preserve `/en/` links with generated static redirects. Do not claim root Chinese URLs can redirect because those URLs now serve English pages.
- [ ] Generate canonical URLs and reciprocal `en` / `zh-CN` alternates for equivalent indexable pages.
- [ ] Generate a localized sitemap and page-appropriate JSON-LD; exclude search, not-found and compatibility redirect pages.
- [ ] Verify robots and optional LLM index paths against the project-site base path and document any hosting-level limit.

### Task 3: Edit user-facing site copy

**Files:**
- Modify localized text in `src/components/`, `src/views/`, `src/content/guide/en.md`, and `src/content/guide/zh-CN.md`.

- [ ] Review copy across shared shell, navigation, empty/error states, guides and page introductions in both locales.
- [ ] Replace defensive or generic framing with direct, specific language; preserve necessary caveats and factual distinctions.
- [ ] Search for stale `/en/` and root-Chinese references in copy and documentation.

### Verification

- [ ] Run `npm run check` and confirm Astro reports no errors.
- [ ] Run `npm run build` and inspect generated output for root English pages, `/zh/` Chinese pages, shared data endpoints and legacy redirects.
- [ ] Inspect built HTML, sitemap, robots and LLM index output for canonical origin/base, reciprocal hreflang, indexability and valid JSON-LD.
- [ ] Verify public SEO/GEO behavior against official crawler documentation; distinguish technical readiness from actual indexing or AI citations.
- [ ] Review the complete diff read-only and report actionable findings and remaining risks.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 默认英文与中文路径设计

## 意图

让 Interview Compass 默认以英文访问,中文页面统一使用 `/zh/` 前缀,并让站点文案更直接、自然,减少无助于用户判断的防御性说明和模板化表达。

## 目标与边界

- 英文首页和全部英文页面使用根路径;中文页面使用 `/zh/`。
- 导航、面包屑、搜索、分页、语言切换、规范链接和静态数据链接都与新路径一致。
- 原有 `/en/` 英文链接保留兼容跳转。原中文根路径与新的英文根路径完全重合,切换后根路径提供英文,无法同时将相同 URL 用作中文跳转。
- 调整全站用户可见的界面与说明文案;保留必要的事实边界、安全提示和内容准确性。
- 完善 SEO/GEO 基础:自引用 canonical、双语 hreflang、语言站点地图、可抓取页面元数据与适合实际页面内容的结构化数据;不把非标准 AI 文件宣称为排名信号。
- 核实 robots 与 GitHub Pages 子路径部署边界,避免生成指向错误域名根目录的声明。
- 不改题库知识内容、评估框架、数据结构或视觉设计。

## 方案

1. **迁移页面树并统一路径生成(采用)**:把英文页面放到根路径、中文页面放到 `/zh`,更新路径生成器并为旧路径保留跳转。匹配部署产物和用户期望的 URL,静态页面也能直接部署。
2. **保留文件树并增加 URL 重写**:减少文件迁移,但依赖部署平台重写规则,GitHub Pages 无法原生保证所有旧路径及分页规则。

## 约束与判断

- 站点使用 Astro 静态构建,部署在带 `/interview-compass` base 的 GitHub Pages。
- GitHub Pages 静态输出不能发送 HTTP 301;旧 `/en/` URL 使用 `noindex` 的客户端跳转页兼容访问,规范链接和站点地图只使用新 URL。
- 内容、页面组件和 UI 已有中英文支持;路径约定集中在 `src/lib/routes.ts`。
- Google Search 官方指南指出 AI 搜索仍依赖基础 SEO,`llms.txt` 不影响 Google 搜索展现;若增加此文件,只作为其他系统的可选站点索引。
- 以现有页面内容为基础,不做逐句直译式重写;删掉重复的免责声明式铺垫,具体说明仍保留。
- 设计与实现由本任务直接推进;验证使用 Astro 检查和静态构建,不增加或运行测试。
66 changes: 66 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
},
"devDependencies": {
"@astrojs/check": "0.9.12",
"@astrojs/sitemap": "^3.7.4",
"@playwright/test": "1.64.1",
"@types/js-yaml": "^4.0.9",
"@types/node": "^26.6.5",
Expand Down
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig, devices } from '@playwright/test';

const port = Number(process.env.PLAYWRIGHT_PORT ?? 5027);
const baseURL = `http://127.0.0.1:${port}/interview-compass/`;
const baseURL = `http://127.0.0.1:${port}/interview-compass/zh/`;

export default defineConfig({
testDir: './tests/e2e',
Expand Down
23 changes: 23 additions & 0 deletions public/llms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Interview Compass

> A bilingual reference for engineering interviews and promotion. Start with the role, examine decisions and contribution, and support conclusions with evidence.

## English

- [Home](https://liyuk.github.io/interview-compass/): Overview and entry points.
- [Preparation guide](https://liyuk.github.io/interview-compass/guide/): Choose a role, responsibility scope, and useful questions.
- [Question library](https://liyuk.github.io/interview-compass/questions/): Search published interview and promotion questions.
- [Interviewing guide](https://liyuk.github.io/interview-compass/framework/): Plan questions, follow-ups, and evidence review.
- [Capability map](https://liyuk.github.io/interview-compass/capabilities/): Browse questions by capability.
- [Career-stage model](https://liyuk.github.io/interview-compass/capability-model/): Compare responsibility across career stages.

## 简体中文

- [首页](https://liyuk.github.io/interview-compass/zh/): 站点介绍与内容入口。
- [准备指南](https://liyuk.github.io/interview-compass/zh/guide/): 确定岗位、责任范围与练习方向。
- [面试题库](https://liyuk.github.io/interview-compass/zh/questions/): 浏览与搜索面试、晋升问题。
- [提问框架](https://liyuk.github.io/interview-compass/zh/framework/): 设计问题、追问并核验证据。
- [能力地图](https://liyuk.github.io/interview-compass/zh/capabilities/): 按能力查找问题。
- [阶段能力模型](https://liyuk.github.io/interview-compass/zh/capability-model/): 对照不同职业阶段的责任要求。

This file is a compact navigation aid. Use the linked pages as the source of truth; page content and metadata describe the full context.
2 changes: 1 addition & 1 deletion scripts/build-search-reading-map.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ for (const name of await readdir(directory)) {
const text = gunzipSync(await readFile(new URL(name, directory))).toString();
if (!text.startsWith('pagefind_dcd')) throw new Error(`Unsupported Pagefind fragment: ${name}`);
const data = JSON.parse(text.slice('pagefind_dcd'.length));
const match = data.url.match(/^\/(?:en\/)?questions\/([a-z0-9-]+)\/$/);
const match = data.url.match(/^\/(?:zh\/)?questions\/([a-z0-9-]+)\/$/);
if (match) ids[name.replace(/\.pf_fragment$/, '')] = match[1];
}
if (!Object.keys(ids).length) throw new Error('Search reading identities are missing');
Expand Down
Loading
Loading