From 1d834ee73245b1cb75bd29d90610b0bb5b78db77 Mon Sep 17 00:00:00 2001 From: timlzh <2921349622@qq.com> Date: Thu, 2 Nov 2023 22:40:13 +0800 Subject: [PATCH 1/8] =?UTF-8?q?FEAT:=20=E6=B7=BB=E5=8A=A0=E4=BA=86highligh?= =?UTF-8?q?t.js=E6=98=BE=E7=A4=BA=E4=BB=A3=E7=A0=81=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _config.yml | 6 ++++++ layout/_partial/head.ejs | 7 +++++++ source/css/article.styl | 1 - 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index 7fd97b8..6efd5ef 100755 --- a/_config.yml +++ b/_config.yml @@ -29,3 +29,9 @@ image_viewer: true # Maybe support more toc style in future. toc: enable: true + +# using highlight.js to show the code +# https://highlightjs.org/ +hljs: + enable: true + theme: xcode diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 5095b54..1af2c71 100755 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -50,6 +50,13 @@ + + <% if(theme.hljs.enable){ %> + + + <% } %> + +
+ <% Object.keys(theme.menu).forEach(key => { %> + <%=key%> + <% }); %> +
+ diff --git a/source/css/style.styl b/source/css/style.styl index 5568b26..b6da306 100755 --- a/source/css/style.styl +++ b/source/css/style.styl @@ -4,4 +4,5 @@ @import "more.styl" @import "custom.styl" @import "toc.styl" -@import "darkmode.styl" \ No newline at end of file +@import "darkmode.styl" +@import "top_menu.styl" \ No newline at end of file diff --git a/source/css/top_menu.styl b/source/css/top_menu.styl new file mode 100644 index 0000000..8c52064 --- /dev/null +++ b/source/css/top_menu.styl @@ -0,0 +1,8 @@ +.top_menu + position absolute + top 0 + left 0 + width 98% + font-size 1.1em + text-align right + margin-top 15px \ No newline at end of file From b1bca6745fac720b971fe299d237a903d22b4fa4 Mon Sep 17 00:00:00 2001 From: timlzh <2921349622@qq.com> Date: Thu, 2 Nov 2023 23:50:07 +0800 Subject: [PATCH 4/8] =?UTF-8?q?FEAT:=20=E5=A2=9E=E5=8A=A0valine=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _config.yml | 9 +++- layout/_partial/comment.ejs | 83 +++++++++++++++++++++++++++++++++++-- layout/_partial/head.ejs | 11 +++-- source/css/comment.styl | 46 ++++++++++++++++++++ source/css/mixins.styl | 2 +- source/css/valine.css | 69 ++++++++++++++++++++++++++++++ source/css/variables.styl | 2 +- 7 files changed, 213 insertions(+), 9 deletions(-) create mode 100644 source/css/comment.styl create mode 100644 source/css/valine.css diff --git a/_config.yml b/_config.yml index 117d78e..8fb3351 100755 --- a/_config.yml +++ b/_config.yml @@ -14,7 +14,14 @@ date_format: YYYY 年 MM 月 DD 日 # Comment. comments: # Disqus comment - disqus_shortname: + disqus: + enable: false + disqus_shortname: + valine: + enable: true + appId: # leancloud application app id + appKey: # leancloud application app key + placeholder: random # Placeholder. Set to random string if you want to have random placeholders(一言api). # Google Analytics Tracking ID google_analytics: diff --git a/layout/_partial/comment.ejs b/layout/_partial/comment.ejs index 2e005a4..011bbb1 100644 --- a/layout/_partial/comment.ejs +++ b/layout/_partial/comment.ejs @@ -1,8 +1,8 @@ -<% if (theme.comments && theme.comments.disqus_shortname){ %> +<% if (theme.comments && theme.comments.disqus.enable && theme.comments.disqus.disqus_shortname){ %>
-<% } %> + +<% } else if(theme.comments && theme.comments.valine.enable){ %> +
+ +<% } %> \ No newline at end of file diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index cf324d4..5b46d2c 100755 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -36,14 +36,19 @@
- <% Object.keys(theme.menu).forEach(key => { %> - <%=key%> - <% }); %> + <% if (theme.menu && theme.menu.length){ %> + <% Object.keys(theme.menu).forEach(key => { %> + <%=key%> + <% }); %> + <% } %>
+ + + <%- css('css/style.css') %> diff --git a/source/css/comment.styl b/source/css/comment.styl new file mode 100644 index 0000000..6e1c045 --- /dev/null +++ b/source/css/comment.styl @@ -0,0 +1,46 @@ +.markdown + display none + +.vemoji + box-shadow none !important + +.vwrap + padding 10px 0 0 0 !important + font-size 18px + border-radius 15px !important + border-color #c2c2c26b !important + +.vheader + width 80% + bottom 0 + position absolute + background #f7f7f7 + +.vheader input + text-align center + +.veditor + padding 0 2% 2% 2% !important + background url("https://cdn.jsdelivr.net/gh/LuckyZmj/imgbed/posts/20201211215501.png") 100% 100% no-repeat !important + +.vemojis + padding-bottom 170px !important + +.vbtn + border-radius 0 !important + padding 0 !important + color #fff !important + line-height 44px !important + width 30% !important + border none !important + background #1abc9c !important + +.vrow + padding 0 !important + padding-top 10px !important + +.vpower + display none !important + +.vctrl + padding-right 10px !important \ No newline at end of file diff --git a/source/css/mixins.styl b/source/css/mixins.styl index 277c315..599bfe7 100755 --- a/source/css/mixins.styl +++ b/source/css/mixins.styl @@ -16,7 +16,7 @@ background-cover() background-cover() serif() - font-family 'Noto Serif', 'Times New Roman', serif + font-family Consolas, 'Microsoft Yahei', 'Noto Serif', 'Times New Roman', serif .serif serif() diff --git a/source/css/valine.css b/source/css/valine.css new file mode 100644 index 0000000..380ae45 --- /dev/null +++ b/source/css/valine.css @@ -0,0 +1,69 @@ +.v .vwrap { + padding: 0 0 44px; +} + +.v .veditor { + min-height: 7rem; + resize: none; +} + +.v .vwrap .vedit { + padding-top: 0 +} + +.v .vwrap .vheader { + width: 80%; + bottom: 0; + position: absolute; + background: #f7f7f7; +} + +.v .vinput { + padding: 10px 15px; +} + +.v .vwrap .vheader .vinput { + border-bottom: 0px +} + +.v .vwrap .vedit .vctrl { + margin-top: -44px; + right: 0; + position: absolute; + margin-right: -3px; +} + +.v .vwrap .vcontrol { + position: absolute; + right: 0; + bottom: 0; + width: 20%; + padding-top: 0px; +} + +.v .vwrap .vcontrol .col.col-80 { + width: 100%; +} + +.v .vbtn.vsubmit { + border-radius: 0; + padding: 0; + color: #fff; + line-height: 44px; + width: 100%; + border: none; + background: #1abc9c; +} + +.v .vwrap .vedit .vctrl span.vpreview-btn, +.v .vwrap .vcontrol .col.col-20, +.v .vlist .vcard .vhead .vsys { + display: none; +} + +@media screen and (max-width: 520px) { + .v .vwrap .vheader .vinput { + width: 33.33%; + padding: 10px 5px; + } +} \ No newline at end of file diff --git a/source/css/variables.styl b/source/css/variables.styl index 5645b71..a418031 100755 --- a/source/css/variables.styl +++ b/source/css/variables.styl @@ -7,5 +7,5 @@ color-border = #EEE color-meta = #CCC red = #CE2323 -font-mono = Monaco, Menlo, Consolas, Courier New, monospace +font-mono = Consolas, Monaco, Menlo, Courier New, monospace font-serif = "Georgia", serif From 07a953f48052c18ecb83533bbcaae155a13f790c Mon Sep 17 00:00:00 2001 From: timlzh <2921349622@qq.com> Date: Thu, 2 Nov 2023 23:51:04 +0800 Subject: [PATCH 5/8] =?UTF-8?q?DOC:=20=E4=BF=AE=E6=94=B9README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 093fe10..14c53c7 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,14 @@ date_format: YYYY 年 MM 月 DD 日 # Comment. comments: # Disqus comment - # 填写 disqus_shortname 即可使用 disqus - disqus_shortname: + disqus: + enable: false + disqus_shortname: + valine: + enable: true + appId: # leancloud application app id + appKey: # leancloud application app key + placeholder: random # Placeholder. Set to random string if you want to have random placeholders(一言api). # Google Analytics Tracking ID # 填写谷歌分析跟踪 ID,使用谷歌分析应用 @@ -104,8 +110,9 @@ date: <文章日期> [YYYY-MM-DD] ## CHANGELOG 20231102 @timlzh -- 增加highlight.js显示代码块, 可以愉快地贴代码啦 -- 增加顶部导航栏功能, 可以自定义导航栏了 +- 增加highlight.js代码高亮 +- 增加顶部导航栏功能 +- 增加valine评论系统 20220202 @zchen9 - 调整 toc 样式 From e62dc250389106e1541e5a35e7019f1aa4f887c0 Mon Sep 17 00:00:00 2001 From: tim_lzh <2921349622@qq.com> Date: Sun, 21 Jan 2024 05:30:45 +0800 Subject: [PATCH 6/8] =?UTF-8?q?feat:=20Tags=E9=A1=B5=E9=9D=A2=E5=92=8Ccate?= =?UTF-8?q?gories=E9=A1=B5=E9=9D=A2;=20=E5=8F=AF=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E5=BC=80=E5=85=B3=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F;=20?= =?UTF-8?q?=E9=A1=B5=E8=84=9A=E5=8A=9F=E8=83=BD=E5=92=8C=E5=A4=87=E6=A1=88?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 + _config.yml | 19 +- layout/_partial/article-full.ejs | 12 +- layout/_partial/article-index.ejs | 19 +- layout/_partial/comment.ejs | 2 +- layout/_partial/darkmode.ejs | 0 layout/_partial/footer.ejs | 12 ++ layout/_partial/go-top.ejs | 23 +++ layout/_partial/head.ejs | 36 +++- layout/_partial/page-categories.ejs | 37 ++++ layout/_partial/page-tags.ejs | 38 ++++ layout/_partial/pagination.ejs | 29 +++ layout/_partial/scripts.ejs | 3 +- layout/_partial/toc.ejs | 2 +- layout/layout.ejs | 6 + layout/page.ejs | 8 +- layout/tag.ejs | 16 ++ source/css/article.styl | 15 +- source/css/base.styl | 61 ++++-- source/css/darkmode.styl | 310 ++++++++++++++++++++-------- source/css/more.styl | 31 ++- source/css/style.styl | 2 +- source/css/top_menu.styl | 5 +- source/js/darkmode.js | 56 +++++ 24 files changed, 616 insertions(+), 131 deletions(-) create mode 100644 layout/_partial/darkmode.ejs create mode 100644 layout/_partial/footer.ejs create mode 100644 layout/_partial/go-top.ejs create mode 100644 layout/_partial/page-categories.ejs create mode 100644 layout/_partial/page-tags.ejs create mode 100644 layout/tag.ejs create mode 100644 source/js/darkmode.js diff --git a/README.md b/README.md index 14c53c7..14a5ec9 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,11 @@ date: <文章日期> [YYYY-MM-DD] ## CHANGELOG +20240121 @timlzh +- 增加暗黑模式开关 +- 页脚以及备案信息显示 +- Tags/Categories页面生成 + 20231102 @timlzh - 增加highlight.js代码高亮 - 增加顶部导航栏功能 diff --git a/_config.yml b/_config.yml index 8fb3351..bd1be08 100755 --- a/_config.yml +++ b/_config.yml @@ -1,6 +1,10 @@ # Top menu menu: - # About: /about + # Tags: /tags + # Categories: /categories + +# Site Icon +favicon: # Camera icon for website baseurl: @@ -19,10 +23,10 @@ comments: disqus_shortname: valine: enable: true - appId: # leancloud application app id - appKey: # leancloud application app key + appId: appid + appKey: appkey placeholder: random # Placeholder. Set to random string if you want to have random placeholders(一言api). - + # Google Analytics Tracking ID google_analytics: @@ -41,8 +45,13 @@ image_viewer: true toc: enable: true +footer: + enable: true + beian: 浙ICP备2022036129号-2 + # content: 本站采用 CC BY-NC-SA 4.0 协议进行许可 + # using highlight.js to show the code # https://highlightjs.org/ hljs: enable: true - theme: xcode + theme: atom-one-dark diff --git a/layout/_partial/article-full.ejs b/layout/_partial/article-full.ejs index 092a430..4442b79 100755 --- a/layout/_partial/article-full.ejs +++ b/layout/_partial/article-full.ejs @@ -1,3 +1,10 @@ +<% + var title = item.title || theme.default_post_title || "Untitled"; + var mainTitle = title.split(" | ")[0]; + var subTitle = title.split(" | ")[1]; +%> + +
<%- partial('_partial/backhome') %> @@ -9,8 +16,11 @@

