hexo-theme-stellar 1.32.3 → 1.33.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 +27 -7
- package/_data/icons.yml +9 -2
- package/languages/en.yml +1 -0
- package/languages/zh-CN.yml +1 -0
- package/languages/zh-TW.yml +1 -0
- package/layout/_partial/comments/artalk/script.ejs +8 -7
- package/layout/_partial/head.ejs +7 -5
- package/layout/_partial/main/article/article_footer.ejs +8 -0
- package/layout/_partial/main/article/contributors.ejs +34 -0
- package/layout/_partial/main/article/read_next.ejs +2 -2
- package/layout/_partial/main/navbar/article_banner.ejs +1 -1
- package/layout/_partial/main/navbar/breadcrumb/blog.ejs +3 -3
- package/layout/_partial/main/navbar/breadcrumb/note.ejs +2 -2
- package/layout/_partial/main/navbar/breadcrumb/page.ejs +1 -1
- package/layout/_partial/main/navbar/breadcrumb/wiki.ejs +2 -2
- package/layout/_partial/main/navbar/dateinfo.ejs +1 -1
- package/layout/_partial/main/navbar/ghinfo.ejs +1 -1
- package/layout/_partial/main/navbar/nav_tabs_blog.ejs +12 -12
- package/layout/_partial/main/navbar/nav_tabs_wiki.ejs +2 -2
- package/layout/_partial/main/notebook/note_tags.ejs +1 -1
- package/layout/_partial/scripts/lazyload.ejs +1 -1
- package/layout/_partial/scripts/utils.ejs +69 -37
- package/layout/_partial/sidebar/index_leftbar.ejs +1 -1
- package/layout/_partial/sidebar/logo.ejs +1 -1
- package/layout/_partial/sidebar/menu.ejs +1 -1
- package/layout/_partial/widgets/components/link.ejs +1 -1
- package/layout/_partial/widgets/ghissues.ejs +7 -1
- package/layout/_partial/widgets/ghrepo.ejs +2 -2
- package/layout/_partial/widgets/ghuser.ejs +1 -1
- package/layout/_partial/widgets/recent.ejs +1 -1
- package/layout/_partial/widgets/related.ejs +2 -2
- package/layout/_partial/widgets/tagtree.ejs +1 -1
- package/layout/_partial/widgets/timeline.ejs +7 -1
- package/layout/_partial/widgets/toc.ejs +1 -3
- package/layout/_partial/widgets/tree.ejs +1 -1
- package/layout/archive.ejs +1 -1
- package/layout/categories.ejs +1 -1
- package/layout/index.ejs +1 -1
- package/layout/index_topic.ejs +1 -1
- package/layout/index_wiki.ejs +2 -2
- package/layout/notebooks.ejs +1 -1
- package/layout/notes.ejs +1 -1
- package/layout/tags.ejs +1 -1
- package/package.json +1 -1
- package/scripts/events/index.js +1 -1
- package/scripts/events/lib/config.js +7 -1
- package/scripts/filters/pretty_urls.js +25 -0
- package/scripts/generators/notebooks.js +27 -26
- package/scripts/helpers/json_ld.js +5 -4
- package/scripts/helpers/pretty_url.js +22 -0
- package/scripts/tags/index.js +2 -0
- package/scripts/tags/lib/albums.js +1 -1
- package/scripts/tags/lib/chat.js +1 -1
- package/scripts/tags/lib/friends.js +1 -1
- package/scripts/tags/lib/link.js +1 -1
- package/scripts/tags/lib/posters.js +1 -1
- package/scripts/tags/lib/rating.js +32 -0
- package/scripts/tags/lib/sites.js +1 -1
- package/scripts/tags/lib/timeline.js +2 -1
- package/scripts/tags/lib/vote.js +28 -0
- package/source/css/_common/button.styl +1 -0
- package/source/css/_common/loading.styl +1 -0
- package/source/css/_components/pages/article-story.styl +2 -0
- package/source/css/_components/partial/article-footer.styl +48 -0
- package/source/css/_components/partial/paginator.styl +1 -1
- package/source/css/_components/tag-plugins/friends.styl +1 -1
- package/source/css/_components/tag-plugins/image.styl +1 -0
- package/source/css/_components/tag-plugins/rating.styl +39 -0
- package/source/css/_components/tag-plugins/timeline.styl +7 -4
- package/source/css/_components/tag-plugins/vote.styl +49 -0
- package/source/css/_components/widgets/timeline.styl +1 -1
- package/source/css/_defines/theme_base.styl +1 -0
- package/source/css/_plugins/comments/artalk.styl +53 -10
- package/source/css/_plugins/lazyload.styl +4 -0
- package/source/js/main.js +12 -5
- package/source/js/search/local-search.js +3 -1
- package/source/js/services/artalk_latest_comment.js +1 -1
- package/source/js/services/contributors.js +56 -0
- package/source/js/services/fcircle.js +1 -1
- package/source/js/services/friends.js +1 -1
- package/source/js/services/friends_and_posts.js +1 -1
- package/source/js/services/ghinfo.js +1 -1
- package/source/js/services/giscus_latest_comment.js +1 -1
- package/source/js/services/memos.js +1 -1
- package/source/js/services/rating.js +142 -0
- package/source/js/services/siteinfo.js +1 -1
- package/source/js/services/sites.js +1 -1
- package/source/js/services/timeline.js +1 -1
- package/source/js/services/twikoo_latest_comment.js +1 -1
- package/source/js/services/vote.js +113 -0
- package/source/js/services/waline_latest_comment.js +1 -1
- package/source/js/services/weibo.js +1 -1
- package/layout/_partial/widgets/components/edit.ejs +0 -24
package/_config.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
######## Stellar info ########
|
|
2
2
|
stellar:
|
|
3
|
-
version: '1.
|
|
3
|
+
version: '1.33.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
|
|
@@ -392,12 +392,12 @@ tag_plugins:
|
|
|
392
392
|
prefix: ph:seal-question-fill
|
|
393
393
|
# {% emoji %}
|
|
394
394
|
emoji:
|
|
395
|
-
default: https://gcore.jsdelivr.net/gh/cdn-x/emoji/qq/{name}.gif
|
|
395
|
+
default: https://gcore.jsdelivr.net/gh/cdn-x/emoji@2.1.2/qq/{name}.gif
|
|
396
396
|
twemoji: https://gcore.jsdelivr.net/gh/twitter/twemoji/assets/svg/{name}.svg
|
|
397
|
-
qq: https://gcore.jsdelivr.net/gh/cdn-x/emoji/qq/{name}.gif
|
|
398
|
-
aru: https://gcore.jsdelivr.net/gh/cdn-x/emoji/aru
|
|
399
|
-
tieba: https://gcore.jsdelivr.net/gh/cdn-x/emoji/tieba/{name}.png
|
|
400
|
-
blobcat: https://gcore.jsdelivr.net/gh/
|
|
397
|
+
qq: https://gcore.jsdelivr.net/gh/cdn-x/emoji@2.1.2/qq/{name}.gif
|
|
398
|
+
aru: https://gcore.jsdelivr.net/gh/cdn-x/emoji@2.1.2/aru/{name}.gif
|
|
399
|
+
tieba: https://gcore.jsdelivr.net/gh/cdn-x/emoji@2.1.2/tieba/{name}.png
|
|
400
|
+
blobcat: https://gcore.jsdelivr.net/gh/cdn-x/emoji@2.1.2/blobcat/{name}.gif
|
|
401
401
|
icon:
|
|
402
402
|
# 留空时,图标和文字颜色相同
|
|
403
403
|
default_color: accent # theme, accent, red, orange, yellow, green, cyan, blue, purple
|
|
@@ -471,6 +471,14 @@ data_services:
|
|
|
471
471
|
api:
|
|
472
472
|
ghinfo:
|
|
473
473
|
js: /js/services/ghinfo.js
|
|
474
|
+
# 打分
|
|
475
|
+
rating:
|
|
476
|
+
js: /js/services/rating.js
|
|
477
|
+
api: https://star-vote.xaox.cc/api/rating
|
|
478
|
+
# 投票
|
|
479
|
+
vote:
|
|
480
|
+
js: /js/services/vote.js
|
|
481
|
+
api: https://star-vote.xaox.cc/api/vote
|
|
474
482
|
# 网格布局类
|
|
475
483
|
sites:
|
|
476
484
|
js: /js/services/sites.js
|
|
@@ -503,6 +511,11 @@ data_services:
|
|
|
503
511
|
js: /js/services/artalk_latest_comment.js
|
|
504
512
|
giscus:
|
|
505
513
|
js: /js/services/giscus_latest_comment.js
|
|
514
|
+
contributors:
|
|
515
|
+
edit_this_page: # 从开头开始匹配替换
|
|
516
|
+
'_posts/': # https://github.com/xaoxuu/xaoxuu.com/blob/main/source/_posts/
|
|
517
|
+
'wiki/stellar/': https://github.com/xaoxuu/hexo-theme-stellar-docs/blob/main/
|
|
518
|
+
js: /js/services/contributors.js
|
|
506
519
|
|
|
507
520
|
|
|
508
521
|
# 扩展插件接入方法:(插件名下面用 #plugin# 代替)
|
|
@@ -703,4 +716,11 @@ api_host:
|
|
|
703
716
|
ghraw: raw.githubusercontent.com
|
|
704
717
|
gist: gist.github.com
|
|
705
718
|
# https://github.com/anuraghazra/github-readme-stats
|
|
706
|
-
ghcard: github-readme-stats.vercel.app
|
|
719
|
+
ghcard: github-readme-stats.vercel.app
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
# 非资深hexo开发者尽量不要动这块
|
|
724
|
+
system:
|
|
725
|
+
# hexo 支持输出的链接格式众多,维护成本高,为了减少出错,统一成推荐的格式。
|
|
726
|
+
override_pretty_urls: true
|
package/_data/icons.yml
CHANGED
|
@@ -30,7 +30,7 @@ default:calendar: <svg style="margin-bottom:2px" xmlns="http://www.w3.org/2000/s
|
|
|
30
30
|
default:category: <svg style="margin-bottom:1px" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M2 6.95c0-.883 0-1.324.07-1.692A4 4 0 0 1 5.257 2.07C5.626 2 6.068 2 6.95 2c.386 0 .58 0 .766.017a4 4 0 0 1 2.18.904c.144.119.28.255.554.529L11 4c.816.816 1.224 1.224 1.712 1.495a4 4 0 0 0 .848.352C14.098 6 14.675 6 15.828 6h.374c2.632 0 3.949 0 4.804.77c.079.07.154.145.224.224c.77.855.77 2.172.77 4.804V14c0 3.771 0 5.657-1.172 6.828C19.657 22 17.771 22 14 22h-4c-3.771 0-5.657 0-6.828-1.172C2 19.657 2 17.771 2 14z" opacity=".5"/><path fill="currentColor" d="M20 6.238c0-.298-.005-.475-.025-.63a3 3 0 0 0-2.583-2.582C17.197 3 16.965 3 16.5 3H9.988c.116.104.247.234.462.45L11 4c.816.816 1.224 1.224 1.712 1.495a4 4 0 0 0 .849.352C14.098 6 14.675 6 15.829 6h.373c1.78 0 2.957 0 3.798.238"/><path fill="currentColor" fill-rule="evenodd" d="M12.25 10a.75.75 0 0 1 .75-.75h5a.75.75 0 0 1 0 1.5h-5a.75.75 0 0 1-.75-.75" clip-rule="evenodd"/></svg>
|
|
31
31
|
|
|
32
32
|
# 编辑本文
|
|
33
|
-
default:edit: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Solar by 480 Design - https://creativecommons.org/licenses/by/4.0/ --><
|
|
33
|
+
default:edit: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Solar by 480 Design - https://creativecommons.org/licenses/by/4.0/ --><circle cx="12" cy="12" r="10" fill="currentColor" opacity=".5"/><path fill="currentColor" d="M13.926 14.302c.245-.191.467-.413.912-.858l5.54-5.54c.134-.134.073-.365-.106-.427a6.1 6.1 0 0 1-2.3-1.449a6.1 6.1 0 0 1-1.45-2.3c-.061-.18-.292-.24-.426-.106l-5.54 5.54c-.445.444-.667.667-.858.912a5 5 0 0 0-.577.932c-.133.28-.233.579-.431 1.175l-.257.77l-.409 1.226l-.382 1.148a.817.817 0 0 0 1.032 1.033l1.15-.383l1.224-.408l.77-.257c.597-.199.895-.298 1.175-.432q.498-.237.933-.576m8.187-8.132a3.028 3.028 0 0 0-4.282-4.283l-.179.178a.73.73 0 0 0-.206.651c.027.15.077.37.168.633a4.9 4.9 0 0 0 1.174 1.863a4.9 4.9 0 0 0 1.862 1.174c.263.09.483.141.633.168c.24.043.48-.035.652-.207z"/></svg>
|
|
34
34
|
default:upup: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Solar by 480 Design - https://creativecommons.org/licenses/by/4.0/ --><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="1.5"><path stroke-linejoin="round" d="m9 15.5l3-3l3 3m-6-4l3-3l3 3"/><path d="M7 3.338A9.95 9.95 0 0 1 12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12c0-1.821.487-3.53 1.338-5"/></g></svg>
|
|
35
35
|
default:tocomment: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Solar by 480 Design - https://creativecommons.org/licenses/by/4.0/ --><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="M8 10.5h8M8 14h5.5M17 3.338A9.95 9.95 0 0 0 12 2C6.477 2 2 6.477 2 12c0 1.6.376 3.112 1.043 4.453c.178.356.237.763.134 1.148l-.595 2.226a1.3 1.3 0 0 0 1.591 1.592l2.226-.596a1.63 1.63 0 0 1 1.149.133A9.96 9.96 0 0 0 12 22c5.523 0 10-4.477 10-10c0-1.821-.487-3.53-1.338-5"/></svg>
|
|
36
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>
|
|
@@ -49,4 +49,11 @@ share:link: https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.12/social/8411ed
|
|
|
49
49
|
# quot icons
|
|
50
50
|
ph:seal-question-fill: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 256 256"><path fill="currentColor" d="M225.86 102.82c-3.77-3.94-7.67-8-9.14-11.57c-1.36-3.27-1.44-8.69-1.52-13.94c-.15-9.76-.31-20.82-8-28.51s-18.75-7.85-28.51-8c-5.25-.08-10.67-.16-13.94-1.52c-3.56-1.47-7.63-5.37-11.57-9.14C146.28 23.51 138.44 16 128 16s-18.27 7.51-25.18 14.14c-3.94 3.77-8 7.67-11.57 9.14c-3.25 1.36-8.69 1.44-13.94 1.52c-9.76.15-20.82.31-28.51 8s-7.8 18.75-8 28.51c-.08 5.25-.16 10.67-1.52 13.94c-1.47 3.56-5.37 7.63-9.14 11.57C23.51 109.72 16 117.56 16 128s7.51 18.27 14.14 25.18c3.77 3.94 7.67 8 9.14 11.57c1.36 3.27 1.44 8.69 1.52 13.94c.15 9.76.31 20.82 8 28.51s18.75 7.85 28.51 8c5.25.08 10.67.16 13.94 1.52c3.56 1.47 7.63 5.37 11.57 9.14c6.9 6.63 14.74 14.14 25.18 14.14s18.27-7.51 25.18-14.14c3.94-3.77 8-7.67 11.57-9.14c3.27-1.36 8.69-1.44 13.94-1.52c9.76-.15 20.82-.31 28.51-8s7.85-18.75 8-28.51c.08-5.25.16-10.67 1.52-13.94c1.47-3.56 5.37-7.63 9.14-11.57c6.63-6.9 14.14-14.74 14.14-25.18s-7.51-18.27-14.14-25.18M128 192a12 12 0 1 1 12-12a12 12 0 0 1-12 12m8-48.72v.72a8 8 0 0 1-16 0v-8a8 8 0 0 1 8-8c13.23 0 24-9 24-20s-10.77-20-24-20s-24 9-24 20v4a8 8 0 0 1-16 0v-4c0-19.85 17.94-36 40-36s40 16.15 40 36c0 17.38-13.76 31.93-32 35.28"/></svg>
|
|
51
51
|
bxs:quote-left: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from BoxIcons Solid by Atisa - https://creativecommons.org/licenses/by/4.0/ --><path fill="currentColor" d="M3.691 6.292C5.094 4.771 7.217 4 10 4h1v2.819l-.804.161c-1.37.274-2.323.813-2.833 1.604A2.9 2.9 0 0 0 6.925 10H10a1 1 0 0 1 1 1v7c0 1.103-.897 2-2 2H3a1 1 0 0 1-1-1v-5l.003-2.919c-.009-.111-.199-2.741 1.688-4.789M20 20h-6a1 1 0 0 1-1-1v-5l.003-2.919c-.009-.111-.199-2.741 1.688-4.789C16.094 4.771 18.217 4 21 4h1v2.819l-.804.161c-1.37.274-2.323.813-2.833 1.604A2.9 2.9 0 0 0 17.925 10H21a1 1 0 0 1 1 1v7c0 1.103-.897 2-2 2"/></svg>
|
|
52
|
-
bxs:quote-right: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from BoxIcons Solid by Atisa - https://creativecommons.org/licenses/by/4.0/ --><path fill="currentColor" d="M20.309 17.708C22.196 15.66 22.006 13.03 22 13V5a1 1 0 0 0-1-1h-6c-1.103 0-2 .897-2 2v7a1 1 0 0 0 1 1h3.078a2.9 2.9 0 0 1-.429 1.396c-.508.801-1.465 1.348-2.846 1.624l-.803.16V20h1c2.783 0 4.906-.771 6.309-2.292m-11.007 0C11.19 15.66 10.999 13.03 10.993 13V5a1 1 0 0 0-1-1h-6c-1.103 0-2 .897-2 2v7a1 1 0 0 0 1 1h3.078a2.9 2.9 0 0 1-.429 1.396c-.508.801-1.465 1.348-2.846 1.624l-.803.16V20h1c2.783 0 4.906-.771 6.309-2.292"/></svg>
|
|
52
|
+
bxs:quote-right: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from BoxIcons Solid by Atisa - https://creativecommons.org/licenses/by/4.0/ --><path fill="currentColor" d="M20.309 17.708C22.196 15.66 22.006 13.03 22 13V5a1 1 0 0 0-1-1h-6c-1.103 0-2 .897-2 2v7a1 1 0 0 0 1 1h3.078a2.9 2.9 0 0 1-.429 1.396c-.508.801-1.465 1.348-2.846 1.624l-.803.16V20h1c2.783 0 4.906-.771 6.309-2.292m-11.007 0C11.19 15.66 10.999 13.03 10.993 13V5a1 1 0 0 0-1-1h-6c-1.103 0-2 .897-2 2v7a1 1 0 0 0 1 1h3.078a2.9 2.9 0 0 1-.429 1.396c-.508.801-1.465 1.348-2.846 1.624l-.803.16V20h1c2.783 0 4.906-.771 6.309-2.292"/></svg>
|
|
53
|
+
|
|
54
|
+
# vote
|
|
55
|
+
vote:thumbsup: <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16"><!-- Icon from Codicons by Microsoft Corporation - https://github.com/microsoft/vscode-codicons/blob/main/LICENSE --><path fill="currentColor" d="M1 8.5v5c0 .827.673 1.5 1.5 1.5H4V7H2.5C1.673 7 1 7.673 1 8.5m13.571-1.685A1.98 1.98 0 0 0 12.959 6H9.526l.464-2.32a2.24 2.24 0 0 0-.464-1.86A2.23 2.23 0 0 0 7.794 1c-.444 0-.839.298-.951.693l-.464 1.286a16 16 0 0 1-1.378 2.876V15h6.397a1.99 1.99 0 0 0 1.909-1.404l1.562-5a1.98 1.98 0 0 0-.298-1.781"/></svg>
|
|
56
|
+
vote:thumbsdown: <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16"><!-- Icon from Codicons by Microsoft Corporation - https://github.com/microsoft/vscode-codicons/blob/main/LICENSE --><path fill="currentColor" d="M15 7.5v-5c0-.827-.673-1.5-1.5-1.5H12v8h1.5c.827 0 1.5-.673 1.5-1.5M1.429 9.185c.38.518.969.815 1.612.815h3.433l-.464 2.32a2.24 2.24 0 0 0 .464 1.86c.427.521 1.059.82 1.732.82c.444 0 .839-.298.95-.693l.465-1.286a16 16 0 0 1 1.378-2.876V1H4.602a1.99 1.99 0 0 0-1.91 1.404l-1.561 5a1.98 1.98 0 0 0 .297 1.781"/></svg>
|
|
57
|
+
|
|
58
|
+
# rating
|
|
59
|
+
rating:star: <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 48 48"><!-- Icon from Fluent UI System Color Icons by Microsoft Corporation - https://github.com/microsoft/fluentui-system-icons/blob/main/LICENSE --><g fill="none"><path fill="url(#fluentColorStar480)" d="M21.803 6.086c.899-1.821 3.495-1.821 4.394 0l4.852 9.832l10.85 1.576c2.01.293 2.813 2.762 1.358 4.18l-7.85 7.653l1.853 10.806c.343 2.001-1.758 3.528-3.555 2.583L24 37.614l-9.705 5.102c-1.797.945-3.898-.582-3.555-2.583l1.854-10.806l-7.851-7.654c-1.455-1.417-.652-3.886 1.357-4.178l10.85-1.577z"/><defs><linearGradient id="fluentColorStar480" x1="43.995" x2="2.879" y1="43.856" y2="5.054" gradientUnits="userSpaceOnUse"><stop stop-color="#FF6F47"/><stop offset="1" stop-color="#FFCD0F"/></linearGradient></defs></g></svg>
|
package/languages/en.yml
CHANGED
package/languages/zh-CN.yml
CHANGED
package/languages/zh-TW.yml
CHANGED
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
utils.css('<%- theme.comments.artalk.css %>');
|
|
8
8
|
utils.js('<%- theme.comments.artalk.js %>', {defer: true}).then(function () {
|
|
9
9
|
// 监听 Artalk 事件
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
// FIXME: Artalk开启了懒加载会导致评论输入预览框里的图也变成data-src,导致看不到图
|
|
11
|
+
// Artalk.use((ctx) => {
|
|
12
|
+
// ctx.on('list-loaded', () => window.lazyLoadInstance?.update())
|
|
13
|
+
// })
|
|
13
14
|
const path = el.getAttribute('comment_id') ?? decodeURI(window.location.pathname);
|
|
14
15
|
const artalk = Artalk.init({
|
|
15
16
|
el: '#artalk_container',
|
|
@@ -23,17 +24,17 @@
|
|
|
23
24
|
let headers = new Headers();
|
|
24
25
|
headers.set('Accept', 'application/json');
|
|
25
26
|
<% if (theme.comments.artalk.imageUploader?.token) { %>
|
|
26
|
-
headers.set('Authorization', '
|
|
27
|
+
headers.set('Authorization', '<%- theme.comments.artalk.imageUploader?.token %>')
|
|
27
28
|
<% } %>
|
|
28
29
|
let formData = new FormData();
|
|
29
30
|
formData.append('file', file);
|
|
30
|
-
return fetch('
|
|
31
|
+
return fetch('<%- theme.comments.artalk.imageUploader?.api %>',{
|
|
31
32
|
method: 'POST',
|
|
32
33
|
body: formData,
|
|
33
34
|
headers: headers
|
|
34
35
|
}).then((resp) => resp.json())
|
|
35
|
-
.then((resp) => resp
|
|
36
|
-
|
|
36
|
+
.then((resp) => resp.<%- theme.comments.artalk.imageUploader?.resp %>)
|
|
37
|
+
},
|
|
37
38
|
<% } %>
|
|
38
39
|
});
|
|
39
40
|
});
|
package/layout/_partial/head.ejs
CHANGED
|
@@ -95,12 +95,14 @@ function custom_inject() {
|
|
|
95
95
|
function generate_canonical() {
|
|
96
96
|
const originalHost = theme.canonical.originalHost || '';
|
|
97
97
|
if (originalHost.length > 0) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const path = page.path.replace(/index\.html$/, '') || '/';
|
|
102
|
-
return `<link rel="canonical" href="https://${originalHost}/${path}">`;
|
|
98
|
+
var path = pretty_url(page.path) || '/';
|
|
99
|
+
if (path.startsWith('/404') || path.startsWith('404')) {
|
|
100
|
+
return '';
|
|
103
101
|
}
|
|
102
|
+
if (path.endsWith('.html') && path.length > 5) {
|
|
103
|
+
path = path.split('.html')[0];
|
|
104
|
+
}
|
|
105
|
+
return `<link rel="canonical" href="https://${originalHost}${path}">`;
|
|
104
106
|
}
|
|
105
107
|
return '';
|
|
106
108
|
}
|
|
@@ -11,6 +11,10 @@ function layoutDiv() {
|
|
|
11
11
|
if (theme.article.share?.length > 0) {
|
|
12
12
|
item.push('share');
|
|
13
13
|
}
|
|
14
|
+
var contributors = partial('contributors', {map: theme.data_services.contributors.edit_this_page})
|
|
15
|
+
if (contributors?.trim().length > 0) {
|
|
16
|
+
item.push('contributors')
|
|
17
|
+
}
|
|
14
18
|
if (item.length === 0) {
|
|
15
19
|
return el;
|
|
16
20
|
}
|
|
@@ -76,6 +80,10 @@ function layoutDiv() {
|
|
|
76
80
|
`
|
|
77
81
|
}
|
|
78
82
|
|
|
83
|
+
if (contributors) {
|
|
84
|
+
el += contributors
|
|
85
|
+
}
|
|
86
|
+
|
|
79
87
|
var showSharePlugin = false
|
|
80
88
|
if (page.wiki) {
|
|
81
89
|
const proj = theme.wiki.tree[page.wiki]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<%
|
|
2
|
+
function parseURL() {
|
|
3
|
+
const source = page.source || ''
|
|
4
|
+
for (let id of Object.keys(map)) {
|
|
5
|
+
if (source.startsWith(id) && map[id]) {
|
|
6
|
+
return source.replace(id, map[id])
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function layoutDiv() {
|
|
11
|
+
const url = parseURL()
|
|
12
|
+
if (url == null) {
|
|
13
|
+
return ''
|
|
14
|
+
}
|
|
15
|
+
const commits = url.replace('/github.com/', `/${theme.api_host.ghapi}/repos/`).replace('/blob/main/', '/commits?path=');
|
|
16
|
+
var el = `
|
|
17
|
+
<section id="contributors">
|
|
18
|
+
<div class="header">
|
|
19
|
+
<span>${__('meta.contributors')}</span>
|
|
20
|
+
<span class="spacer"></span>
|
|
21
|
+
<a class="edit" href="${url_for(url)}">
|
|
22
|
+
${icon('default:edit')}
|
|
23
|
+
<span>${__('btn.edit')}</span>
|
|
24
|
+
</a>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="body">
|
|
27
|
+
<div class="ds-contributors users-wrap" api-type="commits" data-api="${commits}"><div class="grid-box"></div></div>
|
|
28
|
+
</div>
|
|
29
|
+
</section>
|
|
30
|
+
`
|
|
31
|
+
return el
|
|
32
|
+
}
|
|
33
|
+
%>
|
|
34
|
+
<%- layoutDiv() %>
|
|
@@ -39,7 +39,7 @@ function layoutDiv() {
|
|
|
39
39
|
el += '<div class="item" id="prev">';
|
|
40
40
|
if (prev) {
|
|
41
41
|
el += '<div class="note">' + title_prev + '</div>';
|
|
42
|
-
el += '<a href="' +
|
|
42
|
+
el += '<a href="' + pretty_url(prev.path) + '">';
|
|
43
43
|
el += prev.title || prev.wiki || date(prev.date, config.date_format);
|
|
44
44
|
el += '</a>';
|
|
45
45
|
}
|
|
@@ -48,7 +48,7 @@ function layoutDiv() {
|
|
|
48
48
|
el += '<div class="item" id="next">';
|
|
49
49
|
if (next) {
|
|
50
50
|
el += '<div class="note">' + title_next + '</div>';
|
|
51
|
-
el += '<a href="' +
|
|
51
|
+
el += '<a href="' + pretty_url(next.path) + '">';
|
|
52
52
|
el += next.title || next.wiki || date(next.date, config.date_format);
|
|
53
53
|
el += '</a>';
|
|
54
54
|
}
|
|
@@ -31,7 +31,7 @@ function layoutBreadcrumb() {
|
|
|
31
31
|
// 3.left.top: 面包屑导航
|
|
32
32
|
el += `<div class="flex-row" id="breadcrumb">`
|
|
33
33
|
// 首页
|
|
34
|
-
el += `<a class="cap breadcrumb" href="${
|
|
34
|
+
el += `<a class="cap breadcrumb" href="${pretty_url(config.root)}">${__("btn.home")}</a>`
|
|
35
35
|
if (theme.wiki.tree[page.wiki]) {
|
|
36
36
|
el += partial('breadcrumb/wiki')
|
|
37
37
|
} else if (page.notebook) {
|
|
@@ -4,11 +4,11 @@ function layoutDiv() {
|
|
|
4
4
|
var el = ''
|
|
5
5
|
if (topicObject) { // 专栏文章
|
|
6
6
|
// 专栏列表页
|
|
7
|
-
const topicIndexPageURL =
|
|
7
|
+
const topicIndexPageURL = pretty_url(theme.site_tree.index_topic.base_dir)
|
|
8
8
|
el += `<span class="sep"></span>`
|
|
9
9
|
el += `<a class="cap breadcrumb" id="menu" href="${topicIndexPageURL}">${__("btn.topic")}</a>`
|
|
10
10
|
// 专栏项目名
|
|
11
|
-
const topicHomePageURL =
|
|
11
|
+
const topicHomePageURL = pretty_url(topicObject.homepage?.path);
|
|
12
12
|
if (topicHomePageURL != topicIndexPageURL) {
|
|
13
13
|
el += `<span class="sep"></span>`
|
|
14
14
|
el += `<a class="cap breadcrumb" id="proj" href="${topicHomePageURL}">${topicObject.name || topicObject.title}</a>`
|
|
@@ -16,7 +16,7 @@ function layoutDiv() {
|
|
|
16
16
|
} else { // 普通文章
|
|
17
17
|
// 文章列表页
|
|
18
18
|
el += `<span class="sep"></span>`
|
|
19
|
-
el += `<a class="cap breadcrumb" href="${
|
|
19
|
+
el += `<a class="cap breadcrumb" href="${pretty_url(config.index_generator.path)}">${__("btn.blog")}</a>`
|
|
20
20
|
// 分类列表页
|
|
21
21
|
if (page.categories?.length > 0) {
|
|
22
22
|
el += `<span class="sep"></span>`
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<%# 笔记页面的面包屑 %>
|
|
2
2
|
<span class="sep"></span>
|
|
3
|
-
<a class="cap breadcrumb" href="<%=
|
|
3
|
+
<a class="cap breadcrumb" href="<%= pretty_url(theme.site_tree.notebooks.base_dir) %>"><%= __('btn.notebook') %></a>
|
|
4
4
|
<% const notebook = theme.notebooks.tree[page.notebook] %>
|
|
5
5
|
<% if (notebook) { %>
|
|
6
6
|
<span class="sep"></span>
|
|
7
|
-
<a class="cap breadcrumb" href="<%=
|
|
7
|
+
<a class="cap breadcrumb" href="<%= pretty_url(notebook.base_dir) %>"><%= notebook.name || notebook.title %></a>
|
|
8
8
|
<% } %>
|
|
@@ -4,11 +4,11 @@ function layoutDiv() {
|
|
|
4
4
|
var el = ''
|
|
5
5
|
// 文档列表页
|
|
6
6
|
el += `<span class="sep"></span>`
|
|
7
|
-
const wikiIndexPageURL =
|
|
7
|
+
const wikiIndexPageURL = pretty_url(theme.site_tree.index_wiki.base_dir)
|
|
8
8
|
el += `<a class="cap breadcrumb" id="menu" href="${wikiIndexPageURL}">${__("btn.wiki")}</a>`
|
|
9
9
|
if (wikiObject) {
|
|
10
10
|
// 文档项目名
|
|
11
|
-
const wikiHomePageURL =
|
|
11
|
+
const wikiHomePageURL = pretty_url(wikiObject.homepage?.path);
|
|
12
12
|
if (wikiHomePageURL != wikiIndexPageURL) {
|
|
13
13
|
el += `<span class="sep"></span>`
|
|
14
14
|
el += `<a class="cap breadcrumb" id="proj" href="${wikiHomePageURL}">${wikiObject.name || wikiObject.title}</a>`
|
|
@@ -21,7 +21,7 @@ function layoutDiv() {
|
|
|
21
21
|
} else {
|
|
22
22
|
const author = theme.authors ? (theme.authors[page.author] || theme.default_author) : null
|
|
23
23
|
if (author) {
|
|
24
|
-
el += `<a class="author" href="${
|
|
24
|
+
el += `<a class="author" href="${pretty_url(author.path)}">${author.name}</a>`
|
|
25
25
|
el += `<span class="sep"></span>`
|
|
26
26
|
}
|
|
27
27
|
// 发布日期
|
|
@@ -5,7 +5,7 @@ function layoutDiv() {
|
|
|
5
5
|
return ''
|
|
6
6
|
}
|
|
7
7
|
return `
|
|
8
|
-
<div class="right ghrepo data-service data-service ds-ghinfo" api="https://${theme.api_host.ghapi}/repos/${repo}">
|
|
8
|
+
<div class="right ghrepo data-service data-service ds-ghinfo" data-api="https://${theme.api_host.ghapi}/repos/${repo}">
|
|
9
9
|
<a class="repo-link bold" href="https://github.com/${repo}">
|
|
10
10
|
${icon('github:repo')}
|
|
11
11
|
<span type="text">${repo}</span>
|
|
@@ -6,44 +6,44 @@ function layoutDiv() {
|
|
|
6
6
|
el += '<div class="navbar-container">';
|
|
7
7
|
el += '<nav class="post">';
|
|
8
8
|
if (is_home()) {
|
|
9
|
-
el += '<a class="active" href="' +
|
|
9
|
+
el += '<a class="active" href="' + pretty_url(config.index_generator.path) + '">' + __("btn.recent_publish") + '</a>';
|
|
10
10
|
} else {
|
|
11
|
-
el += '<a href="' +
|
|
11
|
+
el += '<a href="' + pretty_url(config.index_generator.path) + '">' + __("btn.recent_publish") + '</a>';
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
if (site.categories && site.categories.length > 0) {
|
|
15
15
|
if (page.category) {
|
|
16
|
-
el += '<a class="active" href="' +
|
|
16
|
+
el += '<a class="active" href="' + pretty_url(config.category_dir) + '">' + __("btn.category") + __("symbol.colon") + page.category + '</a>';
|
|
17
17
|
} else if (page.layout == "categories") {
|
|
18
|
-
el += '<a class="active" href="' +
|
|
18
|
+
el += '<a class="active" href="' + pretty_url(config.category_dir) + '">' + __("btn.categories") + '</a>';
|
|
19
19
|
} else {
|
|
20
|
-
el += '<a href="' +
|
|
20
|
+
el += '<a href="' + pretty_url(config.category_dir) + '">' + __("btn.categories") + '</a>';
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
if (site.tags && site.tags.length > 0) {
|
|
25
25
|
if (page.tag) {
|
|
26
|
-
el += '<a class="active" href="' +
|
|
26
|
+
el += '<a class="active" href="' + pretty_url(config.tag_dir) + '">' + __("btn.tag") + __("symbol.colon") + page.tag + '</a>';
|
|
27
27
|
} else if (page.layout == "tags") {
|
|
28
|
-
el += '<a class="active" href="' +
|
|
28
|
+
el += '<a class="active" href="' + pretty_url(config.tag_dir) + '">' + __("btn.tags") + '</a>';
|
|
29
29
|
} else {
|
|
30
|
-
el += '<a href="' +
|
|
30
|
+
el += '<a href="' + pretty_url(config.tag_dir) + '">' + __("btn.tags") + '</a>';
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
if (theme.topic?.publish_list?.length > 0) {
|
|
35
35
|
if (page.layout == 'index_topic') {
|
|
36
|
-
el += '<a class="active" href="' +
|
|
36
|
+
el += '<a class="active" href="' + pretty_url(theme.site_tree.index_topic.base_dir) + '">' + __("btn.topic") + '</a>';
|
|
37
37
|
} else {
|
|
38
|
-
el += '<a href="' +
|
|
38
|
+
el += '<a href="' + pretty_url(theme.site_tree.index_topic.base_dir) + '">' + __("btn.topic") + '</a>';
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
if (site.posts && site.posts.length > 0) {
|
|
43
43
|
if (is_archive()) {
|
|
44
|
-
el += '<a class="active" href="' +
|
|
44
|
+
el += '<a class="active" href="' + pretty_url(config.archive_dir) + '">' + __("btn.archives") + '</a>';
|
|
45
45
|
} else {
|
|
46
|
-
el += '<a href="' +
|
|
46
|
+
el += '<a href="' + pretty_url(config.archive_dir) + '">' + __("btn.archives") + '</a>';
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -10,7 +10,7 @@ function layoutDiv() {
|
|
|
10
10
|
if (page.filter === false) {
|
|
11
11
|
el += ' class="active"';
|
|
12
12
|
}
|
|
13
|
-
el += ' href="' +
|
|
13
|
+
el += ' href="' + pretty_url(theme.site_tree.index_wiki.base_dir) + '">' + __("btn.all_wiki") + '</a>';
|
|
14
14
|
el += '</a>';
|
|
15
15
|
// 项目分类
|
|
16
16
|
const { shelf, all_tags } = theme.wiki;
|
|
@@ -22,7 +22,7 @@ function layoutDiv() {
|
|
|
22
22
|
if (tag.name && tag.name.length > 0 && page.tagName === tag.name) {
|
|
23
23
|
el += ' class="active"';
|
|
24
24
|
}
|
|
25
|
-
el += ' href="' +
|
|
25
|
+
el += ' href="' + pretty_url(tag.path) + '">' + tag.name + '</a>';
|
|
26
26
|
el += '</a>';
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div class="tag-list">
|
|
4
4
|
<% for (const t of page.tags) { %>
|
|
5
5
|
<% const tag = notebook.tagTree.get(t.toLowerCase()) %>
|
|
6
|
-
<a class="tag" href="<%=
|
|
6
|
+
<a class="tag" href="<%= pretty_url(tag.path) %>"><%= tag.name %></a>
|
|
7
7
|
<% } %>
|
|
8
8
|
</div>
|
|
9
9
|
<% } %>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// Set the options globally
|
|
5
5
|
// to make LazyLoad self-initialize
|
|
6
6
|
window.lazyLoadOptions = {
|
|
7
|
-
elements_selector: ".lazy
|
|
7
|
+
elements_selector: ".lazy",
|
|
8
8
|
callback_loaded: (el) => {
|
|
9
9
|
el.classList.add('loaded');
|
|
10
10
|
const wrapper = el.closest('.lazy-box');
|
|
@@ -150,50 +150,82 @@
|
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
152
|
request: (el, url, callback, onFailure) => {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
153
|
+
const maxRetry = 3;
|
|
154
|
+
let retryCount = 0;
|
|
155
|
+
|
|
156
|
+
return new Promise((resolve, reject) => {
|
|
157
|
+
const load = () => {
|
|
158
|
+
utils.onLoading?.(el);
|
|
159
|
+
|
|
160
|
+
let timedOut = false;
|
|
161
|
+
const timeout = setTimeout(() => {
|
|
162
|
+
timedOut = true;
|
|
163
|
+
console.warn('[request] 超时:', url);
|
|
164
|
+
|
|
165
|
+
if (++retryCount >= maxRetry) {
|
|
166
|
+
utils.onLoadFailure?.(el);
|
|
167
|
+
onFailure?.();
|
|
162
168
|
reject('请求超时');
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
169
|
+
} else {
|
|
170
|
+
setTimeout(load, 1000);
|
|
166
171
|
}
|
|
167
172
|
}, 5000);
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
throw new Error('Network response was not ok.');
|
|
179
|
-
}).then(function (data) {
|
|
180
|
-
retryTimes = 0;
|
|
181
|
-
utils.onLoadSuccess(el);
|
|
173
|
+
|
|
174
|
+
fetch(url).then(resp => {
|
|
175
|
+
if (timedOut) return;
|
|
176
|
+
clearTimeout(timeout);
|
|
177
|
+
|
|
178
|
+
if (!resp.ok) throw new Error('响应失败');
|
|
179
|
+
return resp;
|
|
180
|
+
}).then(data => {
|
|
181
|
+
if (timedOut) return;
|
|
182
|
+
utils.onLoadSuccess?.(el);
|
|
182
183
|
callback(data);
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
184
|
+
resolve(data);
|
|
185
|
+
}).catch(err => {
|
|
186
|
+
clearTimeout(timeout);
|
|
187
|
+
console.warn('[request] 错误:', err);
|
|
188
|
+
|
|
189
|
+
if (++retryCount >= maxRetry) {
|
|
190
|
+
utils.onLoadFailure?.(el);
|
|
191
|
+
onFailure?.();
|
|
192
|
+
reject(err);
|
|
189
193
|
} else {
|
|
190
|
-
|
|
191
|
-
onFailure();
|
|
194
|
+
setTimeout(load, 1000);
|
|
192
195
|
}
|
|
193
196
|
});
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
load();
|
|
200
|
+
});
|
|
201
|
+
},
|
|
202
|
+
requestWithoutLoading: (url, options = {}, maxRetry = 2, timeout = 5000) => {
|
|
203
|
+
return new Promise((resolve, reject) => {
|
|
204
|
+
let retryCount = 0;
|
|
205
|
+
|
|
206
|
+
const tryRequest = () => {
|
|
207
|
+
let timedOut = false;
|
|
208
|
+
const timer = setTimeout(() => {
|
|
209
|
+
timedOut = true;
|
|
210
|
+
if (++retryCount > maxRetry) reject('timeout');
|
|
211
|
+
else tryRequest();
|
|
212
|
+
}, timeout);
|
|
213
|
+
|
|
214
|
+
fetch(url, options)
|
|
215
|
+
.then(resp => {
|
|
216
|
+
clearTimeout(timer);
|
|
217
|
+
if (!resp.ok) throw new Error('bad response');
|
|
218
|
+
resolve(resp);
|
|
219
|
+
})
|
|
220
|
+
.catch(err => {
|
|
221
|
+
clearTimeout(timer);
|
|
222
|
+
if (++retryCount > maxRetry) reject(err);
|
|
223
|
+
else setTimeout(tryRequest, 500);
|
|
224
|
+
});
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
tryRequest();
|
|
228
|
+
});
|
|
197
229
|
},
|
|
198
230
|
/********************** requestAnimationFrame ********************************/
|
|
199
231
|
// 1、requestAnimationFrame 会把每一帧中的所有 DOM 操作集中起来,在一次重绘或回流中就完成,并且重绘或回流的时间间隔紧紧跟随浏览器的刷新频率,一般来说,这个频率为每秒60帧。
|
|
@@ -61,7 +61,7 @@ if (typeof page.leftbar == 'string') {
|
|
|
61
61
|
|
|
62
62
|
function layoutTitle(main, url, sub) {
|
|
63
63
|
var el = '';
|
|
64
|
-
el += '<a class="title" href="' +
|
|
64
|
+
el += '<a class="title" href="' + pretty_url(url || "/") + '">';
|
|
65
65
|
el += '<div class="main">' + main + '</div>';
|
|
66
66
|
if (sub) {
|
|
67
67
|
let arr = sub.split('|');
|
|
@@ -22,7 +22,7 @@ if (page.logo) {
|
|
|
22
22
|
// logo.icon, logo.title, logo.subtitle, logo.url
|
|
23
23
|
function layoutTitle(main, url, sub) {
|
|
24
24
|
var el = ''
|
|
25
|
-
el += `<a class="title" href="${
|
|
25
|
+
el += `<a class="title" href="${url || "/"}">`
|
|
26
26
|
el += `<div class="main">${main}</div>`
|
|
27
27
|
if (sub) {
|
|
28
28
|
const arr = sub.split('|')
|
|
@@ -6,7 +6,7 @@ function layoutDiv() {
|
|
|
6
6
|
if (item == undefined || item.id == null || item.url == null) {
|
|
7
7
|
continue
|
|
8
8
|
}
|
|
9
|
-
el += `<a class="nav-item${item.id == page.menu_id ? ' active' : ''}" title="${item.title}" href="${
|
|
9
|
+
el += `<a class="nav-item${item.id == page.menu_id ? ' active' : ''}" title="${item.title}" href="${pretty_url(item.url)}"`
|
|
10
10
|
if (item.theme?.length > 0) {
|
|
11
11
|
el += ` style="color:${item.theme}"`
|
|
12
12
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<%
|
|
2
2
|
function layoutDiv() {
|
|
3
3
|
var el = ''
|
|
4
|
-
const isActive =
|
|
4
|
+
const isActive = pretty_url(item.url) == pretty_url(page.path)
|
|
5
5
|
el += `<a class="link${isActive ? ' active' : ''}" title="${item.title}" href="${item.url}">`
|
|
6
6
|
el += `<div class="flex">`
|
|
7
7
|
if (item.icon) {
|