Skip to content

feat: release v0.4.0 — search i18n, blog bilingual dedup, and language-aware navigation#59

Merged
lyj715824 merged 2 commits into
mainfrom
update-search
Jul 17, 2026
Merged

feat: release v0.4.0 — search i18n, blog bilingual dedup, and language-aware navigation#59
lyj715824 merged 2 commits into
mainfrom
update-search

Conversation

@dongjiang1989

@dongjiang1989 dongjiang1989 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Which issue(s) this PR fixes:

Changes

Added

  • Hugging Face Icon Asset: Official Hugging Face SVG stored locally, replacing inline SVGs in ProjectCard.astro and [slug].astro
  • Blog Post Language Variants: lang + translationId frontmatter links zh/en versions; language toggle switches between variants; list/grid cards render both via .i18n-zh/.i18n-en; bilingual posts excluded from pagination, RSS, related and adjacent posts

Changed

  • Search Index Blog Deduplication: Bilingual pairs merged by translationId into single entry with title/titleEn, excerpt/excerptEn, url/urlEn — index shrinks from 11 to 9 blog entries
  • SearchModal Language-Aware URLs: Selects item.urlEn when system language is English, so search results navigate to the correct language variant
  • PostNavigation Language-Aware: Prev/next titles and URLs match the page language — bilingual posts show translation, monolingual posts show native content
  • TableOfContents i18n: TOC heading "目录" → data-i18n="blog.tableOfContents" (shows "Table of Contents" in English mode)

Fixed

  • CI Auto-Update Workflows: GH013 branch protection bypass — replaced GITHUB_TOKEN with ADMIN_PAT secret
  • Observer Redeclaration on View Transitions: const Observer caused SyntaxError on client route swap — wrapped in IIFE, exposed as window.Observer for theme toggle access

Test plan

  • npm run check passes (astro check, eslint, prettier) — 0 errors, 0 warnings, 0 hints
  • npm run build completes successfully
  • Search "CNCF" in English mode → shows English title, links to English blog URL
  • Blog prev/next navigation follows system language
  • TOC heading switches between "目录" and "Table of Contents"

Special notes for reviewers:

Release v0.4.0 — search i18n, blog bilingual dedup, and language-aware navigation

The IIFE wrapper scoped Observer locally, breaking the reference from the
first script block (theme toggle calls Observer.removeAnimationDelay()).
Changed `const Observer` to `window.Observer` to keep it globally accessible
while still avoiding redeclaration errors on View Transitions.

Signed-off-by: dongjiang <dongjiang1989@126.com>
…e-aware navigation

- Search index deduplicates bilingual blog pairs by translationId, adds urlEn
- SearchModal uses urlEn when system language is English
- PostNavigation shows prev/next titles and URLs matching page language
- TableOfContents heading "目录" → data-i18n="blog.tableOfContents"
- Cache data refreshed (⭐18,972, 169 contributors from 60 repos)
- Version bump to 0.4.0

Signed-off-by: dongjiang <dongjiang1989@126.com>
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
website Ready Ready Preview, Comment Jul 17, 2026 7:38am

@lyj715824
lyj715824 merged commit 8eee1f3 into main Jul 17, 2026
12 checks passed
@dongjiang1989
dongjiang1989 deleted the update-search branch July 17, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants