diff --git a/_config.yml b/_config.yml index fa94399..4f3e53c 100755 --- a/_config.yml +++ b/_config.yml @@ -62,12 +62,12 @@ site_tree: # -- 列表类页面 -- # # 主页配置 home: - sidebar: welcome, recent, timeline + leftbar: welcome, recent, timeline # 博客列表页配置 index_blog: base_dir: blog # 只影响自动生成的页面路径 menu_id: post # 未在 front-matter 中指定 menu_id 时,layout 为 post 的页面默认使用这里配置的 menu_id - sidebar: welcome, recent, timeline # for categories/tags/archives + leftbar: welcome, recent, timeline # for categories/tags/archives nav_tabs: # 近期发布 分类 标签 专栏 归档 and ... # '朋友文章': /friends/rss/ # 博客专栏列表页配置 @@ -78,34 +78,34 @@ site_tree: index_wiki: base_dir: wiki # 只影响自动生成的页面路径 menu_id: wiki # 未在 front-matter 中指定 menu_id 时,layout 为 wiki 的页面默认使用这里配置的 menu_id - sidebar: toc, ghissues, related, recent # for wiki + leftbar: toc, ghissues, related, recent # for wiki nav_tabs: # 'more': https://github.com/xaoxuu # -- 内容类页面 -- # # 博客文章内页配置 post: menu_id: post # 未在 front-matter 中指定 menu_id 时,layout 为 post 的页面默认使用这里配置的 menu_id - sidebar: toc, related, ghrepo, ghissues, recent # for pages using 'layout:post' + leftbar: toc, related, ghrepo, ghissues, recent # for pages using 'layout:post' # 博客专栏文章内页配置 topic: menu_id: post # 文档内页配置 wiki: menu_id: wiki # 未在 front-matter 中指定 menu_id 时,layout 为 wiki 的页面默认使用这里配置的 menu_id - sidebar: toc, ghissues, related, recent # for wiki + leftbar: toc, ghissues, related, recent # for wiki # 作者信息配置 author: base_dir: author # 只影响自动生成的页面路径 menu_id: post - sidebar: recent, timeline + leftbar: recent, timeline # 错误页配置 error_page: menu_id: post '404': '/404.html' - sidebar: recent, timeline + leftbar: recent, timeline # 其它自定义页面配置 layout: page page: - sidebar: toc, recent, timeline + leftbar: toc, recent, timeline @@ -521,11 +521,9 @@ style: gradient: # https://webgradients.com/ start: 'linear-gradient(to right, hsl(215, 95%, 64%), hsl(195, 95%, 60%), hsl(165, 95%, 56%), hsl(165, 95%, 56%), hsl(195 95% 60%), hsl(215, 95%, 64%))' search: 'linear-gradient(to right, #04F3FF, #08FFC6, #DDF730, #FFBD19, #FF1FE0, #C418FF, #04F3FF)' - sidebar: - sticky: false # true/false 屏幕足够宽时,侧边栏是否吸附在正文区域旁边 + leftbar: # 可以设置:纯色/渐变色/图片作为背景 - # background: var(--sidebar-bg) - # background-image: 'linear-gradient(to bottom, var(--sidebar-bg), var(--sidebar-bg))' + # background: var(--leftbar-bg) background-image: url(https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.13/image/sidebar-bg1@small.jpg) blur-px: 100px blur-bg: var(--alpha60) diff --git a/_data/icons.yml b/_data/icons.yml index c44c14b..e438561 100644 --- a/_data/icons.yml +++ b/_data/icons.yml @@ -21,7 +21,7 @@ default:rss: # 侧边栏弹出按钮 -default:sidebar: +default:leftbar: default:pin: default:calendar: default:category: diff --git a/layout/_partial/menubtn.ejs b/layout/_partial/menubtn.ejs index dcdfdd7..fc71874 100644 --- a/layout/_partial/menubtn.ejs +++ b/layout/_partial/menubtn.ejs @@ -1,5 +1,5 @@
diff --git a/layout/_partial/sidebar/index.ejs b/layout/_partial/sidebar/index.ejs index c4c8d45..56ca751 100755 --- a/layout/_partial/sidebar/index.ejs +++ b/layout/_partial/sidebar/index.ejs @@ -3,49 +3,49 @@ const wiki = theme.wiki.tree[page.wiki] const topic = theme.topic.tree[page.topic] -if (page.sidebar == null) { +if (page.leftbar == null) { const { site_tree } = theme var sidebar if (is_home()) { - sidebar = site_tree.home.sidebar + sidebar = site_tree.home.leftbar } else if (is_category() || is_tag() || is_archive() || ['categories', 'tags', 'archives'].includes(page.layout)) { - sidebar = site_tree.index_blog.sidebar + sidebar = site_tree.index_blog.leftbar } else if (page.layout === 'index_topic') { // 专栏列表页等同于博客列表页 - sidebar = site_tree.index_blog.sidebar + sidebar = site_tree.index_blog.leftbar } else if (page.topic?.length > 0) { // 专栏文章内页等同于普通文章内页 - sidebar = site_tree.post.sidebar + sidebar = site_tree.post.leftbar } else if (page.layout === 'index_wiki') { - sidebar = site_tree.index_wiki.sidebar + sidebar = site_tree.index_wiki.leftbar } else if (page.wiki?.length > 0) { - sidebar = site_tree.wiki.sidebar + sidebar = site_tree.wiki.leftbar } else if (page.layout === '404') { - sidebar = site_tree.error_page.sidebar + sidebar = site_tree.error_page.leftbar } else if (page.layout === 'page') { - sidebar = site_tree.page.sidebar + sidebar = site_tree.page.leftbar } else if (page.layout === 'post') { - sidebar = site_tree.post.sidebar + sidebar = site_tree.post.leftbar } else if (page.layout == null) { - sidebar = site_tree.page.sidebar + sidebar = site_tree.page.leftbar } else { sidebar = [] } - if (topic?.sidebar) { - sidebar = topic.sidebar + if (topic?.leftbar) { + sidebar = topic.leftbar } - if (wiki?.sidebar) { - sidebar = wiki.sidebar + if (wiki?.leftbar) { + sidebar = wiki.leftbar } - page.sidebar = sidebar + page.leftbar = sidebar } // parse array string -if (typeof page.sidebar == 'string') { - page.sidebar = page.sidebar.replace(/ /g, '').split(','); +if (typeof page.leftbar == 'string') { + page.leftbar = page.leftbar.replace(/ /g, '').split(','); } function layoutTitle(main, url, sub) { var el = ''; @@ -66,8 +66,8 @@ function layoutTitle(main, url, sub) { function layoutWidgets() { var el = ''; el += '