- <%- item.title || theme.default_post_title || "Untitled" %> + <%- mainTitle %>

+
+ <%- subTitle %> +

diff --git a/layout/_partial/article-index.ejs b/layout/_partial/article-index.ejs index ace536e..40b3280 100755 --- a/layout/_partial/article-index.ejs +++ b/layout/_partial/article-index.ejs @@ -1,8 +1,21 @@
-

- <%- item.title || theme.default_post_title || "Untitled" %> -

+
+ + <% + var title = item.title || theme.default_post_title || "Untitled"; + var mainTitle = title.split(" | ")[0]; + var subTitle = title.split(" | ")[1]; + %> +
+ <%- mainTitle %> +
+
+ + <%- subTitle %> +
+
+ <%- item.excerpt %>
\ No newline at end of file diff --git a/layout/_partial/comment.ejs b/layout/_partial/comment.ejs index 011bbb1..20279f4 100644 --- a/layout/_partial/comment.ejs +++ b/layout/_partial/comment.ejs @@ -26,7 +26,7 @@ appId: '<%= theme.comments.valine.appId %>', appKey: '<%= theme.comments.valine.appKey %>', placeholder: '<%= theme.comments.valine.placeholder %>', - avatar: 'retro', + avatar: '', enableQQ: true, emojiCDN: '//i0.hdslb.com/bfs/emote/', // 表情title和图片映射 diff --git a/layout/_partial/darkmode.ejs b/layout/_partial/darkmode.ejs new file mode 100644 index 0000000..e69de29 diff --git a/layout/_partial/footer.ejs b/layout/_partial/footer.ejs new file mode 100644 index 0000000..ffe6a39 --- /dev/null +++ b/layout/_partial/footer.ejs @@ -0,0 +1,12 @@ +<% if (theme.footer && theme.footer.enable) { %> + <% if (theme.footer.content) { %> +
+ <%- theme.footer.content %> +
+ <% } %> + <% if (theme.footer.beian) { %> +
+ <%- theme.footer.beian %> +
+ <% } %> +<% } %> \ No newline at end of file diff --git a/layout/_partial/go-top.ejs b/layout/_partial/go-top.ejs new file mode 100644 index 0000000..e5cf8e9 --- /dev/null +++ b/layout/_partial/go-top.ejs @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 5b46d2c..f68c12a 100755 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -22,7 +22,7 @@ <% var title = []; - if (page.current > 1) title.push(__('page', page.current)); + if (page.title) title.push(page.title); if (page.category) title.push(page.category); if (page.tag) title.push(page.tag); @@ -34,14 +34,12 @@ %> <%= title.join(' | ') %> - -
- <% if (theme.menu && theme.menu.length){ %> - <% Object.keys(theme.menu).forEach(key => { %> - <%=key%> - <% }); %> - <% } %> -
+ + <%if (theme.favicon){ %> + + <% } else { %> + + <% } %> @@ -49,9 +47,27 @@ + + <%- css('css/style.css') %> + +
+ <% if (theme.menu) { %> + <% Object.keys(theme.menu).forEach(key => { %> + <%=key%> + <% }); %> + <% } %> + + + + +
+ + + + @@ -75,4 +91,6 @@ + + diff --git a/layout/_partial/page-categories.ejs b/layout/_partial/page-categories.ejs new file mode 100644 index 0000000..418a791 --- /dev/null +++ b/layout/_partial/page-categories.ejs @@ -0,0 +1,37 @@ +
+ + <%- partial('_partial/backhome') %> + + +
+
+
+
+
+

