Files
hugo-theme-stack/i18n/zh.toml
T
37f6a77a1a feat: Add jump-to-page dialog and improve pagination logic and styling (#1303)
* feat: add jump-to-page dialog on pagination ellipsis

- Replace pagination windowing algorithm with a tighter 5-item window
  (curr-1 / curr / curr+1, clamped at edges) and hide-on-mobile for
  pages more than 1 step away from the current page
- Ellipsis spans now carry the pagination-jump-trigger class and open
  a native <dialog> on click instead of being static decorations
- Add <dialog id="pagination-jump-dialog"> with number input, Go button,
  and Enter-key hint; data-total / data-first-url / data-format-url
  attributes on <nav> give the JS all it needs to build the target URL
- Add assets/ts/pagination.ts: setupPaginationJump() with Fisher-Yates
  backdrop-click and ESC handling, animated open/close via .closing class
- Wire setupPaginationJump() into Stack.init() in main.ts
- Extend pagination.scss with .hide-on-mobile, .pagination-jump-trigger
  hover style, and the full #pagination-jump-dialog styling + keyframe
  scale-up/scale-down animations
- Add [pagination] i18n keys (jumpToPage / jump / pressEnter) to
  en / zh / zh-hant-tw / zh-hant-hk / ja

* style: align pagination code with upstream conventions

- pagination.html: collapse multi-line span/class/aria attrs to single
  lines; use HTML5 void element syntax; fix hint div indentation
- pagination.scss: 2-space indent → 4-space indent
- pagination.ts: tab indent → 4-space indent; export const arrow fn →
  export function declaration

* chore: update layouts/_partials/pagination.html

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* chore: add aria-labelledby attrributes for better accesibility

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: use { once: true } for the listener and guard against re-entry when .closing is already set.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* style: replace hardcoded values with design tokens and improve dialog UX

- Replace all hardcoded px spacing in .page-link with --spacing-* tokens
- Use @include card-style in #pagination-jump-dialog; override with --shadow-l2
- Replace padding: 24px with var(--card-padding) for responsive dialog padding
- Align header title/subtitle to space-between for cleaner layout
- Replace hardcoded gaps/padding in form with spacing tokens
- Fix input/button border-radius from 8px to 6px (better proportion for 44px height)
- Fix focus ring: use color-mix(accent-color 20%) so it's visible in dark mode
- Add :focus-visible + outline:none to fully suppress native browser outline
- Remove translateY from button hover for more restrained interaction
- Scope transition to specific properties (border-color, box-shadow, background-color)

* chore: add pagination test articles for easier debugging

* style: enhance backdrop animations for pagination jump dialog

* style: replace pagination ellipsis spans with buttons for improved accessibility

* fix: check if browser supports dialog API before continue with pagination jump setup

* fix: retain focus on last active element when closing pagination jump dialog

* fix: style for page-link button (pagination-jump)

* style: adjust width of pagination jump dialog, add container padding

* style: simplify

* refactor: simplify pagination link logic

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jimmy Cai <jimmy@cai.im>
2026-04-26 12:41:31 +02:00

75 lines
2.0 KiB
TOML

toggleMenu = "切换菜单"
darkMode = "暗色模式"
[list]
page = "{{ .Count }} 个页面"
section = "章节"
subsection = "子章节"
[article]
back = "返回"
tableOfContents = "目录"
relatedContent = "相关文章"
lastUpdatedOn = "最后更新于"
readingTime = "阅读时长: {{ .Count }} 分钟"
[article.alert]
note = "备注"
tip = "提示"
important = "重要"
warning = "警告"
caution = "注意"
[notFound]
title = "404 错误"
subtitle = "页面不存在"
[widget]
[widget.archives]
title = "归档"
more = "更多"
[widget.tagCloud]
title = "标签云"
[widget.categoriesCloud]
title = "分类"
[search]
title = "搜索"
placeholder = "输入关键词..."
resultTitle = "#PAGES_COUNT 个结果 (用时 #TIME_SECONDS 秒)"
[footer]
builtWith = "使用 {{ .Generator }} 构建"
designedBy = "主题 {{ .Theme }} 由 {{ .DesignedBy }} 设计"
[cookies]
title = "Cookie 同意"
text = "我们使用 Cookie 来增强您的浏览体验并分析网站流量。"
acceptAll = "接受所有"
deny = "拒绝"
managePreferences = "管理偏好设置"
settingsTitle = "Cookie 偏好设置"
savePreferences = "保存偏好设置"
cancel = "取消"
footerLink = "Cookie 设置"
commentsDisabled = "评论已禁用,直到您接受功能性 Cookie。"
[cookies.necessary]
title = "必要"
text = "这些 Cookie 是网站运行所必需的,无法禁用。"
[cookies.analytics]
title = "分析"
text = "这些 Cookie 帮助我们了解访问者如何与我们的网站互动。"
[cookies.functional]
title = "功能性"
text = "这些 Cookie 启用评论和嵌入内容等功能."
[pagination]
jumpToPage = "跳转到页码"
jump = "跳转"
pressEnter = "按 Enter 键跳转"