diff --git a/assets/css/_common/components/post/index.scss b/assets/css/_common/components/post/index.scss index 34044f4..b8c55d9 100644 --- a/assets/css/_common/components/post/index.scss +++ b/assets/css/_common/components/post/index.scss @@ -18,7 +18,7 @@ .use-motion { @if $motion_trans_post_block { - .post-block, .pagination, .comments { + .post-block, .pagination, .comments, .post-comments { visibility: hidden; } } diff --git a/assets/css/_common/components/third-party/index.scss b/assets/css/_common/components/third-party/index.scss index 101dc72..d6b6a2a 100644 --- a/assets/css/_common/components/third-party/index.scss +++ b/assets/css/_common/components/third-party/index.scss @@ -5,6 +5,8 @@ @import 'related-posts'; @import 'math'; @import 'gitter'; +@import 'livere'; +@import 'waline'; .use-motion .animated { // Fix issue #48 #55 diff --git a/assets/css/_common/components/third-party/livere.scss b/assets/css/_common/components/third-party/livere.scss new file mode 100644 index 0000000..23a0170 --- /dev/null +++ b/assets/css/_common/components/third-party/livere.scss @@ -0,0 +1,5 @@ + @if $livere_enable { + #livereAdWrapper, #taboola-livere { + display: none; + } + } diff --git a/assets/css/_common/components/third-party/waline.scss b/assets/css/_common/components/third-party/waline.scss new file mode 100644 index 0000000..dc2b87c --- /dev/null +++ b/assets/css/_common/components/third-party/waline.scss @@ -0,0 +1,5 @@ +@if $waline_enable { + .wl-actions>button:nth-child(3) { + display: none + } +} \ No newline at end of file diff --git a/assets/css/_common/scaffolding/comments.scss b/assets/css/_common/scaffolding/comments.scss index 8ace888..ef1b8db 100644 --- a/assets/css/_common/scaffolding/comments.scss +++ b/assets/css/_common/scaffolding/comments.scss @@ -37,3 +37,71 @@ padding-top: 0; } } + +.post-comments { + @if $scheme != 'Gemini' { + margin-top: 60px; + } + overflow: hidden; + + .comment-head { + margin-bottom: 20px; + + .comment-headline { + display: inline-block; + vertical-align: middle; + font-weight: 700; + font-size: 1.4em; + } + + .comment-switch { + display: inline-block; + float: right; + margin: 2px auto; + padding: 4px 16px; + width: max-content; + border-radius: 8px; + background: #eee; + + .switch-btn { + position: relative; + display: inline-block; + margin: -4px 8px 0; + width: 42px; + height: 22px; + border-radius: 34px; + vertical-align: middle; + cursor: pointer; + -webkit-transition: .4s; + -moz-transition: .4s; + -o-transition: .4s; + -ms-transition: .4s; + transition: .4s; + + &:before { + position: absolute; + bottom: 4px; + left: 4px; + width: 14px; + height: 14px; + border-radius: 50%; + content: ''; + background-color: #fff; + -webkit-transition: .4s; + -moz-transition: .4s; + -o-transition: .4s; + -ms-transition: .4s; + transition: .4s + } + + &.move:before { + -webkit-transform: translateX(20px); + -moz-transform: translateX(20px); + -o-transform: translateX(20px); + -ms-transform: translateX(20px); + transform: translateX(20px); + } + } + } + } +} diff --git a/assets/css/_schemes/Gemini/index.scss b/assets/css/_schemes/Gemini/index.scss index 2846599..ad88c56 100644 --- a/assets/css/_schemes/Gemini/index.scss +++ b/assets/css/_schemes/Gemini/index.scss @@ -25,7 +25,7 @@ // ================================================== // Post blocks. .main-inner > { - .sub-menu, .post-block, .tabs-comment, .comments, .pagination { + .sub-menu, .post-block, .tabs-comment, .comments, .post-comments, .pagination { background: var(--content-bg-color); border-radius: $border-radius-inner; box-shadow: $box-shadow-inner; @@ -47,7 +47,7 @@ } // Post & Comments blocks. -.post-block, .comments { +.post-block, .comments, .post-comments { padding: $content-desktop-padding; } @@ -96,7 +96,7 @@ padding: ($content-tablet-padding * 2); } - .comments { + .comments, .post-comments { padding: $content-tablet-padding ($content-tablet-padding * 2); // padding: initial; // padding-top: $content-tablet-padding; @@ -124,7 +124,7 @@ padding: $sidebar-offset; } - .comments { + .comments, .post-comments { padding: 10px $sidebar-offset; } } diff --git a/assets/css/main.scss b/assets/css/main.scss index c1bf2bf..c0f162c 100644 --- a/assets/css/main.scss +++ b/assets/css/main.scss @@ -118,7 +118,9 @@ $gitter_enable: {{ $P.gitter.enable }}; // Comment $disqusjs_enable: {{ $P.disqusjs.enable }}; +$livere_enable: {{ $P.livere.enable }}; $utterances_enable: {{ $P.utterances.enable }}; +$waline_enable: {{ $P.waline.enable }}; // // Variables Layer diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index f76209b..fc18764 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -644,22 +644,35 @@ params: # Multiple Comment System Support comments: + enable: true # Available values: tabs | buttons - style: tabs + #style: tabs # Choose a comment system to be displayed by default. # Available values: disqus | disqusjs | changyan | livere | gitalk | utterances - active: + active: waline # Setting `true` means remembering the comment system selected by the visitor. storage: true # Lazyload all comment systems. - lazyload: false + #lazyload: false # Modify texts or order for any naves, here are some examples. nav: - #disqus: - # text: Load Disqus - # order: -1 - #gitalk: - # order: -2 + - name: Waline + title: Waline + color: "#27ae60" + weight: 1 + - name: Utterances + title: Utters + color: "#494949" + weight: 2 + + waline: + enable: true + placeholder: "请文明发言" + emoji: false + imgUploader: false + wordLimit: 200 + requiredMeta: ['nick', 'mail'] + serverURL: "https://waline.js.org" # Disqus # For more information: https://disqus.com @@ -689,7 +702,9 @@ params: # LiveRe comments system # You can get your uid from https://livere.com/insight/myCode (General web site) - livere_uid: # + livere: + enable: true + uid: MTAyMC81MTM4MC8yNzg2MQ== # # Gitalk # For more information: https://gitalk.github.io @@ -711,10 +726,11 @@ params: # Utterances # For more information: https://utteranc.es utterances: - enable: false - repo: user-name/repo-name # Github repository owner and name + enable: true + repo: username/repo-name # Github repository owner and name # Available values: pathname | url | title | og:title - issue_term: pathname + issueTerm: pathname + label: Comments # Available values: github-light | github-dark | preferred-color-scheme | github-dark-orange | icy-dark | dark-blue | photon-dark | boxy-light theme: github-light diff --git a/i18n/en-us.yaml b/i18n/en-us.yaml index 4ef064b..f2de6c7 100644 --- a/i18n/en-us.yaml +++ b/i18n/en-us.yaml @@ -84,6 +84,9 @@ RewardPaypal: RewardBitcoin: other: Bitcoin +PostCommentTitle: + other: Comments + VisitorsLabel: other: Total Visitors PageViewsLabel: diff --git a/i18n/zh-cn.yaml b/i18n/zh-cn.yaml index 285be03..15f6ad9 100644 --- a/i18n/zh-cn.yaml +++ b/i18n/zh-cn.yaml @@ -86,6 +86,9 @@ RewardPaypal: RewardBitcoin: other: 比特币 +PostCommentTitle: + other: 评论交流 + UserVistorsLabel: other: 总访客量 PageViewsLabel: diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index c2e528d..efefffc 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -42,6 +42,9 @@
{{- block "main" . }}{{- end }} + {{- if .IsPage }} + {{- partial "comments.html" . }} + {{- end }}