[Feature] Nested Category #591
Open
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.
Type of change
Checklist
Related Issue
[Feature]: 添加多级分类 #580
Changes
Implemented nested category functionality to support hierarchical article classification:
category
field in article frontmatter to support multi-level category structures using/
separator (e.g.,A/B/C
)CategoryBranch.astro
component for rendering category tree structureCategoryItem.astro
component for rendering individual category itemsCategories.astro
component to support collapsible nested category displayArchivePanel.svelte
component to support filtering and displaying articles by nested categoriescontent-utils.ts
to support parsing and filtering of multi-level categoriesHow To Test
Testing steps:
Create test articles with different category levels:
category: A
category: A/B
category: A/B/C
Sidebar category component testing:
Archive page testing:
/archive
pageCompatibility testing:
Screenshots
Created three test articles for functionality validation using categories A, A/B, and A/B/C:
Sidebar Category Component
Archive Page Category Filtering
Filter by category A (shows articles from A and all its subcategories)
Filter by category A/B (shows articles from A/B and its subcategories)
Filter by category A/B/C (shows only articles from this category)
Additional Notes