修复博客卡片溢出与侧栏按钮裁切 - #44
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
该 PR 主要针对 GoClub Hugo 站点的前端布局问题做兼容性修复:解决技术博客索引卡片在宽屏多列布局下因长 URL 导致的横向溢出,以及侧栏收起/展开按钮在缩放/宽屏场景下被裁切的问题。
Changes:
- 为博客卡片摘要区域补充
min-width: 0与overflow-wrap: anywhere,允许长 URL 在卡片宽度内自动换行,避免撑破布局。 - 调整侧栏收起/展开按钮在
layouts/baseof.html中的 DOM 层级,将按钮移出.book-menu-content,避免受overflow: hidden等影响而被裁切。 - 新增一份站内搜索调研与优化方案文档(
SEARCH_OPTIMIZATION_PLAN.md)。
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| SEARCH_OPTIMIZATION_PLAN.md | 新增站内搜索调研与优化方案文档(与本 PR UI 修复主题存在范围不一致风险)。 |
| layouts/baseof.html | 将侧栏 toggle 按钮从 .book-menu-content 内移到其外侧,降低被裁切风险。 |
| assets/_custom.scss | 为 .section-card-summary 增加断行与 flex 子项收缩支持,修复长 URL 溢出。 |
Comment on lines
+1
to
+5
| # GoClub 搜索功能调研与优化方案 | ||
|
|
||
| 更新日期:2026-08-03 | ||
|
|
||
| ## 1. 文档目标 |
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.
改动说明
问题原因
博客卡片 URL 溢出
.section-card-summary作为 Flex 子项时没有设置min-width: 0,连续 URL 又缺少自然断行点,因此内容会撑破卡片宽度。本次为摘要区域补充:
min-width: 0overflow-wrap: anywhere侧栏按钮被裁切
侧栏按钮原本位于
.book-menu-content内。该容器同时使用了backdrop-filter和overflow: hidden,会改变固定定位后代的定位参照,并裁切超出容器的内容。浏览器缩放后,可视区域宽度变化会放大定位偏移,最终只显示按钮的一部分。本次仅将按钮移动到
.book-menu-content外、保留在.book-menu内,不修改按钮的尺寸、样式、定位公式和交互逻辑。用户影响
验证
hugo --minify --gc构建通过,共生成 439 个页面。