hexo-theme-stellar 1.40.0 → 1.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/_config.yml +33 -10
  3. package/_data/icons.yml +250 -37
  4. package/languages/en.yml +6 -0
  5. package/languages/zh-CN.yml +6 -0
  6. package/languages/zh-TW.yml +6 -0
  7. package/layout/_partial/comments/artalk/script.ejs +25 -8
  8. package/layout/_partial/comments/beaudar/script.ejs +1 -0
  9. package/layout/_partial/comments/twikoo/script.ejs +1 -0
  10. package/layout/_partial/comments/utterances/script.ejs +1 -0
  11. package/layout/_partial/comments/waline/script.ejs +1 -0
  12. package/layout/_partial/head.ejs +43 -7
  13. package/layout/_partial/main/article/article_tags.ejs +16 -0
  14. package/layout/_partial/main/navbar/article_banner.ejs +11 -1
  15. package/layout/_partial/main/notebook/note_card.ejs +1 -1
  16. package/layout/_partial/main/notebook/paginator.ejs +2 -2
  17. package/layout/_partial/main/pin_slider.ejs +2 -2
  18. package/layout/_partial/main/post_list/paginator.ejs +2 -2
  19. package/layout/_partial/menubtn.ejs +2 -2
  20. package/layout/_partial/scripts/defines.ejs +26 -2
  21. package/layout/_partial/scripts.ejs +30 -7
  22. package/layout/_partial/sidebar/logo.ejs +1 -1
  23. package/layout/_partial/sidebar/menu.ejs +1 -1
  24. package/layout/_partial/sidebar/search.ejs +1 -1
  25. package/layout/_partial/widgets/author.ejs +1 -1
  26. package/layout/_partial/widgets/components/link.ejs +2 -2
  27. package/layout/_partial/widgets/ghuser.ejs +1 -1
  28. package/layout/_partial/widgets/related.ejs +1 -1
  29. package/layout/_partial/widgets/toc.ejs +1 -1
  30. package/layout/_partial/widgets/tree.ejs +1 -1
  31. package/layout/_plugins/fancybox.ejs +4 -2
  32. package/layout/_plugins/mermaid.ejs +2 -1
  33. package/layout/_plugins/search/local_search.ejs +4 -3
  34. package/layout/_plugins/swiper.ejs +1 -0
  35. package/layout/categories.ejs +1 -1
  36. package/layout/page.ejs +3 -0
  37. package/layout/tags.ejs +1 -0
  38. package/package.json +1 -1
  39. package/scripts/events/lib/doc_tree.js +12 -208
  40. package/scripts/events/lib/notebooks.js +8 -148
  41. package/scripts/events/lib/utils.js +10 -1
  42. package/scripts/filters/index.js +1 -0
  43. package/scripts/filters/lib/img_lazyload.js +4 -0
  44. package/scripts/filters/lib/img_onerror.js +4 -0
  45. package/scripts/filters/lib/md_table.js +46 -0
  46. package/scripts/generators/search.js +12 -18
  47. package/scripts/generators/stellar-icons.js +47 -0
  48. package/scripts/helpers/ai_label.js +29 -0
  49. package/scripts/helpers/icon.js +2 -2
  50. package/scripts/helpers/json_ld.js +10 -13
  51. package/scripts/helpers/related_posts.js +0 -7
  52. package/scripts/helpers/seo.js +9 -0
  53. package/scripts/lib/ai_label.js +55 -0
  54. package/scripts/lib/doc_tree.js +267 -0
  55. package/scripts/lib/notebooks.js +181 -0
  56. package/scripts/lib/search_index.js +82 -0
  57. package/scripts/lib/seo.js +79 -0
  58. package/scripts/tags/lib/about.js +2 -2
  59. package/scripts/tags/lib/albums.js +1 -1
  60. package/scripts/tags/lib/banner.js +1 -1
  61. package/scripts/tags/lib/chat.js +49 -49
  62. package/scripts/tags/lib/copy.js +1 -1
  63. package/scripts/tags/lib/friends.js +1 -1
  64. package/scripts/tags/lib/gallery.js +1 -1
  65. package/scripts/tags/lib/hashtag.js +1 -1
  66. package/scripts/tags/lib/image.js +3 -3
  67. package/scripts/tags/lib/posters.js +1 -1
  68. package/scripts/tags/lib/sites.js +2 -2
  69. package/source/css/_common/base.styl +5 -9
  70. package/source/css/_common/device.styl +3 -3
  71. package/source/css/_components/md-table.styl +23 -0
  72. package/source/css/_components/pages/archives.styl +2 -22
  73. package/source/css/_components/pages/article-story.styl +4 -4
  74. package/source/css/_components/partial/article-tags.styl +10 -0
  75. package/source/css/_components/partial/bread-nav.styl +14 -0
  76. package/source/css/_components/partial/navbar.styl +10 -2
  77. package/source/css/_components/sidebar/search.styl +24 -4
  78. package/source/css/_components/tag-plugins/table.styl +16 -11
  79. package/source/css/_components/widgets/components.styl +6 -0
  80. package/source/css/_components/widgets/list.styl +6 -0
  81. package/source/css/_components/widgets/toc.styl +1 -1
  82. package/source/css/_custom.styl +1 -12
  83. package/source/css/_defines/func.styl +28 -3
  84. package/source/css/_plugins/index.styl +0 -18
  85. package/source/css/{_plugins/comments → comments}/artalk.styl +4 -0
  86. package/source/css/{_plugins/comments → comments}/twikoo.styl +4 -0
  87. package/source/css/{_plugins → plugins}/mermaid.styl +3 -0
  88. package/source/css/{_plugins → plugins}/swiper.styl +5 -1
  89. package/source/js/icons.js +60 -0
  90. package/source/js/main.js +114 -0
  91. package/source/js/search/highlight.js +82 -0
  92. package/source/js/search/local-search.js +294 -103
  93. package/source/js/services/timeline.js +1 -1
  94. package/source/js/services/weibo.js +3 -3
  95. package/source/js/services.js +179 -0
  96. package/source/js/tagtree.js +29 -0
  97. package/source/js/theme.js +61 -0
  98. package/{layout/_partial/scripts/utils.ejs → source/js/utils.js} +13 -10
  99. package/layout/_partial/scripts/services.ejs +0 -178
  100. package/layout/_partial/scripts/sidebar.ejs +0 -25
  101. package/layout/_partial/scripts/tagtree.ejs +0 -29
  102. package/layout/_partial/scripts/theme.ejs +0 -67
  103. /package/source/css/{_plugins/comments → comments}/beaudar.styl +0 -0
  104. /package/source/css/{_plugins/comments → comments}/utterances.styl +0 -0
  105. /package/source/css/{_plugins/comments → comments}/waline.styl +0 -0
  106. /package/source/css/{_plugins → plugins}/fancybox.styl +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.41.0
