From bab83808946652fdae5044cdda5f887e63e8b677 Mon Sep 17 00:00:00 2001 From: nxxy335top Date: Wed, 20 May 2026 17:18:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0i18n=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- ...nd Preview.webp => WarmIsland Preview.webp | Bin check-all.js | 29 -- check-cm.js | 5 - check-config.js | 5 - check-form.js | 15 - check-header.js | 8 - check-hero.js | 13 - check-like-state.js | 13 - check-like.js | 17 - check-names.js | 8 - check-nav.js | 18 - check-navbar-class.js | 8 - check-raw.js | 5 - check-setting.js | 5 - check-spacing.js | 34 -- check-theme.js | 13 - check-theme2.js | 14 - click-like-debug.js | 21 -- click-like.js | 16 - docs/changelog.md | 34 +- docs/config/article.md | 56 +++ docs/config/basic.md | 16 + docs/config/style.md | 12 - docs/customize/style.md | 14 +- docs/guide/getting-started.md | 18 +- docs/guide/introduction.md | 13 +- docs/index.md | 2 +- gen-b64-all.cjs | 3 - gen-b64-all.js | 3 - gen-b64-clicklike.cjs | 3 - gen-b64-cm.cjs | 3 - gen-b64-config.cjs | 3 - gen-b64-form.cjs | 3 - gen-b64-header.cjs | 3 - gen-b64-like.cjs | 3 - gen-b64-likeapi.cjs | 3 - gen-b64-likedbg.cjs | 3 - gen-b64-likestate.cjs | 3 - gen-b64-names.cjs | 3 - gen-b64-nav.cjs | 3 - gen-b64-navclass.cjs | 3 - gen-b64-raw.cjs | 3 - gen-b64-setting.cjs | 3 - gen-b64-spacing.cjs | 3 - gen-b64-theme.cjs | 3 - gen-b64-theme2.cjs | 3 - halo-auth.json | 62 ---- i18n/default.properties | 126 +++++++ i18n/en.properties | 126 +++++++ i18n/zh_CN.properties | 126 +++++++ i18n/zh_TW.properties | 126 +++++++ public/error/404.html | 1 + public/error/500.html | 1 + settings.yaml | 66 ++-- src/components/FeaturedSection.astro | 4 +- src/components/LatestSection.astro | 10 +- src/components/MessageWallSection.astro | 2 +- src/components/MobileMenu.astro | 6 +- src/components/MomentsSection.astro | 4 +- src/components/Navbar.astro | 4 +- src/components/PhotosSection.astro | 4 +- src/components/TimelineSection.astro | 2 +- src/layouts/Layout.astro | 55 ++- src/pages/archives.astro | 18 +- src/pages/categories.astro | 6 +- src/pages/category.astro | 143 +++++++- src/pages/douban.astro | 38 +- src/pages/footprints.astro | 161 --------- src/pages/friends.astro | 16 +- src/pages/index.astro | 85 ++++- src/pages/links.astro | 8 +- src/pages/moments.astro | 24 +- src/pages/page_messageboard.astro | 6 +- src/pages/photos.astro | 24 +- src/pages/post.astro | 329 +++++++++++++++++- src/pages/steam.astro | 30 +- src/pages/tag.astro | 14 +- src/pages/tags.astro | 6 +- theme.yaml | 2 +- 80 files changed, 1363 insertions(+), 743 deletions(-) rename public/WarmIsland Preview.webp => WarmIsland Preview.webp (100%) delete mode 100644 check-all.js delete mode 100644 check-cm.js delete mode 100644 check-config.js delete mode 100644 check-form.js delete mode 100644 check-header.js delete mode 100644 check-hero.js delete mode 100644 check-like-state.js delete mode 100644 check-like.js delete mode 100644 check-names.js delete mode 100644 check-nav.js delete mode 100644 check-navbar-class.js delete mode 100644 check-raw.js delete mode 100644 check-setting.js delete mode 100644 check-spacing.js delete mode 100644 check-theme.js delete mode 100644 check-theme2.js delete mode 100644 click-like-debug.js delete mode 100644 click-like.js delete mode 100644 gen-b64-all.cjs delete mode 100644 gen-b64-all.js delete mode 100644 gen-b64-clicklike.cjs delete mode 100644 gen-b64-cm.cjs delete mode 100644 gen-b64-config.cjs delete mode 100644 gen-b64-form.cjs delete mode 100644 gen-b64-header.cjs delete mode 100644 gen-b64-like.cjs delete mode 100644 gen-b64-likeapi.cjs delete mode 100644 gen-b64-likedbg.cjs delete mode 100644 gen-b64-likestate.cjs delete mode 100644 gen-b64-names.cjs delete mode 100644 gen-b64-nav.cjs delete mode 100644 gen-b64-navclass.cjs delete mode 100644 gen-b64-raw.cjs delete mode 100644 gen-b64-setting.cjs delete mode 100644 gen-b64-spacing.cjs delete mode 100644 gen-b64-theme.cjs delete mode 100644 gen-b64-theme2.cjs delete mode 100644 halo-auth.json create mode 100644 i18n/default.properties create mode 100644 i18n/en.properties create mode 100644 i18n/zh_CN.properties create mode 100644 i18n/zh_TW.properties delete mode 100644 src/pages/footprints.astro diff --git a/README.md b/README.md index 4711697..29674c3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # WarmIsland 暖屿 -具有独特气质的生活博客主题,适用于 [Halo CMS](https://github.com/halo-dev/halo)。 +暖如灯火,静如留白。暖屿以柔和的色调和舒缓的节奏回归内容本身,为记录与阅读留出一方安静从容的角落。 > 本项目由 AI 开发完成,人工仅进行部分功能测试及问题找寻 diff --git a/public/WarmIsland Preview.webp b/WarmIsland Preview.webp similarity index 100% rename from public/WarmIsland Preview.webp rename to WarmIsland Preview.webp diff --git a/check-all.js b/check-all.js deleted file mode 100644 index 3afe097..0000000 --- a/check-all.js +++ /dev/null @@ -1,29 +0,0 @@ -(function(){ - var result = {}; - var hero = document.querySelector(".hero"); - if (hero) { - var h1 = hero.querySelector("h1"); - var subtitle = hero.querySelector(".hero-subtitle, .subtitle, h2, p"); - result.heroTitle = h1 ? h1.textContent.trim() : "no h1 found"; - result.heroSubtitle = subtitle ? subtitle.textContent.trim() : "no subtitle found"; - result.heroHTML = hero.innerHTML.substring(0, 500); - } else { - result.hero = "not found"; - } - var footer = document.querySelector("footer, .footer, #footer"); - if (footer) { - result.footerText = footer.textContent.trim().substring(0, 300); - result.footerHeight = getComputedStyle(footer).height; - result.footerMarginBottom = getComputedStyle(footer).marginBottom; - result.footerPaddingBottom = getComputedStyle(footer).paddingBottom; - } else { - result.footer = "not found"; - } - var body = document.body; - result.bodyMarginBottom = getComputedStyle(body).marginBottom; - result.bodyPaddingBottom = getComputedStyle(body).paddingBottom; - result.htmlMarginBottom = getComputedStyle(document.documentElement).marginBottom; - result.documentHeight = document.documentElement.scrollHeight; - result.windowHeight = window.innerHeight; - return JSON.stringify(result); -})() diff --git a/check-cm.js b/check-cm.js deleted file mode 100644 index c2e4d79..0000000 --- a/check-cm.js +++ /dev/null @@ -1,5 +0,0 @@ -(function(){ - return fetch('/apis/api.console.halo.run/v1alpha1/configmaps/warm-island-config') - .then(r => r.text()) - .then(data => data.substring(0, 3000)); -})() diff --git a/check-config.js b/check-config.js deleted file mode 100644 index c6e9ab5..0000000 --- a/check-config.js +++ /dev/null @@ -1,5 +0,0 @@ -(function(){ - return fetch('/apis/api.console.halo.run/v1alpha1/themes/warm-island/config') - .then(r => r.text()) - .then(data => data.substring(0, 2000)); -})() diff --git a/check-form.js b/check-form.js deleted file mode 100644 index bb383db..0000000 --- a/check-form.js +++ /dev/null @@ -1,15 +0,0 @@ -(function(){ - var selects = document.querySelectorAll('select'); - var result = []; - selects.forEach(function(s, i) { - result.push({index: i, value: s.value, name: s.name, options: Array.from(s.options).map(function(o){return o.value + ':' + o.text})}); - }); - var inputs = document.querySelectorAll('input'); - var inputResult = []; - inputs.forEach(function(inp, i) { - if (inp.type !== 'hidden') { - inputResult.push({index: i, type: inp.type, name: inp.name, value: inp.value}); - } - }); - return JSON.stringify({selects: result, inputs: inputResult.slice(0, 10)}); -})() diff --git a/check-header.js b/check-header.js deleted file mode 100644 index 8574435..0000000 --- a/check-header.js +++ /dev/null @@ -1,8 +0,0 @@ -(function(){ - var header = document.querySelector('header'); - if (!header) return JSON.stringify({header: "not found"}); - return JSON.stringify({ - className: header.className, - innerHTML: header.innerHTML.substring(0, 500) - }); -})() diff --git a/check-hero.js b/check-hero.js deleted file mode 100644 index bf1daa0..0000000 --- a/check-hero.js +++ /dev/null @@ -1,13 +0,0 @@ -(function(){ - var h = document.querySelector(".hero"); - if (!h) return "No .hero element found"; - var s = getComputedStyle(h); - return JSON.stringify({ - width: s.width, - marginLeft: s.marginLeft, - marginTop: s.marginTop, - paddingTop: s.paddingTop, - left: s.left, - position: s.position - }); -})() diff --git a/check-like-state.js b/check-like-state.js deleted file mode 100644 index 64af601..0000000 --- a/check-like-state.js +++ /dev/null @@ -1,13 +0,0 @@ -(function(){ - var likeBtn = document.querySelector('.wi-like-btn'); - if (!likeBtn) return JSON.stringify({likeBtn: "not found"}); - var likeContainer = likeBtn.closest('.wi-post__like'); - return JSON.stringify({ - btnClass: likeBtn.className, - btnDisabled: likeBtn.disabled, - containerClass: likeContainer ? likeContainer.className : "none", - text: likeContainer ? likeContainer.textContent.trim() : likeBtn.textContent.trim(), - liked: likeBtn.classList.contains('wi-like-btn--liked') || (likeContainer && likeContainer.classList.contains('wi-post__like--liked')), - svgFill: likeBtn.querySelector('svg') ? getComputedStyle(likeBtn.querySelector('svg')).fill : "none" - }); -})() diff --git a/check-like.js b/check-like.js deleted file mode 100644 index 4dc3c0e..0000000 --- a/check-like.js +++ /dev/null @@ -1,17 +0,0 @@ -(function(){ - var likeBtn = document.querySelector('.like-btn, .wi-like, [class*="like"], [class*="heart"]'); - if (!likeBtn) { - var buttons = document.querySelectorAll('button'); - var result = []; - buttons.forEach(function(b, i) { - result.push({index: i, text: b.textContent.trim(), className: b.className, innerHTML: b.innerHTML.substring(0, 200)}); - }); - return JSON.stringify({likeBtn: "not found", buttons: result}); - } - return JSON.stringify({ - className: likeBtn.className, - text: likeBtn.textContent.trim(), - innerHTML: likeBtn.innerHTML.substring(0, 300), - ariaLabel: likeBtn.getAttribute('aria-label') - }); -})() diff --git a/check-names.js b/check-names.js deleted file mode 100644 index fc84a9c..0000000 --- a/check-names.js +++ /dev/null @@ -1,8 +0,0 @@ -(function(){ - return fetch('/apis/api.console.halo.run/v1alpha1/themes/warm-island') - .then(r => r.json()) - .then(data => JSON.stringify({ - settingName: data.spec.settingName, - configMapName: data.spec.configMapName - })); -})() diff --git a/check-nav.js b/check-nav.js deleted file mode 100644 index 5976424..0000000 --- a/check-nav.js +++ /dev/null @@ -1,18 +0,0 @@ -(function(){ - var nav = document.querySelector("nav, .navbar, .nav, header nav, .header-nav"); - if (!nav) return JSON.stringify({nav: "not found"}); - var s = getComputedStyle(nav); - var parent = nav.parentElement; - var ps = parent ? getComputedStyle(parent) : null; - return JSON.stringify({ - navClass: nav.className, - navWidth: s.width, - navMargin: s.margin, - navBorderRadius: s.borderRadius, - navBorder: s.border, - navPadding: s.padding, - parentClass: parent ? parent.className : "none", - parentWidth: ps ? ps.width : "none", - parentBorderRadius: ps ? ps.borderRadius : "none" - }); -})() diff --git a/check-navbar-class.js b/check-navbar-class.js deleted file mode 100644 index 4fdee97..0000000 --- a/check-navbar-class.js +++ /dev/null @@ -1,8 +0,0 @@ -(function(){ - var navbar = document.querySelector('.wi-navbar'); - if (!navbar) return JSON.stringify({navbar: "not found"}); - return JSON.stringify({ - className: navbar.className, - allClasses: navbar.className - }); -})() diff --git a/check-raw.js b/check-raw.js deleted file mode 100644 index 36f20af..0000000 --- a/check-raw.js +++ /dev/null @@ -1,5 +0,0 @@ -(function(){ - return fetch('/apis/api.console.halo.run/v1alpha1/themes/warm-island') - .then(r => r.text()) - .then(data => data.substring(0, 2000)); -})() diff --git a/check-setting.js b/check-setting.js deleted file mode 100644 index c5c5a3a..0000000 --- a/check-setting.js +++ /dev/null @@ -1,5 +0,0 @@ -(function(){ - return fetch('/apis/api.console.halo.run/v1alpha1/themes/warm-island/setting') - .then(r => r.text()) - .then(data => data.substring(0, 1000)); -})() diff --git a/check-spacing.js b/check-spacing.js deleted file mode 100644 index d791e24..0000000 --- a/check-spacing.js +++ /dev/null @@ -1,34 +0,0 @@ -(function(){ - var result = {}; - var h1 = document.querySelector('h1'); - var content = document.querySelector('.wi-post__content, .post-content, article, .content'); - if (h1 && content) { - var h1Rect = h1.getBoundingClientRect(); - var contentRect = content.getBoundingClientRect(); - result.titleBottom = h1Rect.bottom; - result.contentTop = contentRect.top; - result.gap = contentRect.top - h1Rect.bottom; - } else { - result.h1Found = !!h1; - result.contentFound = !!content; - if (h1) { - var nextEl = h1.nextElementSibling; - result.nextElTag = nextEl ? nextEl.tagName : "none"; - result.nextElClass = nextEl ? nextEl.className : "none"; - var h1Rect = h1.getBoundingClientRect(); - if (nextEl) { - var nextRect = nextEl.getBoundingClientRect(); - result.gap = nextRect.top - h1Rect.bottom; - } - } - } - var footer = document.querySelector("footer, .footer, #footer"); - if (footer) { - var footerRect = footer.getBoundingClientRect(); - result.footerBottom = footerRect.bottom; - result.windowHeight = window.innerHeight; - result.spaceBelowFooter = window.innerHeight - footerRect.bottom; - result.docHeight = document.documentElement.scrollHeight; - } - return JSON.stringify(result); -})() diff --git a/check-theme.js b/check-theme.js deleted file mode 100644 index 021cf41..0000000 --- a/check-theme.js +++ /dev/null @@ -1,13 +0,0 @@ -(function(){ - return fetch('/apis/api.console.halo.run/v1alpha1/themes?sort=creationTimestamp%2Cdesc') - .then(r => r.json()) - .then(data => { - var items = data.items || []; - var result = items.map(t => ({ - name: t.metadata.name, - displayName: t.spec.displayName, - active: !!t.spec.activationTime - })); - return JSON.stringify(result); - }); -})() diff --git a/check-theme2.js b/check-theme2.js deleted file mode 100644 index 0c6221c..0000000 --- a/check-theme2.js +++ /dev/null @@ -1,14 +0,0 @@ -(function(){ - return fetch('/apis/api.console.halo.run/v1alpha1/themes?sort=creationTimestamp%2Cdesc') - .then(r => r.json()) - .then(data => { - var items = data.items || []; - var result = items.map(t => ({ - name: t.metadata.name, - displayName: t.spec.displayName, - active: t.spec.activationTime, - allKeys: Object.keys(t.spec) - })); - return JSON.stringify(result); - }); -})() diff --git a/click-like-debug.js b/click-like-debug.js deleted file mode 100644 index 274b9ae..0000000 --- a/click-like-debug.js +++ /dev/null @@ -1,21 +0,0 @@ -(function(){ - var btn = document.querySelector('.wi-like-btn'); - if (!btn) return JSON.stringify({error: "no btn"}); - var origFetch = window.fetch; - var lastRequest = null; - window.fetch = function() { - lastRequest = {url: arguments[0], options: arguments[1]}; - return origFetch.apply(this, arguments); - }; - btn.click(); - return new Promise(function(resolve){ - setTimeout(function(){ - resolve(JSON.stringify({ - lastRequest: lastRequest, - btnClass: btn.className, - liked: btn.classList.contains('wi-like-btn--liked'), - text: btn.closest('.wi-post__like').textContent.trim() - })); - }, 3000); - }); -})() diff --git a/click-like.js b/click-like.js deleted file mode 100644 index 177f737..0000000 --- a/click-like.js +++ /dev/null @@ -1,16 +0,0 @@ -(function(){ - var btn = document.querySelector('.wi-like-btn'); - if (!btn) return "no btn"; - btn.click(); - return new Promise(function(resolve){ - setTimeout(function(){ - var container = btn.closest('.wi-post__like'); - resolve(JSON.stringify({ - btnClass: btn.className, - btnDisabled: btn.disabled, - text: container ? container.textContent.trim() : btn.textContent.trim(), - liked: btn.classList.contains('wi-like-btn--liked') - })); - }, 2000); - }); -})() diff --git a/docs/changelog.md b/docs/changelog.md index 44dea3d..db642c3 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -4,6 +4,8 @@ 首次发布 🎉 +- 🗑️ 移除侧边栏功能 + ### 核心功能 - 🎨 暖色调设计语言,呼吸动效光球、毛玻璃导航栏 @@ -11,6 +13,23 @@ - 📱 响应式布局,移动端专属菜单与交互体验 - ✨ 滚动渐入动画、光感跟随效果 +### SEO 与结构化数据 + +- 🔍 Open Graph 元标签,优化社交媒体分享预览 +- 📋 JSON-LD 结构化数据,提升搜索引擎理解与展示 + +### 国际化 + +- 🌐 i18n 国际化支持(简体中文、繁体中文、英语) +- 🔄 跟随浏览器语言自动匹配,也可手动指定 + +### 文章页增强 + +- 📑 目录展开模式选项(仅展开当前分组 / 全部展开) +- 📰 相关文章推荐,帮助读者发现更多内容 +- 🔗 分享功能(微博 / X / Facebook / Telegram / 复制链接) +- 🖼️ 图片懒加载 blur-up 效果,优化加载体验 + ### 页面模板 - 🏠 Hero 首屏(一言 API / 自定义描述 / 背景图片) @@ -30,14 +49,19 @@ - 🎯 三种导航栏样式(Glass / Minimal / Float) - 🌓 主题切换按钮 +### 性能与体验 + +- ⚡ preconnect / dns-prefetch 资源提示,优化外部资源加载 +- 🖼️ 图片懒加载 blur-up 渐显效果 +- 🔤 移除自定义字体和内置字体功能,使用系统默认字体栈,提升加载速度 + +### 错误页面 + +- 🐘 404 / 500 错误页增强(导航栏 + 页脚),方便访客返回 + ### 配置与自定义 - ⚙️ 丰富的主题设置面板(13 个配置分组) - 🎨 可自定义强调色、圆角风格、容器宽度 - 📝 自定义 CSS 支持 - 🔧 页脚社交链接和自定义 HTML - -### 错误页面 - -- 🐘 404 页面 -- 🐘 500 页面 diff --git a/docs/config/article.md b/docs/config/article.md index d7073fc..98ef190 100644 --- a/docs/config/article.md +++ b/docs/config/article.md @@ -17,6 +17,11 @@ | `article_show_visit_count` | 开关 | `true` | 显示阅读量统计 | | `article_show_read_time` | 开关 | `false` | 显示预计阅读时间 | | `article_code_theme` | 下拉 | `warm` | 代码高亮主题:`warm` / `cold` | +| `article_toc_expand` | 下拉 | `active` | 目录展开模式:`active` / `all` | +| `article_show_related` | 开关 | `false` | 显示相关文章推荐 | +| `article_related_title` | 文本 | `相关推荐` | 相关文章标题 | +| `article_show_share` | 开关 | `true` | 显示分享按钮 | +| `article_share_title` | 文本 | `分享` | 分享区域标题 | ## 详细说明 @@ -98,6 +103,57 @@ article_code_theme: warm 代码高亮支持多种编程语言,包括 JavaScript、Python、Java、Go、Rust、YAML、JSON、Bash 等。语言检测基于代码块的语言标记自动完成。 ::: +### 目录展开模式(article_toc_expand) + +控制文章目录的展开方式: + +| 值 | 说明 | +| --- | --- | +| `active` | 仅展开当前阅读位置所在的分组,其余分组折叠(默认) | +| `all` | 全部展开,显示所有层级的目录项 | + +::: tip +对于标题层级较多的长文,推荐使用 `active` 模式,可以让读者更聚焦于当前章节。对于短文或标题层级较少的文章,`all` 模式可以一次性展示完整目录结构。 +::: + +### 相关文章推荐(article_show_related) + +开启后,文章底部会显示相关文章推荐列表,帮助读者发现更多感兴趣的内容。相关文章基于 Halo 的随机推荐算法选取。 + +#### 相关文章标题(article_related_title) + +自定义相关文章推荐区域的标题文字,默认为「相关推荐」。仅在 `article_show_related` 开启时显示此配置项。 + +```yaml +article_show_related: true +article_related_title: "猜你喜欢" +``` + +### 分享功能(article_show_share) + +开启后,文章底部会显示分享按钮,支持以下社交平台: + +| 平台 | 说明 | +| --- | --- | +| 微博 | 分享到新浪微博 | +| X (Twitter) | 分享到 X | +| Facebook | 分享到 Facebook | +| Telegram | 分享到 Telegram | +| 复制链接 | 复制文章链接到剪贴板 | + +#### 分享区域标题(article_share_title) + +自定义分享区域的标题文字,默认为「分享」。仅在 `article_show_share` 开启时显示此配置项。 + +```yaml +article_show_share: true +article_share_title: "分享这篇文章" +``` + +::: tip +分享功能会自动携带文章标题和链接,无需手动配置分享内容。移动端会优先显示适合移动端的分享方式。 +::: + ## 阅读增强功能 除了可配置的项目外,文章详情页还包含以下内置功能: diff --git a/docs/config/basic.md b/docs/config/basic.md index a3d1bb0..d1ee152 100644 --- a/docs/config/basic.md +++ b/docs/config/basic.md @@ -13,6 +13,7 @@ | `label_search` | 文本 | `搜索` | 搜索按钮的标签文案 | | `label_theme_switch` | 文本 | `切换主题` | 主题切换按钮的标签文案 | | `label_archives_title` | 文本 | `归档` | 归档页面的标题文案 | +| `language` | 下拉 | `auto` | 主题界面语言 | ## 详细说明 @@ -72,6 +73,21 @@ label_archives_title: "Archives" 标签文案的修改会即时生效,无需重启 Halo。如果使用多语言场景,可以配合 Halo 的多语言插件实现更完整的国际化。 ::: +### 语言(language) + +设置主题界面的显示语言,影响导航栏、文章页、错误页等所有主题内置文案。提供以下选项: + +| 值 | 说明 | +| --- | --- | +| `auto` | 跟随浏览器语言自动匹配(默认) | +| `zh_CN` | 简体中文 | +| `zh_TW` | 繁體中文 | +| `en` | English | + +::: tip +选择 `auto` 时,主题会根据访客浏览器的语言设置自动匹配最接近的语言。如果浏览器语言不在支持列表中,将回退到简体中文。 +::: + ## 相关页面 - [样式设置](/config/style) — 调整配色、圆角、动画等视觉表现 diff --git a/docs/config/style.md b/docs/config/style.md index b876fe2..21af03a 100644 --- a/docs/config/style.md +++ b/docs/config/style.md @@ -10,7 +10,6 @@ | `accent_color` | 颜色 | `#d4764e` | 全局强调色 | | `border_radius` | 下拉 | `medium` | 圆角风格:`small` / `medium` / `large` | | `layout_container_width` | 下拉 | `medium` | 容器宽度:`narrow` / `medium` / `wide` | -| `layout_sidebar` | 开关 | `false` | 启用侧边栏(开发中) | | `animation_enabled` | 开关 | `true` | 全局动画总开关 | | `animation_breath` | 开关 | `true` | 呼吸动画效果 | | `animation_scroll_reveal` | 开关 | `true` | 滚动渐入动画 | @@ -79,12 +78,6 @@ accent_color: "#8b5cf6" # 紫罗兰 | `medium` | 中等宽度,兼顾阅读体验与信息密度(默认) | | `wide` | 宽容器,适合图片较多的站点或需要更大展示空间的场景 | -### 侧边栏(layout_sidebar) - -::: danger -侧边栏功能目前仍在开发中,此选项暂不可用。开启后不会产生实际效果,请关注后续版本更新。 -::: - ### 动画效果 WarmIsland 提供了丰富的动画效果,所有动画都可以独立开关: @@ -118,11 +111,6 @@ WarmIsland 提供了丰富的动画效果,所有动画都可以独立开关: 在此处编写自定义 CSS 代码,会注入到全站所有页面的 ` - - - - - - - + + + + + + + + + + +
{home ? ( @@ -124,4 +154,11 @@ html.wi-no-animations .wi-reveal { transform: none; transition: none; } + +.wi-post__content img { + max-width: 100%; + height: auto; +} + + diff --git a/src/pages/archives.astro b/src/pages/archives.astro index 2c092b6..3c4fbfc 100644 --- a/src/pages/archives.astro +++ b/src/pages/archives.astro @@ -4,14 +4,14 @@ import Layout from "../layouts/Layout.astro"; - +
-

归档

+

归档

-

+

@@ -57,8 +57,8 @@ import Layout from "../layouts/Layout.astro";
暂无文章。
+ th:text="${theme.config?.home?.home_label_no_posts ?: #messages.msg('common.noPosts')}" + >No posts yet.
diff --git a/src/pages/categories.astro b/src/pages/categories.astro index fe2100e..99deaf0 100644 --- a/src/pages/categories.astro +++ b/src/pages/categories.astro @@ -4,14 +4,14 @@ import Layout from "../layouts/Layout.astro"; - +
-

分类

+

分类

-

+

@@ -97,6 +128,90 @@ import Layout from "../layouts/Layout.astro"; line-height: var(--leading-normal); } + .wi-category__list { + list-style: none; + margin: 0; + padding: 0; + display: grid; + gap: var(--space-lg); + } + + .wi-category__entry { + border-bottom: 1px dashed var(--rule); + transition: background var(--duration-fast) var(--ease-out-quart); + } + + .wi-category__entry:last-child { + border-bottom: none; + } + + .wi-category__entry:hover { + background: var(--bg-raised); + margin: 0 calc(-1 * var(--space-md)); + padding-left: var(--space-md); + padding-right: var(--space-md); + border-radius: var(--radius-sm); + } + + .wi-category__entry-link { + display: grid; + grid-template-columns: minmax(0, 1fr) 200px; + gap: var(--space-lg); + padding: var(--space-lg) 0; + text-decoration: none; + color: inherit; + align-items: start; + } + + .wi-category__entry-body { + display: grid; + gap: 0.35rem; + } + + .wi-category__entry-date { + color: var(--ink-3); + font-size: var(--text-sm); + font-variant-numeric: tabular-nums; + } + + .wi-category__entry-title { + font-family: var(--font-sans); + font-size: var(--text-lg); + font-weight: 600; + color: var(--ink); + line-height: var(--leading-snug); + margin: 0.25rem 0; + transition: color var(--duration-fast) var(--ease-out-quart); + } + + .wi-category__entry-link:hover .wi-category__entry-title { + color: var(--accent); + } + + .wi-category__entry-excerpt { + margin: 0; + font-size: var(--text-sm); + color: var(--ink-2); + line-height: var(--leading-normal); + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + overflow: hidden; + } + + .wi-category__entry-image { + width: 200px; + height: 140px; + object-fit: cover; + border-radius: var(--radius-sm); + align-self: center; + transition: transform var(--duration-fast) var(--ease-out-quart); + } + + .wi-category__entry:hover .wi-category__entry-image { + transform: scale(1.02); + } + .wi-category__empty { color: var(--ink-3); font-size: var(--text-md); @@ -127,4 +242,16 @@ import Layout from "../layouts/Layout.astro"; .wi-category__page-info { color: var(--ink-3); } + + @media (max-width: 768px) { + .wi-category__entry-link { + grid-template-columns: 1fr; + } + + .wi-category__entry-image { + width: 100%; + height: 180px; + order: -1; + } + } diff --git a/src/pages/douban.astro b/src/pages/douban.astro index c46d722..31eb449 100644 --- a/src/pages/douban.astro +++ b/src/pages/douban.astro @@ -10,7 +10,7 @@ import Layout from "../layouts/Layout.astro";
-

豆瓣

+

Douban

@@ -32,63 +32,63 @@ import Layout from "../layouts/Layout.astro"; class="wi-douban__filter-tag wi-douban__filter-tag--sm" th:href="@{/douban(type=${currentType},status='wish')}" th:classappend="${hasStatus and currentStatus == 'wish'} ? 'wi-douban__filter-tag--active' : ''" - >想看 + th:text="#{douban.wish}">Wish 看过 + th:text="#{douban.done}">Done 想读 + th:text="#{douban.wishRead}">Wish 在读 + th:text="#{douban.reading}">Reading 读过 + th:text="#{douban.done}">Done 想听 + th:text="#{douban.wishListen}">Wish 在听 + th:text="#{douban.listening}">Listening 听过 + th:text="#{douban.listened}">Listened 想玩 + th:text="#{douban.wishPlay}">Wish 在玩 + th:text="#{douban.playing}">Playing 玩过 + th:text="#{douban.played}">Played
@@ -120,6 +120,7 @@ import Layout from "../layouts/Layout.astro"; class="wi-douban__card" th:each="item : ${doubans.items}" th:if="${!hasGenre or #sets.contains(item.spec?.genres, currentGenre)}" + th:attr="data-type=${currentType}" > - 我的: + My: diff --git a/src/pages/footprints.astro b/src/pages/footprints.astro deleted file mode 100644 index 00120e5..0000000 --- a/src/pages/footprints.astro +++ /dev/null @@ -1,161 +0,0 @@ ---- -import Navbar from "../components/Navbar.astro"; -import MobileMenu from "../components/MobileMenu.astro"; -import "../styles/main.scss"; ---- - - - - - - - - - - - - - - - - - - - - -
-
- -
-

足迹2024

-

每一处足迹都充满了故事,那是对人生的思考和无限的风光。

-
- -
-
- - -
- -
- - - -
- -
- - -
- -
-
- 1000 公里 -
-
-
- - - - diff --git a/src/pages/friends.astro b/src/pages/friends.astro index 6b15a5a..0ee0dd2 100644 --- a/src/pages/friends.astro +++ b/src/pages/friends.astro @@ -4,7 +4,7 @@ import Layout from "../layouts/Layout.astro"; - +

- 朋友圈 + Friends Circle

@@ -87,8 +87,9 @@ import Layout from "../layouts/Layout.astro"; th:if="${friends.hasPrevious()}" th:href="@{${friends.prevUrl}}" class="wi-friends-page__page-link" + th:text="#{common.newer}" > - ← 上一页 + ← Newer
- 下一页 → + Older → @@ -111,11 +113,11 @@ import Layout from "../layouts/Layout.astro"; >
-

朋友圈

+

Friends Circle

-

朋友圈功能需要安装「朋友圈」插件,前往应用市场安装

+

This feature requires the Friends Circle plugin

diff --git a/src/pages/index.astro b/src/pages/index.astro index 685b359..67c661d 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -13,6 +13,7 @@ import HeroSection from "../components/HeroSection.astro";
-

置顶

+

置顶

-

文章

+

文章

- 阅读 + 阅读
@@ -152,7 +153,7 @@ import HeroSection from "../components/HeroSection.astro"; th:if="${posts.hasPrevious()}" th:href="@{${posts.prevUrl}}" class="wi-pagination__prev" - th:text="${theme.config?.home?.home_label_newer ?: '较新'}" + th:text="${theme.config?.home?.home_label_newer ?: #messages.msg('common.newer')}" >← 较新
较旧 →
- 加载中... + 加载中...
@@ -181,7 +182,7 @@ import HeroSection from "../components/HeroSection.astro"; th:if="${!posts.hasNext() and posts.totalPages gt 1 and theme.config?.home?.home_post_loading == 'infinite_scroll'}" class="wi-infinite-scroll__end" > - 已加载全部文章 + 已加载全部文章
@@ -194,9 +195,10 @@ import HeroSection from "../components/HeroSection.astro"; if (!sentinel) return; var grid = document.getElementById("wi-post-grid"); + var i18nEl = document.querySelector(".wi-home-content"); var loading = false; var nextUrl = sentinel.getAttribute("data-next-url"); - var allLoadedText = sentinel.getAttribute("data-all-loaded-text") || "已加载全部文章"; + var allLoadedText = sentinel.getAttribute("data-all-loaded-text") || (i18nEl && i18nEl.getAttribute("data-i18n-all-loaded")) || "All posts loaded"; var observer = new IntersectionObserver( function (entries) { @@ -302,6 +304,71 @@ import HeroSection from "../components/HeroSection.astro"; })(); + +