+ <%- item.title %> +

+
+
+
+
+
+
+ + +
+
+
+ +
+ <%- list_categories(site.categories, {orderby:'count'}) %> +
+ + +
+ <%- partial("_partial/comment.ejs") %> +
+
+
+
+
\ No newline at end of file diff --git a/layout/_partial/page-tags.ejs b/layout/_partial/page-tags.ejs new file mode 100644 index 0000000..decddec --- /dev/null +++ b/layout/_partial/page-tags.ejs @@ -0,0 +1,38 @@ +
+ + <%- partial('_partial/backhome') %> + + +
+
+
+
+
+

+ <%- item.title %> +

+
+
+
+
+
+
+ + +
+
+
+ +
+ + <%- tagcloud({orderby: 'count', order: 1, min_font: 0.8, max_font: 2, unit: 'em', amount: 40, show_count: true, class: 'tagcloud'}) %> +
+ + +
+ <%- partial("_partial/comment.ejs") %> +
+
+
+
+
\ No newline at end of file diff --git a/layout/_partial/pagination.ejs b/layout/_partial/pagination.ejs index 1403b74..f08ca79 100755 --- a/layout/_partial/pagination.ejs +++ b/layout/_partial/pagination.ejs @@ -2,6 +2,35 @@ <% if (page.prev){ %> <% } %> + <% var page_list = []; %> + <% if (page.total > 1){ + var total = page.total; + var current = page.current; + if (total <= 5){ + for (var i = 1; i <= total; i++){ + page_list.push(i); + } + } else { + if (current < 3){ + page_list = [1, 2, 3, '...', total]; + } else if (current >= 3 && current < total - 2){ + page_list = [1, '...', current - 1, current, current + 1, '...', total]; + } else { + page_list = [1, '...', total - 2, total - 1, total]; + } + } + } %> + <% page_list.forEach(function(item){ %> + <% if (item == '...'){ %> +
  • ...
  • + <% } else { %> + <% if (item == page.current){ %> +
  • <%- item %>
  • + <% } else { %> +
  • <%- item %>
  • + <% } %> + <% } %> + <% }) %> <% if (page.next){ %> <% } %> diff --git a/layout/_partial/scripts.ejs b/layout/_partial/scripts.ejs index ccd5ca7..98500b2 100755 --- a/layout/_partial/scripts.ejs +++ b/layout/_partial/scripts.ejs @@ -1,4 +1,5 @@ \ No newline at end of file diff --git a/layout/_partial/toc.ejs b/layout/_partial/toc.ejs index e7f1402..948d2cc 100644 --- a/layout/_partial/toc.ejs +++ b/layout/_partial/toc.ejs @@ -1,4 +1,4 @@ -<% if (theme.toc.enable){ %> +<% if (theme.toc.enable && !post.type) { %>
    -<%- partial('_partial/img-viewer') %> +<% if(!(item.img_viewer==false)) { %> + <%- partial('_partial/img-viewer') %> +<% } %> -<%- partial("_partial/toc", {post: item}) %> \ No newline at end of file + + +<% if(theme.hljs.enable){ %> + +<% } %> \ No newline at end of file diff --git a/layout/_partial/backhome.ejs b/layout/_partial/backhome.ejs index 3a732a8..c463524 100755 --- a/layout/_partial/backhome.ejs +++ b/layout/_partial/backhome.ejs @@ -1,3 +1,14 @@ - + \ No newline at end of file diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index f68c12a..cc39317 100755 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -80,9 +80,11 @@ <% if(theme.hljs.enable){ %> - - + + <% } %> diff --git a/layout/_partial/page-friends.ejs b/layout/_partial/page-friends.ejs new file mode 100644 index 0000000..6931688 --- /dev/null +++ b/layout/_partial/page-friends.ejs @@ -0,0 +1,57 @@ +
    + + <%- partial('_partial/backhome') %> + + +
    +
    +
    +
    +
    +

    + <%- item.title %> +

    +
    +
    +
    +
    +
    +
    + + +
    + +
    +
    \ No newline at end of file diff --git a/layout/page.ejs b/layout/page.ejs index 2794898..6e61151 100755 --- a/layout/page.ejs +++ b/layout/page.ejs @@ -2,6 +2,8 @@ <%- partial('_partial/page-tags', {item: page}) %> <% } else if (page.type === 'categories') { %> <%- partial('_partial/page-categories', {item: page}) %> +<% } else if (page.type === 'friends') { %> + <%- partial('_partial/page-friends', {item: page}) %> <% } else { %> <%- partial('_partial/article-full', {item: page}) %> <% } %> \ No newline at end of file diff --git a/source/css/article.styl b/source/css/article.styl index a9a2fef..e1465d6 100755 --- a/source/css/article.styl +++ b/source/css/article.styl @@ -7,10 +7,17 @@ article .container .row + em + font-style italic + display inline-block + width 100% + text-align center // Responsive Images img + transform translateX(-50%) position relative margin 30px auto + margin-left 50% max-width 55% !important height auto display inline-block @@ -125,73 +132,73 @@ figure.highlight .line.marked background: #d6d6d6 -pre - // Theme: Solarized - Light - // More theme here: http://softwaremaniacs.org/media/soft/highlight/test.html - .comment - .template_comment - .diff .header - .doctype - .pi - .lisp .string - .javadoc - color #93a1a1 - font-style italic - - .keyword - .winutils - .method - .addition - .css .tag - .request - .status - .nginx .title - color #859900 - - .number - .command - .string - .tag .value - .phpdoc - .tex .formula - .regexp - .hexcolor - color #2aa198 - - .title - .localvars - .chunk - .decorator - .built_in - .identifier - .vhdl - .literal - .id - color #268bd2 - - .attribute - .variable - .lisp .body - .smalltalk .number - .constant - .class .title - .parent - .haskell .type - color #b58900 - - .preprocessor - .preprocessor .keyword - .shebang - .symbol - .symbol .string - .diff .change - .special - .attr_selector - .important - .subst - .cdata - .clojure .title - color #cb4b16 - - .deletion - color #dc322f +// pre +// // Theme: Solarized - Light +// // More theme here: http://softwaremaniacs.org/media/soft/highlight/test.html +// .comment +// .template_comment +// .diff .header +// .doctype +// .pi +// .lisp .string +// .javadoc +// color #93a1a1 +// font-style italic + +// .keyword +// .winutils +// .method +// .addition +// .css .tag +// .request +// .status +// .nginx .title +// color #859900 + +// .number +// .command +// .string +// .tag .value +// .phpdoc +// .tex .formula +// .regexp +// .hexcolor +// color #2aa198 + +// .title +// .localvars +// .chunk +// .decorator +// .built_in +// .identifier +// .vhdl +// .literal +// .id +// color #268bd2 + +// .attribute +// .variable +// .lisp .body +// .smalltalk .number +// .constant +// .class .title +// .parent +// .haskell .type +// color #b58900 + +// .preprocessor +// .preprocessor .keyword +// .shebang +// .symbol +// .symbol .string +// .diff .change +// .special +// .attr_selector +// .important +// .subst +// .cdata +// .clojure .title +// color #cb4b16 + +// .deletion +// color #dc322f diff --git a/source/css/base.styl b/source/css/base.styl index 5507e59..8889f5f 100755 --- a/source/css/base.styl +++ b/source/css/base.styl @@ -14,7 +14,7 @@ p line-height 1.8 margin 20px 0 a - text-decoration underline + text-decoration none h1, h2, h3 @extend .serif @@ -23,20 +23,28 @@ h1, h2, h3 h4, h5, h6 @extend .serif - font-weight 500 + font-weight 600 margin 20px 0 a color red &:hover, &:focus color gray-dark - text-decoration none + text-decoration underline &:visited, &:link color red a img &:hover, &:focus cursor zoom-in +.nav-search + &:hover, &:focus + text-decoration none + +.go-top + &:hover, &:focus + text-decoration none + hr.small max-width 100px margin 20px auto @@ -313,7 +321,7 @@ form .row:first-child .floating-label-form-group border none border-radius none > a:hover, > a:focus - text-decoration none + text-decoration underline color red background-color transparent .disabled diff --git a/source/css/darkmode.styl b/source/css/darkmode.styl index e6fe010..0f53242 100644 --- a/source/css/darkmode.styl +++ b/source/css/darkmode.styl @@ -182,9 +182,10 @@ p a, .pagiantion li > a, #article-toc-inner .toc-link { color: var(--font-color) !important; - text-decoration: none !important; + // text-decoration: none !important; &:focus, &:hover{ color: var(--link-color) !important; + // text-decoration: underline !important; } } @@ -208,6 +209,15 @@ p a, } } +article .container .row a { + color: var(--link-color) !important; + text-decoration: none !important; + &:focus, &:hover { + color: var(--link-color) !important; + text-decoration: underline !important; + } +} + .post-preview blockquote p{ color: var(--font-color) !important; } @@ -225,6 +235,11 @@ figure.highlight table .line { // code inline code { + color: var(--font-color) !important; + // background-color: #273435 !important; +} + +p code { color: var(--font-color) !important; background-color: #273435 !important; } diff --git a/source/css/friends.styl b/source/css/friends.styl new file mode 100644 index 0000000..60fa607 --- /dev/null +++ b/source/css/friends.styl @@ -0,0 +1,56 @@ +.friend-cards-container + width 100% + display grid + grid-template-columns repeat(3, 30%) + grid-column-gap 3% + grid-row-gap 3% + margin-bottom 100px + .card + cursor pointer + position relative + transition transform 300ms ease-in-out + a + width 100% + height 100% + transform translate(0, -100%) + display none + .avatar + width 100% + img + cursor pointer + width 100% + border none + box-shadow none + border-radius 10% + transform none + margin 0 + margin-left 0 + max-width 100% !important + transition filter 250ms ease-in-out !important + .content + top: 50%; + transform: translate(0, -50%); + opacity: 0; + transition: opacity 300ms ease-in-out + position absolute + width 100% + text-align center + border-radius: 50px; + p + color #f0f0f0 + width 100% + margin 0 + .nick + font-size calc(0.8em + min(1vw, 1em)) + font-weight 600 + .description + font-size calc(0.3em + min(1vw, 1em)) + &:hover + transform scale(1.05) + img + -webkit-filter brightness(50%) + filter brightness(50%) + .content + opacity 100% + a + display block \ No newline at end of file diff --git a/source/css/mixins.styl b/source/css/mixins.styl index 599bfe7..95353e5 100755 --- a/source/css/mixins.styl +++ b/source/css/mixins.styl @@ -28,7 +28,7 @@ sans-serif() sans-serif() animation() - animation bodyshow .9s linear + animation bodyshow .9s ease-out .animation animation() @@ -39,16 +39,6 @@ animation() opacity: 0; } - 33% { - top: -40px; - opacity: .2; - } - - 66% { - top: -20px; - opacity: .6; - } - 100% { top: 0; opacity: 1; diff --git a/source/css/style.styl b/source/css/style.styl index 0f03f23..19a1493 100755 --- a/source/css/style.styl +++ b/source/css/style.styl @@ -5,4 +5,5 @@ @import "custom.styl" @import "toc.styl" // @import "darkmode.styl" -@import "top_menu.styl" \ No newline at end of file +@import "top_menu.styl" +@import "friends.styl" \ No newline at end of file diff --git a/source/css/toc.styl b/source/css/toc.styl index ebcffed..29c4e55 100644 --- a/source/css/toc.styl +++ b/source/css/toc.styl @@ -10,10 +10,13 @@ #article-toc { display: block; position: fixed; - top: 0; + top: 50%; bottom: 0; right: 0; width: 16%; + max-height: 80%; + overflow-y: scroll; + transform: translate(0,-50%); } @media screen and (max-width:986px) { @@ -25,8 +28,9 @@ #article-toc-inner { width: 100%; position: absolute; - top: 50%; - transform: translateY(-50%); + // top: 50%; + max-height: 100%; + // transform: translateY(-50%); } #article-toc-inner .toc { diff --git a/source/css/top_menu.styl b/source/css/top_menu.styl index b40530b..ffcfd54 100644 --- a/source/css/top_menu.styl +++ b/source/css/top_menu.styl @@ -4,7 +4,7 @@ top 0 left 0 width 98% - font-size 1.1em + font-size calc(0.1em + min(4vw, 1em)) text-align right margin-top 15px a diff --git a/source/js/darkmode.js b/source/js/darkmode.js index 23bc4de..3ffff71 100644 --- a/source/js/darkmode.js +++ b/source/js/darkmode.js @@ -1,4 +1,13 @@ function enableDarkMode() { + var css = document.getElementById('hljs-theme-light'); + css && document.head.removeChild(css); + + var css = document.createElement('link'); + css.rel = 'stylesheet'; + css.href = 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/' + darkTheme + '.min.css'; + css.id = 'hljs-theme-dark'; + document.head.appendChild(css); + if (document.querySelector('link[href="/css/darkmode.css"]')) { return; } @@ -12,6 +21,15 @@ function enableDarkMode() { function disableDarkMode() { var css = document.querySelector('link[href="/css/darkmode.css"]'); css && document.head.removeChild(css); + + var css = document.getElementById('hljs-theme-dark'); + css && document.head.removeChild(css); + + var css = document.createElement('link'); + css.rel = 'stylesheet'; + css.href = 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/' + lightTheme + '.min.css'; + css.id = 'hljs-theme-light'; + document.head.appendChild(css); } function isDarkMode() { @@ -28,7 +46,11 @@ function toggleDarkMode() { } } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { + if (localStorage.getItem('darkmode') === null) { + localStorage.setItem('darkmode', '0'); + } + if (localStorage.getItem('darkmode') === '0') { disableDarkMode(); document.querySelector('[data-toggle="darkmode"] .fa-moon-o').style.display = 'inline-block'; From 6579a67f3c7f250859422eb4bc5bf7d1fccae392 Mon Sep 17 00:00:00 2001 From: Timlzh <2921349622@qq.com> Date: Mon, 29 Jul 2024 15:36:10 +0800 Subject: [PATCH 8/8] =?UTF-8?q?fix:=20=E5=A4=87=E6=A1=88=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layout/_partial/footer.ejs | 4 ++-- layout/_partial/head.ejs | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/layout/_partial/footer.ejs b/layout/_partial/footer.ejs index ffe6a39..b5e3882 100644 --- a/layout/_partial/footer.ejs +++ b/layout/_partial/footer.ejs @@ -6,7 +6,7 @@ <% } %> <% if (theme.footer.beian) { %>
    - <%- theme.footer.beian %> + <%- theme.footer.beian %>
    <% } %> -<% } %> \ No newline at end of file +<% } %> diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index cc39317..b15be77 100755 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -42,7 +42,8 @@ <% } %> - + + @@ -69,14 +70,16 @@ - + + - + + <% if(theme.hljs.enable){ %>