Skip to content

修复博客卡片溢出与侧栏按钮裁切 - #44

Merged
LeoninCS merged 2 commits into
LeoninCS:mainfrom
4evour:codex/fix-blog-card-and-sidebar
Aug 4, 2026
Merged

修复博客卡片溢出与侧栏按钮裁切#44
LeoninCS merged 2 commits into
LeoninCS:mainfrom
4evour:codex/fix-blog-card-and-sidebar

Conversation

@4evour

@4evour 4evour commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

改动说明

  • 修复技术博客索引卡片中的长 URL 在宽屏、多列布局下横向溢出的问题。
  • 保留完整 URL 文本,并允许其在卡片可用宽度内自动换行。
  • 调整侧栏收起/展开按钮的 DOM 层级,避免浏览器缩放或宽屏显示时按钮被裁成半圆。

问题原因

博客卡片 URL 溢出

.section-card-summary 作为 Flex 子项时没有设置 min-width: 0,连续 URL 又缺少自然断行点,因此内容会撑破卡片宽度。

本次为摘要区域补充:

  • min-width: 0
  • overflow-wrap: anywhere

侧栏按钮被裁切

侧栏按钮原本位于 .book-menu-content 内。该容器同时使用了 backdrop-filteroverflow: hidden,会改变固定定位后代的定位参照,并裁切超出容器的内容。浏览器缩放后,可视区域宽度变化会放大定位偏移,最终只显示按钮的一部分。

本次仅将按钮移动到 .book-menu-content 外、保留在 .book-menu 内,不修改按钮的尺寸、样式、定位公式和交互逻辑。

用户影响

  • 博客卡片能够显示完整 URL,不再横向撑破布局。
  • 侧栏收起/展开按钮在正常宽度和缩放场景下均可完整显示。
  • 移动端现有隐藏逻辑、侧栏展开/折叠交互保持不变。

验证

  • hugo --minify --gc 构建通过,共生成 439 个页面。
  • 浏览器回归验证通过:1920×900、1280×720、侧栏折叠状态及 800px 移动布局。
  • 宽屏下按钮完整位于侧栏范围内。
  • 浏览器控制台无错误。

@LeoninCS
LeoninCS marked this pull request as ready for review August 4, 2026 16:28
Copilot AI lite review requested due to automatic review settings August 4, 2026 16:28
@LeoninCS
LeoninCS merged commit 78094fb into LeoninCS:main Aug 4, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 主要针对 GoClub Hugo 站点的前端布局问题做兼容性修复:解决技术博客索引卡片在宽屏多列布局下因长 URL 导致的横向溢出,以及侧栏收起/展开按钮在缩放/宽屏场景下被裁切的问题。

Changes:

  • 为博客卡片摘要区域补充 min-width: 0overflow-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. 文档目标
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants