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){ %> + + + <% } %> + +
+ 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 @@ + + + <%- 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]; +%> + +