refactor(docs): consolidate site content into single data source#7
Merged
Conversation
Extract all hardcoded navigation, sidebar, algorithm catalog, and benchmark metadata into a unified site-content.mjs module. This eliminates duplication between English and Chinese locales and ensures a single source of truth. Changes: - Create site-content.mjs with algorithmCatalog, benchmarkCatalog, nav, sidebar - Replace inline config with buildNav/buildSidebar functions - Simplify AlgorithmGrid and BenchmarkChart to use centralized data - Add HomeLanding component using new data layer - Remove LanguageDetector (functionality integrated into utils) - Add comprehensive tests for data consistency across locales - Reduce config.ts from ~200 lines to ~50 lines Benefits: - Single source of truth for all site metadata - Type-safe data access with test coverage - Easier to maintain and extend - Consistent navigation across locales
LessUp
added a commit
that referenced
this pull request
May 22, 2026
refactor(docs): consolidate site content into single data source
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
site-content.mjs模块Changes
site-content.mjs包含algorithmCatalog、benchmarkCatalog、导航和侧边栏配置buildNav/buildSidebar函数替换内联配置AlgorithmGrid和BenchmarkChart组件以使用集中式数据HomeLanding组件使用新的数据层LanguageDetector(功能已集成到 utils)config.ts从约 200 行减少到约 50 行Benefits
Test plan