4
+
5
+ > 发布日期:2026-08-15
6
+
7
+ ### 新功能
8
+ - 本地搜索:搜索结果按章节拆分展示,点击直达章节锚点,目标页自动高亮关键词(`?kw=` 定位)
9
+ - 本地搜索:懒加载与缓存 TTL(`search.local_search.lazy_load` 默认开启、`cache_ttl` 默认 1 天)
10
+ - navbar 未吸顶时采用卡片样式,吸顶后恢复玻璃效果
11
+ - 文章末尾新增标签行(`article.tags`,默认开启)
12
+ - 内容表格统一铺满滚动与圆角边框
13
+ - 文章新增 AI 成分标签(front-matter `ai_label: manual | polished | generated | reviewed`,`article.ai_label` 配置文案与颜色,默认不渲染)
14
+
15
+ ### 修复
16
+ - 移动端顶栏伸缩时 navbar 玻璃效果误消失
17
+ - 导航激活指示改为纯 CSS 小圆点,修复异步图标替换引起的抖动/闪烁
18
+ - 恢复标题锚点等页内链接平滑滚动
19
+ - 评论表情面板图片不再误触发 fancybox 弹窗
20
+ - 修正 toc 底部操作按钮分隔线选择器
21
+ - 修复 artalk 邮件链接无法定位评论区
22
+ - SEO 元数据修复:wiki 标题去重、`og:site_name`、JSON-LD 图片/描述回退、分页标题
23
+
24
+ ### 样式
25
+ - 调整 navbar 与 float-panel 按钮尺寸与间距(40px、gap 4px、底部 inset ×1)
26
+
27
+ ### 性能
28
+ - 按需加载与外置缓存优化,减小 html/css/js 体积
29
+ - 图标按命名空间异步加载,首屏关键图标保持内联
30
+ - 构建期脚本去重遍历与过滤器短路(generate 阶段优化)
31
+
32
+ ### 重构
33
+ - 主题内置图标统一迁移到 `_data/icons.yml`
34
+ - 图标键统一为语义化命名空间(`default:` / 标签名命名空间),消除 `solar:`、`ph:`、`bxs:` 前缀
35
+
36
+ ### 升级注意(配置变更与破坏性改动)
37
+ - 新增 `article.tags`(默认 `true`):文章末尾显示标签行,不需要时设为 `false`
38
+ - 新增 `article.ai_label` 与 front-matter `ai_label` 字段:不设置时不渲染,历史文章零变化
39
+ - 新增 `search.local_search.lazy_load`(默认 `true`)与 `cache_ttl`(默认 `86400`)
40
+ - 破坏性变更:图标键为公开接口,`solar:*` 等旧前缀键已全部改名;站点若在 `source/_data/icons.yml` 覆盖或 `_config.stellar.yml` 引用旧键需同步改名(主工程已确认无此类覆盖)
41
+
42
+ Full Changelog: [1.40.0...1.41.0](https://github.com/xaoxuu/hexo-theme-stellar/compare/1.40.0...1.41.0)
43
+
3
44
  ## 1.40.0
4
45
 
5
46
  > 发布日期:2026-08-14
package/_config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  ######## Stellar info ########
2
2
  stellar:
3
- version: '1.40.0'
3
+ version: '1.41.0'
4
4
  homepage: 'https://xaoxuu.com/wiki/stellar/'
5
5
  repo: 'https://github.com/xaoxuu/hexo-theme-stellar'
6
6
  main_css: /css/main.css
@@ -46,22 +46,22 @@ menubar:
46
46
  # url: 点击跳转到哪,支持相对路径和绝对路径
47
47
  # - id: post
48
48
  # theme: '#1BCDFC'
49
- # icon: solar:documents-bold-duotone
49
+ # icon: default:documents
50
50
  # title: 博客
51
51
  # url: /
52
52
  # - id: wiki
53
53
  # theme: '#3DC550'
54
- # icon: solar:notebook-bookmark-bold-duotone
54
+ # icon: example:notebook
55
55
  # title: 文档
56
56
  # url: /wiki/
57
57
  # - id: explore
58
58
  # theme: '#FA6400'
59
- # icon: solar:planet-bold-duotone
59
+ # icon: example:planet
60
60
  # title: 探索
61
61
  # url: /explore/
62
62
  # - id: social
63
63
  # theme: '#F44336'
64
- # icon: solar:chat-square-like-bold-duotone
64
+ # icon: example:chat
65
65
  # title: 社交
66
66
  # url: /friends/
67
67
 
@@ -159,7 +159,7 @@ notebook:
159
159
  auto_excerpt: 128
160
160
  # 可以为某个 tag 设定图标(显示在标签树中)。
161
161
  tagcons:
162
- '': solar:hashtag-square-bold
162
+ '': quot:hashtag
163
163
  # 每页显示多少篇笔记。0 表示不分页,null 则 fallback 到 hexo 的配置。
164
164
  # 可以在笔记本 yaml 的 per_page 字段中覆盖此参数。
165
165
  per_page: null
@@ -197,6 +197,23 @@ article:
197
197
  # 分类颜色
198
198
  category_color:
199
199
  '探索号': '#f44336'
200
+ # 文章 AI 成分标签:front-matter 用 ai_label: manual / reviewed / polished / generated 标记,
201
+ # 未设置时取 default(为空则不显示);文案由多语言系统提供(languages/*.yml 的 meta.ai_label.*),
202
+ # 此处配置各档文字颜色与可选 icon;文章页显示在顶部面包屑行最右(阅读时长右侧)
203
+ ai_label:
204
+ default:
205
+ manual:
206
+ color: '#03a9f4'
207
+ icon: default:shield-user
208
+ reviewed:
209
+ color: '#4caf50'
210
+ icon: default:shield-check
211
+ polished:
212
+ color: '#4caf50'
213
+ icon: default:shield-up
214
+ generated:
215
+ color: '#ff9800'
216
+ icon: default:shield-warning
200
217
  # 文章许可协议
201
218
  license: '本文采用 [署名-非商业性使用-相同方式共享 4.0 国际](https://creativecommons.org/licenses/by-nc-sa/4.0/) 许可协议,转载请注明出处。'
202
219
  # 分享
@@ -210,6 +227,8 @@ article:
210
227
  reading_time: false
211
228
  # 文章卡片是否显示标签(最多 5 个,#580)
212
229
  card_tags: false
230
+ # 文章末尾是否显示本文标签(位于 article-footer 之前)
231
+ tags: true
213
232
 
214
233
  search:
215
234
  service: local_search # local_search, algolia_search, todo...
@@ -217,6 +236,8 @@ search:
217
236
  field: all # post, page, all
218
237
  path: /search.json # 搜索文件存放位置
219
238
  content: true # 是否搜索内容
239
+ lazy_load: true # 懒加载:首次聚焦搜索框时才加载搜索数据(默认开启);站点内容较多时建议关闭,防止首次搜索卡顿
240
+ cache_ttl: 86400 # 搜索数据缓存时长(秒),默认 1 天;设为 0 表示不缓存,建议按内容更新频率调整
220
241
  skip_search: # 指定 path 中的内容不被搜索。
221
242
  algolia_search: # Docsearch https://docsearch.algolia.com/apply/ 申请
222
243
  appId:
@@ -392,12 +413,12 @@ tag_plugins:
392
413
  # {% quot %}
393
414
  quot:
394
415
  default: # 可以自行配置多种图标方案,支持icons.yml中配置的图片key,也支持直接设置svg/png等文件链接
395
- prefix: bxs:quote-left
396
- suffix: bxs:quote-right
416
+ prefix: quot:quote-left
417
+ suffix: quot:quote-right
397
418
  hashtag:
398
- prefix: solar:hashtag-square-bold
419
+ prefix: quot:hashtag
399
420
  question:
400
- prefix: ph:seal-question-fill
421
+ prefix: quot:question
401
422
  # {% emoji %}
402
423
  emoji:
403
424
  default: https://gcore.jsdelivr.net/gh/cdn-x/emoticons@3.1/qq/{name}.gif
@@ -731,8 +752,10 @@ default:
731
752
  project: https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.12/image/2779789.png
732
753
  banner: https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.12/banner/books.jpg
733
754
  topic: https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.12/image/10433048.png
755
+ # loading 兼容回退:新值位于 _data/icons.yml(default:loading-placeholder)
734
756
  loading: https://api.iconify.design/eos-icons:three-dots-loading.svg?color=%231cd0fd
735
757
  # loading: https://github.githubassets.com/images/mona-loading-dark.gif
758
+ # image_onerror 兼容回退:新值位于 _data/icons.yml(image:onerror)
736
759
  image_onerror: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2rem' height='2rem' viewBox='0 0 24 24'%3E%3C!-- Icon from Solar by 480 Design - https://creativecommons.org/licenses/by/4.0/ --%3E%3Cpath fill='%23F44336' d='M22 12.698c-.002 1.47-.013 2.718-.096 3.743c-.097 1.19-.296 2.184-.74 3.009a4.2 4.2 0 0 1-.73.983c-.833.833-1.893 1.21-3.237 1.39C15.884 22 14.2 22 12.053 22h-.106c-2.148 0-3.83 0-5.144-.177c-1.343-.18-2.404-.557-3.236-1.39c-.738-.738-1.12-1.656-1.322-2.795c-.2-1.12-.236-2.512-.243-4.241Q1.999 12.737 2 12v-.054c0-2.148 0-3.83.177-5.144c.18-1.343.557-2.404 1.39-3.236s1.893-1.21 3.236-1.39c1.168-.157 2.67-.175 4.499-.177a.697.697 0 1 1 0 1.396c-1.855.002-3.234.018-4.313.163c-1.189.16-1.906.464-2.436.994S3.72 5.8 3.56 6.99C3.397 8.2 3.395 9.788 3.395 12v.784l.932-.814a2.14 2.14 0 0 1 2.922.097l3.99 3.99a1.86 1.86 0 0 0 2.385.207l.278-.195a2.79 2.79 0 0 1 3.471.209l2.633 2.37c.265-.557.423-1.288.507-2.32c.079-.972.09-2.152.091-3.63a.698.698 0 0 1 1.396 0' opacity='.5'/%3E%3Cpath fill='%23F44336' fill-rule='evenodd' d='M17.5 11c-2.121 0-3.182 0-3.841-.659S13 8.621 13 6.5s0-3.182.659-3.841S15.379 2 17.5 2s3.182 0 3.841.659S22 4.379 22 6.5s0 3.182-.659 3.841S19.621 11 17.5 11m-1.47-7.03a.75.75 0 1 0-1.06 1.06l1.47 1.47l-1.47 1.47a.75.75 0 0 0 1.06 1.06l1.47-1.47l1.47 1.47a.75.75 0 1 0 1.06-1.06L18.56 6.5l1.47-1.47a.75.75 0 0 0-1.06-1.06L17.5 5.44z' clip-rule='evenodd'/%3E%3C/svg%3E"
737
760
 
738
761
  api_host: