hexo-theme-stellar 1.28.0 → 1.29.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.
- package/_config.yml +55 -6
- package/_data/icons.yml +3 -1
- package/_data/widgets.yml +6 -0
- package/languages/en.yml +7 -0
- package/languages/zh-CN.yml +7 -0
- package/languages/zh-TW.yml +7 -0
- package/layout/_partial/comments/artalk/script.ejs +9 -13
- package/layout/_partial/comments/beaudar/script.ejs +20 -23
- package/layout/_partial/comments/giscus/script.ejs +11 -11
- package/layout/_partial/comments/twikoo/script.ejs +12 -17
- package/layout/_partial/comments/utterances/script.ejs +20 -23
- package/layout/_partial/comments/waline/script.ejs +9 -16
- package/layout/_partial/head.ejs +1 -1
- package/layout/_partial/main/article/article_footer.ejs +6 -2
- package/layout/_partial/main/article/related_posts.ejs +1 -1
- package/layout/_partial/main/navbar/article_banner.ejs +2 -0
- package/layout/_partial/main/navbar/breadcrumb/note.ejs +8 -0
- package/layout/_partial/main/navbar/dateinfo.ejs +11 -0
- package/layout/_partial/main/notebook/note_card.ejs +36 -0
- package/layout/_partial/main/notebook/note_tags.ejs +9 -0
- package/layout/_partial/main/notebook/notebook_card.ejs +10 -0
- package/layout/_partial/main/notebook/paginator.ejs +9 -0
- package/layout/_partial/scripts/tagtree.ejs +29 -0
- package/layout/_partial/scripts/theme.ejs +62 -0
- package/layout/_partial/scripts.ejs +4 -1
- package/layout/_partial/sidebar/index_leftbar.ejs +10 -0
- package/layout/_partial/sidebar/index_rightbar.ejs +10 -0
- package/layout/_partial/sidebar/search.ejs +4 -0
- package/layout/_partial/widgets/recent.ejs +10 -0
- package/layout/_partial/widgets/tagtree.ejs +59 -0
- package/layout/_partial/widgets/toc.ejs +7 -5
- package/layout/_plugins/fancybox.ejs +2 -2
- package/layout/_plugins/tianli_gpt.ejs +1 -1
- package/layout/layout.ejs +5 -1
- package/layout/notebooks.ejs +8 -0
- package/layout/notes.ejs +12 -0
- package/layout/page.ejs +11 -1
- package/package.json +1 -1
- package/scripts/events/index.js +1 -0
- package/scripts/events/lib/notebooks.js +153 -0
- package/scripts/generators/notebooks.js +71 -0
- package/scripts/tags/index.js +5 -0
- package/scripts/tags/lib/image.js +16 -4
- package/scripts/tags/lib/quot.js +1 -2
- package/scripts/tags/lib/read/paper.js +90 -0
- package/scripts/tags/lib/read/reel.js +43 -0
- package/scripts/tags/lib/video.js +11 -6
- package/source/css/_common/button.styl +3 -3
- package/source/css/_common/device.styl +3 -3
- package/source/css/_common/highlight.styl +4 -2
- package/source/css/{_layout → _components}/md.styl +21 -19
- package/source/css/_components/pages/notebook.styl +65 -0
- package/source/css/{_layout → _components}/partial/article-banner.styl +4 -4
- package/source/css/{_layout → _components}/tag-plugins/common.styl +2 -2
- package/source/css/_components/tag-plugins/index.styl +1 -0
- package/source/css/{_layout → _components}/tag-plugins/media.styl +1 -1
- package/source/css/{_layout → _components}/tag-plugins/quot.styl +0 -2
- package/source/css/_components/tag-plugins/read/paper.styl +98 -0
- package/source/css/_components/tag-plugins/read/reel.styl +103 -0
- package/source/css/_defines/func.styl +4 -6
- package/source/css/_defines/theme.styl +36 -38
- package/source/css/_plugins/comments/waline.styl +3 -3
- package/source/css/_plugins/fancybox.styl +1 -1
- package/source/css/_plugins/mermaid.styl +2 -2
- package/source/css/main.styl +1 -1
- package/source/js/main.js +14 -0
- package/source/js/plugins/copycode.js +1 -1
- package/source/js/search/local-search.js +2 -2
- /package/source/css/{_layout → _components}/index.styl +0 -0
- /package/source/css/{_layout → _components}/layout.styl +0 -0
- /package/source/css/{_layout → _components}/list.styl +0 -0
- /package/source/css/{_layout → _components}/main.styl +0 -0
- /package/source/css/{_layout → _components}/pages/archives.styl +0 -0
- /package/source/css/{_layout → _components}/pages/error.styl +0 -0
- /package/source/css/{_layout → _components}/partial/article-footer.styl +0 -0
- /package/source/css/{_layout → _components}/partial/bread-nav.styl +0 -0
- /package/source/css/{_layout → _components}/partial/cover.styl +0 -0
- /package/source/css/{_layout → _components}/partial/footer.styl +0 -0
- /package/source/css/{_layout → _components}/partial/navbar.styl +0 -0
- /package/source/css/{_layout → _components}/partial/paginator.styl +0 -0
- /package/source/css/{_layout → _components}/partial/related.styl +0 -0
- /package/source/css/{_layout → _components}/sidebar/footer.styl +0 -0
- /package/source/css/{_layout → _components}/sidebar/logo.styl +0 -0
- /package/source/css/{_layout → _components}/sidebar/menu.styl +0 -0
- /package/source/css/{_layout → _components}/sidebar/nav-area.styl +0 -0
- /package/source/css/{_layout → _components}/sidebar/search.styl +0 -0
- /package/source/css/{_layout → _components}/sidebar/sidebar.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/about.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/banner.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/button.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/checkbox.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/copy.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/emoji.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/folders.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/folding.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/frame.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/friends.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/gallery.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/ghcard.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/grid.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/hashtag.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/icon.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/image.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/inline-labels.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/link.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/mark.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/navbar.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/note.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/okr.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/override.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/poetry.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/sites.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/tabs.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/timeline.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/toc.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/components.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/ghrepo.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/ghuser.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/list.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/markdown.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/related.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/tagcloud.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/timeline.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/toc.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/tree.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/widgets.styl +0 -0
package/_config.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
######## Stellar info ########
|
|
2
2
|
stellar:
|
|
3
|
-
version: '1.
|
|
3
|
+
version: '1.29.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
|
|
@@ -98,6 +98,29 @@ site_tree:
|
|
|
98
98
|
menu_id: wiki # 未在 front-matter 中指定 menu_id 时,layout 为 wiki 的页面默认使用这里配置的 menu_id
|
|
99
99
|
leftbar: tree, related, recent # for wiki
|
|
100
100
|
rightbar: ghrepo, toc
|
|
101
|
+
# 笔记本列表页配置
|
|
102
|
+
notebooks:
|
|
103
|
+
base_dir: notebooks # 笔记本列表页的路径。以及未指定 base_dir 的笔记本的路径前缀。
|
|
104
|
+
menu_id: notebooks # 笔记本列表页高亮的主导航栏菜单按钮。
|
|
105
|
+
# 笔记本列表页的左侧栏和右侧栏。
|
|
106
|
+
leftbar: recent # recent within all notebooks
|
|
107
|
+
rightbar: null
|
|
108
|
+
# 笔记列表页配置
|
|
109
|
+
notes:
|
|
110
|
+
# 笔记列表页和笔记页高亮的主导航栏菜单按钮。
|
|
111
|
+
# 可以在笔记本 yaml 的 menu_id 字段中覆盖此参数。
|
|
112
|
+
# 可以在笔记的 front-matter/menu_id 中覆盖此参数。
|
|
113
|
+
menu_id: notebooks
|
|
114
|
+
# 笔记列表页的左侧栏和右侧栏。可以在笔记本 yaml 的 leftbar 和 rightbar 字段中覆盖此参数。
|
|
115
|
+
leftbar: tagtree, recent # recent of current notebook
|
|
116
|
+
rightbar: null
|
|
117
|
+
# 笔记页配置
|
|
118
|
+
note:
|
|
119
|
+
# 笔记页的左侧栏和右侧栏
|
|
120
|
+
# 可以在笔记本 yaml 的 note_leftbar 和 note_rightbar 字段中覆盖此参数。
|
|
121
|
+
# 可以在笔记的 front-matter/leftbar 和 rightbar 字段中覆盖此参数。
|
|
122
|
+
leftbar: tagtree, recent # recent of current notebook
|
|
123
|
+
rightbar: toc
|
|
101
124
|
# 作者信息配置
|
|
102
125
|
author:
|
|
103
126
|
base_dir: author # 只影响自动生成的页面路径
|
|
@@ -116,6 +139,30 @@ site_tree:
|
|
|
116
139
|
rightbar: toc
|
|
117
140
|
|
|
118
141
|
|
|
142
|
+
######## Notebook ########
|
|
143
|
+
notebook:
|
|
144
|
+
# 如果没有指定 excerpt 和 description,将自动取多长的内容作为文章摘要。
|
|
145
|
+
auto_excerpt: 128
|
|
146
|
+
# 可以为某个 tag 设定图标(显示在标签树中)。
|
|
147
|
+
tagcons:
|
|
148
|
+
'': solar:hashtag-linear
|
|
149
|
+
# 每页显示多少篇笔记。0 表示不分页,null 则 fallback 到 hexo 的配置。
|
|
150
|
+
# 可以在笔记本 yaml 的 per_page 字段中覆盖此参数。
|
|
151
|
+
per_page: null
|
|
152
|
+
# 笔记的排序方式。默认按照 updated 降序排序。
|
|
153
|
+
# 可以在笔记本 yaml 的 order_by 字段中覆盖此参数。
|
|
154
|
+
# 注意:置顶的笔记会始终排在最前面。
|
|
155
|
+
# 在 front-matter 中设置 pin:true|number 或 sticky:true|number 来置顶。
|
|
156
|
+
order_by: -updated
|
|
157
|
+
# 是否在笔记页面显示许可协议。false 表示不显示。true 表示沿用主题许可协议内容。也可以给定具体的文本指定协议内容。
|
|
158
|
+
# 可以在笔记本 yaml 的 license 字段中覆盖此参数。
|
|
159
|
+
# 可以在笔记的 front-matter/license 中覆盖此参数。
|
|
160
|
+
license: false
|
|
161
|
+
# 是否在笔记页面显示分享按钮。
|
|
162
|
+
# 可以在笔记本 yaml 的 share 字段中覆盖此参数。
|
|
163
|
+
# 可以在笔记的 front-matter/share 中覆盖此参数。
|
|
164
|
+
share: false
|
|
165
|
+
|
|
119
166
|
|
|
120
167
|
######## Article ########
|
|
121
168
|
article:
|
|
@@ -160,6 +207,7 @@ search:
|
|
|
160
207
|
comments:
|
|
161
208
|
service: # beaudar, utterances, giscus, twikoo, waline, artalk
|
|
162
209
|
comment_title: 快来参与讨论吧~
|
|
210
|
+
lazyload: false # true / false
|
|
163
211
|
# beaudar
|
|
164
212
|
# https://beaudar.lipk.org/
|
|
165
213
|
beaudar:
|
|
@@ -250,8 +298,8 @@ comments:
|
|
|
250
298
|
# Artalk
|
|
251
299
|
# https://artalk.js.org/
|
|
252
300
|
artalk:
|
|
253
|
-
css: https://unpkg.com/artalk@2.
|
|
254
|
-
js: https://unpkg.com/artalk@2.
|
|
301
|
+
css: https://unpkg.com/artalk@2.8.5/dist/Artalk.css
|
|
302
|
+
js: https://unpkg.com/artalk@2.8.5/dist/Artalk.js
|
|
255
303
|
server: # 后端服务地址
|
|
256
304
|
placeholder: ''
|
|
257
305
|
darkMode: auto
|
|
@@ -272,6 +320,9 @@ footer:
|
|
|
272
320
|
# comments:
|
|
273
321
|
# icon: '<img src="https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.12/social/942ebbf1a4b91.svg"/>'
|
|
274
322
|
# url: /about/#comments
|
|
323
|
+
# theme:
|
|
324
|
+
# icon: default:theme
|
|
325
|
+
# onclick: 'switchTheme()'
|
|
275
326
|
sitemap:
|
|
276
327
|
# '博客':
|
|
277
328
|
# - '[近期](/)'
|
|
@@ -477,11 +528,9 @@ plugins:
|
|
|
477
528
|
# https://github.com/KaTeX/KaTeX
|
|
478
529
|
# 使用 hexo-renderer-markdown-it-plus 作为公式渲染器:npm uninstall hexo-renderer-marked --save npm install hexo-renderer-markdown-it-plus --save
|
|
479
530
|
katex:
|
|
480
|
-
enable: #true #
|
|
531
|
+
enable: #true # hexo-renderer-markdown-it-plus 默认开启 katex,此选项仅用于引入样式
|
|
481
532
|
inject: |
|
|
482
533
|
<link rel="stylesheet" href="https://gcore.jsdelivr.net/npm/katex@0.16.4/dist/katex.min.css" integrity="sha384-vKruj+a13U8yHIkAyGgK1J3ArTLzrFGBbBc0tDp4ad/EyewESeXE/Iv67Aj8gKZ0" crossorigin="anonymous">
|
|
483
|
-
<script defer src="https://gcore.jsdelivr.net/npm/katex@0.16.4/dist/katex.min.js" integrity="sha384-PwRUT/YqbnEjkZO0zZxNqcxACrXe+j766U2amXcgMg5457rve2Y7I6ZJSm2A0mS4" crossorigin="anonymous"></script>
|
|
484
|
-
<script defer src="https://gcore.jsdelivr.net/npm/katex@0.16.4/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"onload="renderMathInElement(document.body);"></script>
|
|
485
534
|
|
|
486
535
|
# MathJax
|
|
487
536
|
# 需在Markdown文件开头加入mathjax: true
|
package/_data/icons.yml
CHANGED
|
@@ -7,7 +7,8 @@ solar:documents-bold-duotone: <svg xmlns="http://www.w3.org/2000/svg" width="32"
|
|
|
7
7
|
solar:chat-square-like-bold-duotone: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="m13.629 20.472l-.542.916c-.483.816-1.69.816-2.174 0l-.542-.916c-.42-.71-.63-1.066-.968-1.262c-.338-.197-.763-.204-1.613-.219c-1.256-.021-2.043-.098-2.703-.372a5 5 0 0 1-2.706-2.706C2 14.995 2 13.83 2 11.5v-1c0-3.273 0-4.91.737-6.112a5 5 0 0 1 1.65-1.651C5.59 2 7.228 2 10.5 2h3c3.273 0 4.91 0 6.113.737a5 5 0 0 1 1.65 1.65C22 5.59 22 7.228 22 10.5v1c0 2.33 0 3.495-.38 4.413a5 5 0 0 1-2.707 2.706c-.66.274-1.447.35-2.703.372c-.85.015-1.275.022-1.613.219c-.338.196-.548.551-.968 1.262" opacity=".5"/><path fill="currentColor" d="M10.99 14.308c-1.327-.978-3.49-2.84-3.49-4.593c0-2.677 2.475-3.677 4.5-1.609c2.025-2.068 4.5-1.068 4.5 1.609c0 1.752-2.163 3.615-3.49 4.593c-.454.335-.681.502-1.01.502c-.329 0-.556-.167-1.01-.502"/></svg>
|
|
8
8
|
solar:planet-bold-duotone: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M20 12a8 8 0 1 1-16 0a8 8 0 0 1 16 0" opacity=".5"/><path fill="currentColor" d="M17.712 5.453c1.047-.193 2.006-.259 2.797-.152c.77.103 1.536.393 1.956 1.064c.446.714.312 1.542-.012 2.258c-.33.728-.918 1.499-1.672 2.268c-1.516 1.547-3.836 3.226-6.597 4.697c-2.763 1.472-5.495 2.484-7.694 2.92c-1.095.217-2.098.299-2.923.201c-.8-.095-1.6-.383-2.032-1.075c-.47-.752-.296-1.63.07-2.379c.375-.768 1.032-1.586 1.872-2.403L4 12.416c0 .219.083.71.168 1.146c.045.23.09.444.123.596c-.652.666-1.098 1.263-1.339 1.756c-.277.567-.208.825-.145.925c.072.116.305.305.937.38c.609.073 1.44.018 2.455-.183c2.02-.4 4.613-1.351 7.28-2.772c2.667-1.42 4.85-3.015 6.23-4.423c.694-.707 1.15-1.334 1.377-1.836c.233-.515.167-.75.107-.844c-.07-.112-.289-.294-.883-.374c-.542-.072-1.272-.041-2.163.112L16.87 5.656c.338-.101.658-.17.842-.203"/></svg>
|
|
9
9
|
solar:notebook-bookmark-bold-duotone: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" d="M14.25 4.48v3.057c0 .111 0 .27.02.406a.936.936 0 0 0 .445.683a.96.96 0 0 0 .783.072c.13-.04.272-.108.378-.159L17 8.005l1.124.534c.106.05.248.119.378.16a.958.958 0 0 0 .783-.073a.936.936 0 0 0 .444-.683c.021-.136.021-.295.021-.406V3.031c.113-.005.224-.01.332-.013C21.154 2.98 22 3.86 22 4.933v11.21c0 1.112-.906 2.01-2.015 2.08c-.97.06-2.108.179-2.985.41c-1.082.286-1.99 1.068-3.373 1.436c-.626.167-1.324.257-1.627.323V5.174c.32-.079 1.382-.203 1.674-.371c.184-.107.377-.216.576-.323m5.478 8.338a.75.75 0 0 1-.546.91l-4 1a.75.75 0 0 1-.364-1.456l4-1a.75.75 0 0 1 .91.546" clip-rule="evenodd"/><path fill="currentColor" d="M18.25 3.151c-.62.073-1.23.18-1.75.336a8.2 8.2 0 0 0-.75.27v3.182l.75-.356l.008-.005a1.13 1.13 0 0 1 .492-.13c.047 0 .094.004.138.01c.175.029.315.1.354.12l.009.005l.749.356V3.647z"/><path fill="currentColor" d="M12 5.214c-.334-.064-1.057-.161-1.718-.339C8.938 4.515 8.05 3.765 7 3.487c-.887-.234-2.041-.352-3.018-.412C2.886 3.007 2 3.9 2 4.998v11.146c0 1.11.906 2.01 2.015 2.079c.97.06 2.108.179 2.985.41c.486.129 1.216.431 1.873.726c1.005.451 2.052.797 3.127 1.034z" opacity=".5"/><path fill="currentColor" d="M4.273 12.818a.75.75 0 0 1 .91-.545l4 1a.75.75 0 1 1-.365 1.455l-4-1a.75.75 0 0 1-.545-.91m.909-4.545a.75.75 0 1 0-.364 1.455l4 1a.75.75 0 0 0 .364-1.455z"/></svg>
|
|
10
|
-
|
|
10
|
+
solar:pin-linear: <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="m15.9894 4.9502.5306-.53006zm3.0822 3.08542-.5306.53006zm-10.33323 11.39338-.5306.5301zm-4.11668-4.1209.5306-.53zm12.94521-.3138-.2637-.7021zm-1.9171.7203.2638.7021zm-7.3176-7.33283-.70422-.25802zm.69445-1.89541.70422.25802zm-3.18161 4.18714.19934.723zm1.45663-.5384-.43821-.60864zm.37415-.34472.57083.48642zm6.57518 6.59012.491.567zm-.8704 1.8207-.7232-.199zm.5363-1.4546-.6094-.4372zm-11.19844-3.9914-.74998.0048zm.21199-.8031-.64992-.3743zm8.37475 9.391.0012-.75zm.7881-.2084-.3718-.6514zm-.396-19.09864.1615.73239zm-10.2279 19.43384c-.29274.2931-.2925.768.00054 1.0607s.76792.2925 1.06066-.0005zm5.71443-3.5978c.29274-.293.2925-.7679-.00054-1.0607-.29305-.2927-.76792-.2925-1.06066.0006zm8.27497-12.39184 3.0822 3.08542 1.0612-1.06012-3.0822-3.08542zm-6.18983 13.41864-4.11668-4.1208-1.0612 1.0601 4.11668 4.1209zm8.03423-4.6067-1.9172.7203.5276 1.4042 1.9171-.7203zm-8.26678-5.65241.69445-1.89541-1.40844-.51604-.69445 1.89541zm-2.99204 2.75671c.71145-.1962 1.25281-.334 1.69549-.6527l-.87641-1.21734c-.17293.12451-.39745.19782-1.21776.42398zm1.5836-3.27275c-.29296.79957-.3846 1.01778-.52299 1.18016l1.14166.97289c.35376-.41505.53565-.94343.78977-1.63701zm.11189 2.62005c.18709-.1347.35725-.2915.50678-.467l-1.14166-.97289c-.07129.08366-.15239.15838-.24153.22255zm7.64613 4.2687c-.689.2589-1.2144.4446-1.626.801l.982 1.134c.1608-.1393.3772-.2323 1.1716-.5308zm-1.2823 3.3876c.2253-.8188.2984-1.0432.4226-1.2163l-1.2188-.8744c-.3173.4423-.4546.9825-.6501 1.6928zm-.3437-2.5866c-.1697.147-.3216.3134-.4525.4959l1.2188.8744c.0624-.087.1348-.1663.2157-.2363zm-8.60771-1.0354c-.64614-.6468-1.0843-1.0871-1.36863-1.4443-.28531-.3585-.31477-.5137-.31521-.5833l-1.49997.0095c.00367.5822.29279 1.0697.64154 1.5079.34974.4394.86113.9497 1.48107 1.5703zm.49341-4.82766c-.84522.23306-1.54174.42386-2.06274.63306-.51955.2085-1.0118.4897-1.30243.9943l1.29985.7486c.03462-.0601.13655-.1804.56142-.3509.42343-.17 1.02157-.3361 1.90258-.579zm-2.17725 2.80006c-.00094-.1489.03771-.2952.11193-.4241l-1.29985-.7486c-.20699.3594-.31467.7674-.31205 1.1822zm4.73932 7.2086c.62387.6245 1.13687 1.1396 1.5787 1.4915.44053.3509.93143.6416 1.51763.6425l.0023-1.5c-.0695-.0001-.225-.0287-.5854-.3158-.3592-.2861-.80177-.7274-1.45203-1.3784zm4.44963-1.9569c-.2441.8875-.4112 1.4902-.5823 1.9166-.1718.4279-.293.5299-.3536.5645l.7435 1.3028c.509-.2905.7923-.7857 1.0021-1.3086.2105-.5243.4023-1.2259.6366-2.0774zm-1.3533 4.0909c.4071.0006.8073-.1052 1.1609-.307l-.7435-1.3028c-.1265.0722-.2696.11-.4151.1098zm7.2369-13.52742c1.0635 1.06454 1.7993 1.80382 2.2507 2.41312.4436.5986.4946.9171.4404 1.1676l1.4661.317c.1899-.878-.16-1.6472-.7013-2.3777-.5334-.71978-1.3664-1.55084-2.3947-2.58014zm-.7103 7.13072c1.3614-.5115 2.4633-.9234 3.2464-1.358.7947-.4411 1.4312-.9968 1.6211-1.875l-1.4661-.317c-.0541.2504-.232.5191-.883.8804-.6626.3678-1.6379.7364-3.0459 1.2654zm-1.3107-11.27626c-1.0359-1.03694-1.8719-1.87661-2.5954-2.41376-.7338-.54473-1.5071-.89726-2.3889-.70271l.3231 1.46478c.2498-.0551.5689-.00515 1.1716.4423.6129.45504 1.3572 1.19726 2.4284 2.26951zm-6.78913 2.32424c.52163-1.42363.88523-2.41035 1.25033-3.08123.359-.65977.6278-.83958.8776-.8947l-.3231-1.46478c-.8817.19452-1.4352.83965-1.87208 1.64251-.43084.79175-.83674 1.90536-1.34119 3.28216zm-7.20027 15.78572 4.65323-4.658-1.0612-1.0601-4.65323 4.6579z" fill="currentColor"/></svg>
|
|
11
|
+
solar:hashtag-linear: <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="m10 3-5 18"/><path d="m19 3-5 18"/><path d="m22 9h-18"/><path d="m20 16h-18"/></g></svg>
|
|
11
12
|
|
|
12
13
|
default:goback: <svg aria-hidden="true" viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M7.78 12.53a.75.75 0 01-1.06 0L2.47 8.28a.75.75 0 010-1.06l4.25-4.25a.75.75 0 011.06 1.06L4.81 7h7.44a.75.75 0 010 1.5H4.81l2.97 2.97a.75.75 0 010 1.06z"></path></svg>
|
|
13
14
|
|
|
@@ -32,6 +33,7 @@ default:category: <svg style="margin-bottom:1px" xmlns="http://www.w3.org/2000/s
|
|
|
32
33
|
default:edit: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" d="M11.943 1.25H13.5a.75.75 0 0 1 0 1.5H12c-2.378 0-4.086.002-5.386.176c-1.279.172-2.05.5-2.62 1.069c-.569.57-.896 1.34-1.068 2.619c-.174 1.3-.176 3.008-.176 5.386s.002 4.086.176 5.386c.172 1.279.5 2.05 1.069 2.62c.57.569 1.34.896 2.619 1.068c1.3.174 3.008.176 5.386.176s4.086-.002 5.386-.176c1.279-.172 2.05-.5 2.62-1.069c.569-.57.896-1.34 1.068-2.619c.174-1.3.176-3.008.176-5.386v-1.5a.75.75 0 0 1 1.5 0v1.557c0 2.309 0 4.118-.19 5.53c-.194 1.444-.6 2.584-1.494 3.479c-.895.895-2.035 1.3-3.48 1.494c-1.411.19-3.22.19-5.529.19h-.114c-2.309 0-4.118 0-5.53-.19c-1.444-.194-2.584-.6-3.479-1.494c-.895-.895-1.3-2.035-1.494-3.48c-.19-1.411-.19-3.22-.19-5.529v-.114c0-2.309 0-4.118.19-5.53c.194-1.444.6-2.584 1.494-3.479c.895-.895 2.035-1.3 3.48-1.494c1.411-.19 3.22-.19 5.529-.19m4.827 1.026a3.503 3.503 0 0 1 4.954 4.953l-6.648 6.649c-.371.37-.604.604-.863.806a5.34 5.34 0 0 1-.987.61c-.297.141-.61.245-1.107.411l-2.905.968a1.492 1.492 0 0 1-1.887-1.887l.968-2.905c.166-.498.27-.81.411-1.107c.167-.35.372-.68.61-.987c.202-.26.435-.492.806-.863zm3.893 1.06a2.003 2.003 0 0 0-2.832 0l-.376.377c.022.096.054.21.098.338c.143.413.415.957.927 1.469a3.875 3.875 0 0 0 1.807 1.025l.376-.376a2.003 2.003 0 0 0 0-2.832m-1.558 4.391a5.397 5.397 0 0 1-1.686-1.146a5.395 5.395 0 0 1-1.146-1.686L11.218 9.95c-.417.417-.58.582-.72.76a3.84 3.84 0 0 0-.437.71c-.098.203-.172.423-.359.982l-.431 1.295l1.032 1.033l1.295-.432c.56-.187.779-.261.983-.358c.251-.12.49-.267.71-.439c.177-.139.342-.302.759-.718z" clip-rule="evenodd"/></svg>
|
|
33
34
|
default:upup: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Z"/><path stroke-linecap="round" stroke-linejoin="round" d="m9 15.5l3-3l3 3m-6-4l3-3l3 3"/></g></svg>
|
|
34
35
|
default:tocomment: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" d="M10.46 1.25h3.08c1.603 0 2.86 0 3.864.095c1.023.098 1.861.3 2.6.752a5.75 5.75 0 0 1 1.899 1.899c.452.738.654 1.577.752 2.6c.095 1.004.095 2.261.095 3.865v1.067c0 1.141 0 2.036-.05 2.759c-.05.735-.153 1.347-.388 1.913a5.75 5.75 0 0 1-3.112 3.112c-.805.334-1.721.408-2.977.43a10.81 10.81 0 0 0-.929.036c-.198.022-.275.054-.32.08c-.047.028-.112.078-.224.232c-.121.166-.258.396-.476.764l-.542.916c-.773 1.307-2.69 1.307-3.464 0l-.542-.916a10.605 10.605 0 0 0-.476-.764c-.112-.154-.177-.204-.224-.232c-.045-.026-.122-.058-.32-.08c-.212-.023-.49-.03-.93-.037c-1.255-.021-2.171-.095-2.976-.429A5.75 5.75 0 0 1 1.688 16.2c-.235-.566-.338-1.178-.389-1.913c-.049-.723-.049-1.618-.049-2.76v-1.066c0-1.604 0-2.86.095-3.865c.098-1.023.3-1.862.752-2.6a5.75 5.75 0 0 1 1.899-1.899c.738-.452 1.577-.654 2.6-.752C7.6 1.25 8.857 1.25 10.461 1.25M6.739 2.839c-.914.087-1.495.253-1.959.537A4.25 4.25 0 0 0 3.376 4.78c-.284.464-.45 1.045-.537 1.96c-.088.924-.089 2.11-.089 3.761v1c0 1.175 0 2.019.046 2.685c.045.659.131 1.089.278 1.441a4.25 4.25 0 0 0 2.3 2.3c.515.214 1.173.294 2.429.316h.031c.398.007.747.013 1.037.045c.311.035.616.104.909.274c.29.17.5.395.682.645c.169.232.342.525.538.856l.559.944a.52.52 0 0 0 .882 0l.559-.944c.196-.331.37-.624.538-.856c.182-.25.392-.476.682-.645c.293-.17.598-.24.909-.274c.29-.032.639-.038 1.037-.045h.032c1.255-.022 1.913-.102 2.428-.316a4.25 4.25 0 0 0 2.3-2.3c.147-.352.233-.782.278-1.441c.046-.666.046-1.51.046-2.685v-1c0-1.651 0-2.837-.089-3.762c-.087-.914-.253-1.495-.537-1.959a4.25 4.25 0 0 0-1.403-1.403c-.464-.284-1.045-.45-1.96-.537c-.924-.088-2.11-.089-3.761-.089h-3c-1.651 0-2.837 0-3.762.089" clip-rule="evenodd"/><path fill="currentColor" d="M9 11a1 1 0 1 1-2 0a1 1 0 0 1 2 0m4 0a1 1 0 1 1-2 0a1 1 0 0 1 2 0m4 0a1 1 0 1 1-2 0a1 1 0 0 1 2 0"/></svg>
|
|
36
|
+
default:theme: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" fill-rule="evenodd" d="M582.4 326.4c-140.8 0-256 115.2-256 256s115.2 256 256 256 256-115.2 256-256-115.2-256-256-256z m0 448c-70.4 0-131.2-36.8-164.8-92.8 12.8 3.2 27.2 4.8 40 4.8 121.6 0 219.2-99.2 219.2-219.2 0-17.6-1.6-35.2-6.4-52.8 60.8 32 102.4 96 102.4 169.6 1.6 104-84.8 190.4-190.4 190.4zM582.4 262.4c17.6 0 32-14.4 32-32v-128c0-17.6-14.4-32-32-32s-32 14.4-32 32v128c0 17.6 14.4 32 32 32zM262.4 582.4c0-17.6-14.4-32-32-32h-128c-17.6 0-32 14.4-32 32s14.4 32 32 32h128c17.6 0 32-14.4 32-32zM310.4 356.8c6.4 6.4 14.4 9.6 22.4 9.6 8 0 16-3.2 22.4-9.6 12.8-12.8 12.8-32 0-44.8l-91.2-91.2c-12.8-12.8-32-12.8-44.8 0-12.8 12.8-12.8 32 0 44.8l91.2 91.2zM944 220.8c-12.8-12.8-32-12.8-44.8 0l-91.2 91.2c-12.8 12.8-12.8 32 0 44.8 6.4 6.4 14.4 9.6 22.4 9.6 8 0 16-3.2 22.4-9.6l91.2-91.2c12.8-12.8 12.8-33.6 0-44.8zM310.4 808l-91.2 91.2c-12.8 12.8-12.8 32 0 44.8 6.4 6.4 14.4 9.6 22.4 9.6 8 0 16-3.2 22.4-9.6l91.2-91.2c12.8-12.8 12.8-32 0-44.8-11.2-11.2-32-11.2-44.8 0z"></path></svg>
|
|
35
37
|
|
|
36
38
|
github:logo: <svg aria-hidden="true" role="img" class="color-icon-primary" viewBox="0 0 16 16" width="1em" height="1em" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>
|
|
37
39
|
github:repo: <svg aria-hidden="true" role="img" class="color-icon-primary" viewBox="0 0 16 16" width="1em" height="1em" fill="currentColor" style="user-select:none;overflow:visible"><path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg>
|
package/_data/widgets.yml
CHANGED
|
@@ -70,3 +70,9 @@ timeline:
|
|
|
70
70
|
user: # 默认显示所有人的数据,设置名称可过滤为仅显示某人的数据,多个名称用英文逗号隔开,不要加空格
|
|
71
71
|
type: # 默认不用写,如果是友链朋友圈数据请写 fcircle
|
|
72
72
|
limit: # 默认通过 api 上增加 per_page 来设置,如果是友链朋友圈,可通过这个设置数量
|
|
73
|
+
|
|
74
|
+
tagtree:
|
|
75
|
+
layout: tagtree
|
|
76
|
+
expand_all: false # 是否展开所有节点
|
|
77
|
+
expand_active: true # 是否展开当前节点
|
|
78
|
+
show_tagcon: true # 是否显示标签 icon
|
package/languages/en.yml
CHANGED
|
@@ -3,6 +3,7 @@ btn:
|
|
|
3
3
|
blog: Blog
|
|
4
4
|
wiki: Wiki
|
|
5
5
|
topic: Topic
|
|
6
|
+
notebook: Notebook
|
|
6
7
|
recent_publish: Recent
|
|
7
8
|
all_wiki: All Products
|
|
8
9
|
category: Category
|
|
@@ -18,6 +19,8 @@ btn:
|
|
|
18
19
|
|
|
19
20
|
meta:
|
|
20
21
|
recent_update: Recent Update
|
|
22
|
+
tag_tree: Tags
|
|
23
|
+
all_notes: All Notes
|
|
21
24
|
toc: On This Page
|
|
22
25
|
read_next: READ NEXT
|
|
23
26
|
prev: Prev
|
|
@@ -53,6 +56,10 @@ search:
|
|
|
53
56
|
|
|
54
57
|
message:
|
|
55
58
|
copied: Copied!
|
|
59
|
+
theme_switched:
|
|
60
|
+
light: Switched to Light Mode
|
|
61
|
+
dark: Switched to Dark Mode
|
|
62
|
+
auto: Switched to Auto Mode
|
|
56
63
|
|
|
57
64
|
symbol:
|
|
58
65
|
comma: ", "
|
package/languages/zh-CN.yml
CHANGED
|
@@ -3,6 +3,7 @@ btn:
|
|
|
3
3
|
blog: 文章
|
|
4
4
|
wiki: 文档
|
|
5
5
|
topic: 专栏
|
|
6
|
+
notebook: 笔记本
|
|
6
7
|
recent_publish: 近期发布
|
|
7
8
|
all_wiki: 所有项目
|
|
8
9
|
category: 分类
|
|
@@ -18,6 +19,8 @@ btn:
|
|
|
18
19
|
|
|
19
20
|
meta:
|
|
20
21
|
recent_update: 最近更新
|
|
22
|
+
tag_tree: 标签
|
|
23
|
+
all_notes: 所有笔记
|
|
21
24
|
toc: 本文目录
|
|
22
25
|
read_next: 接下来阅读
|
|
23
26
|
prev: 回顾上一篇
|
|
@@ -53,6 +56,10 @@ search:
|
|
|
53
56
|
|
|
54
57
|
message:
|
|
55
58
|
copied: 复制成功
|
|
59
|
+
theme_switched:
|
|
60
|
+
light: 切换到浅色模式
|
|
61
|
+
dark: 切换到深色模式
|
|
62
|
+
auto: 切换到跟随系统配色
|
|
56
63
|
|
|
57
64
|
symbol:
|
|
58
65
|
comma: ","
|
package/languages/zh-TW.yml
CHANGED
|
@@ -3,6 +3,7 @@ btn:
|
|
|
3
3
|
blog: 網誌
|
|
4
4
|
wiki: 文檔
|
|
5
5
|
topic: 專欄
|
|
6
|
+
notebook: 筆記本
|
|
6
7
|
recent_publish: 近期發布
|
|
7
8
|
all_wiki: 所有文檔
|
|
8
9
|
category: 分類
|
|
@@ -18,6 +19,8 @@ btn:
|
|
|
18
19
|
|
|
19
20
|
meta:
|
|
20
21
|
recent_update: 最近更新
|
|
22
|
+
tag_tree: 標籤
|
|
23
|
+
all_notes: 所有筆記
|
|
21
24
|
toc: 本文目錄
|
|
22
25
|
read_next: 接下來閱讀
|
|
23
26
|
prev: 回顧上一篇
|
|
@@ -53,6 +56,10 @@ search:
|
|
|
53
56
|
|
|
54
57
|
message:
|
|
55
58
|
copied: 複製成功
|
|
59
|
+
theme_switched:
|
|
60
|
+
light: 切換到淺色模式
|
|
61
|
+
dark: 切換到深色模式
|
|
62
|
+
auto: 切換到跟隨系統配色
|
|
56
63
|
|
|
57
64
|
symbol:
|
|
58
65
|
comma: ","
|
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script type="module">
|
|
2
|
+
const el = document.getElementById('artalk_container');
|
|
3
|
+
util.viewportLazyload(el, load_artalk, <%= theme.comments.lazyload ?? false %>);
|
|
4
|
+
|
|
2
5
|
function load_artalk() {
|
|
3
|
-
if (!
|
|
6
|
+
if (!el) return;
|
|
4
7
|
utils.css('<%- theme.comments.artalk.css %>');
|
|
5
8
|
utils.js('<%- theme.comments.artalk.js %>', {defer: true}).then(function () {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
if (!path) {
|
|
9
|
-
path = decodeURI(window.location.pathname);
|
|
10
|
-
}
|
|
11
|
-
var artalk = Artalk.init({
|
|
9
|
+
const path = el.getAttribute('comment_id') ?? decodeURI(window.location.pathname);
|
|
10
|
+
const artalk = Artalk.init({
|
|
12
11
|
el: '#artalk_container',
|
|
13
12
|
pageKey: path,
|
|
14
13
|
pageTitle: '<%= page.title %>',
|
|
15
14
|
server: '<%= theme.comments.artalk.server %>',
|
|
16
15
|
placeholder: '<%= theme.comments.artalk.placeholder %>',
|
|
17
|
-
site:
|
|
16
|
+
site: "<%- config.title %>",
|
|
18
17
|
darkMode: '<%= theme.comments.artalk.darkMode %>'
|
|
19
|
-
})
|
|
20
18
|
});
|
|
19
|
+
});
|
|
21
20
|
}
|
|
22
|
-
window.addEventListener('DOMContentLoaded', (event) => {
|
|
23
|
-
load_artalk();
|
|
24
|
-
});
|
|
25
21
|
</script>
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
<script type="module">
|
|
2
|
+
const el = document.querySelector('#comments #beaudar');
|
|
3
|
+
util.viewportLazyload(el, load_beaudar, <%= theme.comments.lazyload ?? false %>);
|
|
4
|
+
|
|
5
|
+
function load_beaudar() {
|
|
6
|
+
if (!el) return;
|
|
7
|
+
try {
|
|
8
|
+
el.innerHTML = '';
|
|
9
|
+
} catch (error) {
|
|
10
|
+
console.error(error);
|
|
11
|
+
}
|
|
12
|
+
const script = document.createElement('script');
|
|
13
|
+
script.src = 'https://beaudar.lipk.org/client.js';
|
|
14
|
+
script.async = true;
|
|
15
|
+
for (const key of Object.keys(el.attributes)) {
|
|
16
|
+
const attr = el.attributes[key];
|
|
17
|
+
if (['class', 'id'].includes(attr.name) === false) {
|
|
18
|
+
script.setAttribute(attr.name, attr.value);
|
|
10
19
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
script.async = true;
|
|
14
|
-
for (let key of Object.keys(el.attributes)) {
|
|
15
|
-
let attr = el.attributes[key];
|
|
16
|
-
if (['class', 'id'].includes(attr.name) === false) {
|
|
17
|
-
script.setAttribute(attr.name, attr.value);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
el.appendChild(script);
|
|
21
|
-
});
|
|
20
|
+
}
|
|
21
|
+
el.appendChild(script);
|
|
22
22
|
}
|
|
23
|
-
window.addEventListener('DOMContentLoaded', (event) => {
|
|
24
|
-
loadBeaudar();
|
|
25
|
-
});
|
|
26
23
|
</script>
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script type="module">
|
|
2
|
+
const el = document.querySelector('#comments #giscus');
|
|
3
|
+
util.viewportLazyload(el, load_discus, <%= theme.comments.lazyload ?? false %>);
|
|
4
|
+
|
|
5
|
+
function load_discus() {
|
|
6
|
+
if (!el) return;
|
|
7
|
+
try {
|
|
7
8
|
el.innerHTML = '';
|
|
8
9
|
} catch (error) {
|
|
9
10
|
console.error(error);
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
+
const script = document.createElement('script');
|
|
12
13
|
script.async = true;
|
|
13
|
-
for (
|
|
14
|
-
|
|
14
|
+
for (const key of Object.keys(el.attributes)) {
|
|
15
|
+
const attr = el.attributes[key];
|
|
15
16
|
if (['class', 'id'].includes(attr.name) === false) {
|
|
16
17
|
script.setAttribute(attr.name, attr.value);
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
el.appendChild(script);
|
|
20
|
-
|
|
21
|
-
});
|
|
21
|
+
}
|
|
22
22
|
</script>
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
utils.js('<%- theme.comments.twikoo.js %>', {defer: true}).then(function () {
|
|
5
|
-
const el = document.getElementById("twikoo_container");
|
|
6
|
-
var path = el.getAttribute('comment_id');
|
|
7
|
-
if (!path) {
|
|
8
|
-
path = decodeURI(window.location.pathname);
|
|
9
|
-
}
|
|
10
|
-
twikoo.init(Object.assign(<%- JSON.stringify(theme.comments.twikoo) %>, {
|
|
11
|
-
el: '#twikoo_container',
|
|
12
|
-
path: path,
|
|
13
|
-
}));
|
|
14
|
-
});
|
|
15
|
-
}
|
|
1
|
+
<script type="module">
|
|
2
|
+
const el = document.getElementById('twikoo_container');
|
|
3
|
+
util.viewportLazyload(el, load_twikoo, <%= theme.comments.lazyload ?? false %>);
|
|
16
4
|
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
function load_twikoo() {
|
|
6
|
+
if (!el) return;
|
|
7
|
+
utils.js('<%- theme.comments.twikoo.js %>', {defer: true}).then(function () {
|
|
8
|
+
const path = el.getAttribute('comment_id') ?? decodeURI(window.location.pathname);
|
|
9
|
+
twikoo.init(Object.assign(<%- JSON.stringify(theme.comments.twikoo) %>, {
|
|
10
|
+
el: '#twikoo_container',
|
|
11
|
+
path: path,
|
|
12
|
+
}));
|
|
19
13
|
});
|
|
14
|
+
}
|
|
20
15
|
</script>
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
<script type="module">
|
|
2
|
+
const el = document.querySelector("#comments #utterances");
|
|
3
|
+
util.viewportLazyload(el, load_utterances, <%= theme.comments.lazyload ?? false %>);
|
|
4
|
+
|
|
5
|
+
function load_utterances() {
|
|
6
|
+
if (!el) return;
|
|
7
|
+
try {
|
|
8
|
+
el.innerHTML = '';
|
|
9
|
+
} catch (error) {
|
|
10
|
+
console.error(error);
|
|
11
|
+
}
|
|
12
|
+
const script = document.createElement('script');
|
|
13
|
+
script.src = 'https://utteranc.es/client.js';
|
|
14
|
+
script.async = true;
|
|
15
|
+
for (const key of Object.keys(el.attributes)) {
|
|
16
|
+
const attr = el.attributes[key];
|
|
17
|
+
if (['class', 'id'].includes(attr.name) === false) {
|
|
18
|
+
script.setAttribute(attr.name, attr.value);
|
|
10
19
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
script.async = true;
|
|
14
|
-
for (let key of Object.keys(el.attributes)) {
|
|
15
|
-
let attr = el.attributes[key];
|
|
16
|
-
if (['class', 'id'].includes(attr.name) === false) {
|
|
17
|
-
script.setAttribute(attr.name, attr.value);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
el.appendChild(script);
|
|
21
|
-
});
|
|
20
|
+
}
|
|
21
|
+
el.appendChild(script);
|
|
22
22
|
}
|
|
23
|
-
window.addEventListener('DOMContentLoaded', (event) => {
|
|
24
|
-
loadUtterances();
|
|
25
|
-
});
|
|
26
23
|
</script>
|
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
<script type="module">
|
|
2
|
-
import { init } from '<%- theme.comments.waline.js %>'
|
|
2
|
+
import { init } from '<%- theme.comments.waline.js %>';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const el = document.getElementById('waline_container');
|
|
5
|
+
util.viewportLazyload(el, load_waline, <%= theme.comments.lazyload ?? false %>);
|
|
6
|
+
|
|
7
|
+
function load_waline(){
|
|
8
|
+
if (!el) return;
|
|
6
9
|
|
|
7
10
|
utils.css('<%- theme.comments.waline.css %>');
|
|
8
11
|
utils.css('<%- theme.comments.waline.meta_css %>');
|
|
9
12
|
|
|
10
|
-
const
|
|
11
|
-
var path = el.getAttribute('comment_id');
|
|
12
|
-
if (!path) {
|
|
13
|
-
path = decodeURI(window.location.pathname);
|
|
14
|
-
}
|
|
15
|
-
|
|
13
|
+
const path = el.getAttribute('comment_id') ?? decodeURI(window.location.pathname);
|
|
16
14
|
const waline = init(Object.assign(<%- JSON.stringify(theme.comments.waline) %>, {
|
|
17
15
|
el: '#waline_container',
|
|
18
16
|
path: path,
|
|
19
17
|
<% if(!!theme.comments.waline.imageUploader?.api){ %>
|
|
20
18
|
imageUploader: function(file) {
|
|
21
|
-
|
|
19
|
+
const headers = new Headers();
|
|
22
20
|
headers.set('Accept', 'application/json');
|
|
23
21
|
<% if(!!theme.comments.waline.imageUploader?.token) { %>
|
|
24
22
|
headers.set('<%= theme.comments.waline.imageUploader?.tokenName %>', '<%= theme.comments.waline.imageUploader?.token %>')
|
|
25
23
|
<% } %>
|
|
26
|
-
|
|
24
|
+
const formData = new FormData();
|
|
27
25
|
formData.append('<%= theme.comments.waline.imageUploader?.fileName %>', file);
|
|
28
26
|
return fetch('<%= theme.comments.waline.imageUploader?.api %>',{
|
|
29
27
|
method: 'POST',
|
|
@@ -34,10 +32,5 @@
|
|
|
34
32
|
},
|
|
35
33
|
<% } %>
|
|
36
34
|
}));
|
|
37
|
-
|
|
38
35
|
}
|
|
39
|
-
window.addEventListener('DOMContentLoaded', (event) => {
|
|
40
|
-
load_comment();
|
|
41
|
-
});
|
|
42
|
-
|
|
43
36
|
</script>
|
package/layout/_partial/head.ejs
CHANGED
|
@@ -102,8 +102,8 @@ function custom_inject() {
|
|
|
102
102
|
<meta name="HandheldFriendly" content="True" >
|
|
103
103
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
104
104
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
105
|
-
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#f9fafb">
|
|
106
105
|
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#000">
|
|
106
|
+
<meta name="theme-color" content="#f9fafb">
|
|
107
107
|
|
|
108
108
|
<title><%- generate_title() %></title>
|
|
109
109
|
|
|
@@ -53,8 +53,10 @@ function layoutDiv() {
|
|
|
53
53
|
if (theme.article.license && (page.license != false)) {
|
|
54
54
|
license = page.license || theme.article.license
|
|
55
55
|
}
|
|
56
|
+
} else if (page.license) {
|
|
57
|
+
license = page.license === true ? theme.article.license : page.license
|
|
56
58
|
}
|
|
57
|
-
if (license
|
|
59
|
+
if (license?.length > 0) {
|
|
58
60
|
var author = null
|
|
59
61
|
if (theme.authors) {
|
|
60
62
|
if (page.author?.length > 0 && theme.authors[page.author] != null) {
|
|
@@ -84,6 +86,8 @@ function layoutDiv() {
|
|
|
84
86
|
}
|
|
85
87
|
} else if (page.layout == 'post') {
|
|
86
88
|
showSharePlugin = page.share != false
|
|
89
|
+
} else if (page.share) {
|
|
90
|
+
showSharePlugin = true
|
|
87
91
|
}
|
|
88
92
|
if (theme.article.share && showSharePlugin) {
|
|
89
93
|
function socialButtons() {
|
|
@@ -95,7 +99,7 @@ function layoutDiv() {
|
|
|
95
99
|
el += ' target="_blank" rel="external nofollow noopener noreferrer"';
|
|
96
100
|
}
|
|
97
101
|
if (item == 'wechat') {
|
|
98
|
-
el += ' onclick="util.toggle("qrcode-wechat")"';
|
|
102
|
+
el += ' onclick="util.toggle("qrcode-wechat")"';
|
|
99
103
|
} else if (item == 'weibo') {
|
|
100
104
|
el += ' href="https://service.weibo.com/share/share.php?url=' + page.permalink;
|
|
101
105
|
el += '&title=' + page.title + ' - ' + config.title;
|
|
@@ -4,7 +4,7 @@ function layoutDiv() {
|
|
|
4
4
|
var el = '';
|
|
5
5
|
el += `<div class="related-wrap${scrollreveal(' ')}" id="related-posts">`
|
|
6
6
|
el += popular_posts_wrapper({
|
|
7
|
-
title: __('meta.related_posts'),
|
|
7
|
+
title: theme.article.related_posts.title || __('meta.related_posts'),
|
|
8
8
|
json: popular_posts_json({ maxCount: theme.article.related_posts.max_count , ulClass: 'related-posts' , PPMixingRate: 0.2 , isImage: true , isExcerpt: true} , page )
|
|
9
9
|
});
|
|
10
10
|
el += '</div>';
|
|
@@ -34,6 +34,8 @@ function layoutBreadcrumb() {
|
|
|
34
34
|
el += `<a class="cap breadcrumb" href="${url_for(config.root)}">${__("btn.home")}</a>`
|
|
35
35
|
if (theme.wiki.tree[page.wiki]) {
|
|
36
36
|
el += partial('breadcrumb/wiki')
|
|
37
|
+
} else if (page.notebook) {
|
|
38
|
+
el += partial('breadcrumb/note')
|
|
37
39
|
} else if (page.layout == 'post') {
|
|
38
40
|
el += partial('breadcrumb/blog')
|
|
39
41
|
} else {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<%# 笔记页面的面包屑 %>
|
|
2
|
+
<span class="sep"></span>
|
|
3
|
+
<a class="cap breadcrumb" href="<%= url_for(theme.site_tree.notebooks.base_dir) %>"><%= __('btn.notebook') %></a>
|
|
4
|
+
<% const notebook = theme.notebooks.tree[page.notebook] %>
|
|
5
|
+
<% if (notebook) { %>
|
|
6
|
+
<span class="sep"></span>
|
|
7
|
+
<a class="cap breadcrumb" href="<%= url_for(notebook.base_dir) %>"><%= notebook.name || notebook.title %></a>
|
|
8
|
+
<% } %>
|
|
@@ -7,6 +7,17 @@ function layoutDiv() {
|
|
|
7
7
|
el += `<span class="text created">${__("meta.updated") + __("symbol.colon")}`
|
|
8
8
|
el += `<time datetime="${date_xml(page.updated)}">${date(page.updated, config.date_format)}</time>`
|
|
9
9
|
el += `</span>`
|
|
10
|
+
} else if (page.notebook) {
|
|
11
|
+
// 更新日期
|
|
12
|
+
el += `<span class="text created">${__("meta.updated") + __("symbol.colon")}`
|
|
13
|
+
el += `<time datetime="${date_xml(page.updated)}">${date(page.updated, config.date_format)}</time>`
|
|
14
|
+
el += `</span>`
|
|
15
|
+
// 发布日期
|
|
16
|
+
el += `<span class="sep updated"></span>`
|
|
17
|
+
el += `<span class="text updated">`
|
|
18
|
+
el += `${__("meta.created") + __("symbol.colon")}`
|
|
19
|
+
el += `<time datetime="${date_xml(page.date)}">${date(page.date, config.date_format)}</time>`
|
|
20
|
+
el += `</span>`
|
|
10
21
|
} else {
|
|
11
22
|
const author = theme.authors ? (theme.authors[page.author] || theme.default_author) : null
|
|
12
23
|
if (author) {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<%# 笔记卡片 %>
|
|
2
|
+
<article class="md-text">
|
|
3
|
+
<% if (note.cover) { %>
|
|
4
|
+
<div class="post-cover">
|
|
5
|
+
<img src="<%= note.cover %>" alt="cover" />
|
|
6
|
+
</div>
|
|
7
|
+
<% } %>
|
|
8
|
+
<h2 class="post-title"><%= note.title %></h2>
|
|
9
|
+
<div class="excerpt<% if (theme.plugins.heti?.enable) { %> heti<% } %>">
|
|
10
|
+
<p>
|
|
11
|
+
<% if (note.excerpt) { %>
|
|
12
|
+
<%= strip_html(note.excerpt) %>
|
|
13
|
+
<% } else if (note.description) { %>
|
|
14
|
+
<%= note.description %>
|
|
15
|
+
<% } else if (note.content && theme.notebook.auto_excerpt > 0) { %>
|
|
16
|
+
<%= truncate(strip_html(note.content), { length: theme.notebook.auto_excerpt }) %>
|
|
17
|
+
<% } %>
|
|
18
|
+
</p>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="meta cap">
|
|
21
|
+
<% if (note.pin) { %>
|
|
22
|
+
<span class="pin"><%- icon('solar:pin-linear') %></span>
|
|
23
|
+
<% } %>
|
|
24
|
+
<span class="cap" id="post-meta">
|
|
25
|
+
<%- icon('default:calendar') %>
|
|
26
|
+
<time datetime="<%= date_xml(note.updated || note.date) %>"><%= date(note.updated || note.date, config.date_format) %></time>
|
|
27
|
+
</span>
|
|
28
|
+
<% if (note.tags) { %>
|
|
29
|
+
<% note.tags.forEach((tag, i) => { %>
|
|
30
|
+
<span class="cap breadcrumb" %>>
|
|
31
|
+
<span class="tag"><%= tag %></span>
|
|
32
|
+
</span>
|
|
33
|
+
<% }) %>
|
|
34
|
+
<% } %>
|
|
35
|
+
</div>
|
|
36
|
+
</article>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<%# 笔记本信息卡片 %>
|
|
2
|
+
<article class="md-text">
|
|
3
|
+
<div class="preview"><img src="<%= notebook.icon || theme.default.project %>" alt="icon"/></div>
|
|
4
|
+
<div class="excerpt">
|
|
5
|
+
<h2 class="post-title"><%= notebook.title || notebook.name %></h2>
|
|
6
|
+
<% if (notebook.description) { %>
|
|
7
|
+
<p><%= notebook.description %></p>
|
|
8
|
+
<% } %>
|
|
9
|
+
</div>
|
|
10
|
+
</article>
|