diff options
| author | Reorx <novoreorx@gmail.com> | 2022-06-01 22:03:01 +0800 |
|---|---|---|
| committer | Reorx <novoreorx@gmail.com> | 2022-06-01 22:03:01 +0800 |
| commit | 88b2584d06d6349089e96039b34de56187c99305 (patch) | |
| tree | 1b3154982b2b8a06c3744550544db401bcc4e1b4 /layouts | |
| parent | b67d5df2e08a69f850db68f1fa9075e367623508 (diff) | |
add title for comments, enhance styles
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/partials/comments.html | 4 | ||||
| -rw-r--r-- | layouts/partials/disqus.html | 2 | ||||
| -rw-r--r-- | layouts/partials/remark42.html | 15 | ||||
| -rw-r--r-- | layouts/partials/telegram_widget.html | 2 |
4 files changed, 15 insertions, 8 deletions
diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index 36460f4..c7fae9d 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -9,7 +9,7 @@ {{- with site.Params.commentSystems -}} {{- if $pageCommentSystems.remark42 -}} {{- with .remark42 -}} - {{- partial "remark42.html" . }} + {{- partial "remark42.html" (dict "page" $page "ctx" .) }} {{- end -}} {{- end -}} @@ -21,7 +21,7 @@ {{- if $pageCommentSystems.disqus -}} {{- with .disqus -}} - {{- partial "disqus.html" (dict "page" $page "disqus" .) }} + {{- partial "disqus.html" (dict "page" $page "ctx" .) }} {{- end -}} {{- end -}} {{- end -}} diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html index d1e80f8..673d7ea 100644 --- a/layouts/partials/disqus.html +++ b/layouts/partials/disqus.html @@ -19,7 +19,7 @@ }); } else { var d = document, s = d.createElement('script'); - s.src = '//' + '{{ .disqus.shortname }}' + '.disqus.com/embed.js'; + s.src = '//' + '{{ .ctx.shortname }}' + '.disqus.com/embed.js'; s.defer = true; s.setAttribute('data-timestamp', +new Date()); // prevent the <script> from loading mutiple times by InstantClick diff --git a/layouts/partials/remark42.html b/layouts/partials/remark42.html index a2d8fd9..b7b9d01 100644 --- a/layouts/partials/remark42.html +++ b/layouts/partials/remark42.html @@ -1,10 +1,17 @@ -<div id="remark42"></div> +<div class="comments"> + <div class="title"> + <span>Comments</span> + <span class="counter"><span class="remark42__counter" data-url="{{ .page.Permalink }}"></span></span> + </div> + <div id="remark42"> + </div> +</div> <script> var remark_config = { - host: '{{ .url }}', - site_id: '{{ .site }}', - components: ['embed'], + host: '{{ .ctx.url }}', + site_id: '{{ .ctx.site }}', + components: ['embed', 'counter'], max_shown_comments: 20, theme: 'light', // page_title: 'My custom title for a page', diff --git a/layouts/partials/telegram_widget.html b/layouts/partials/telegram_widget.html index df75a59..61c048f 100644 --- a/layouts/partials/telegram_widget.html +++ b/layouts/partials/telegram_widget.html @@ -1,4 +1,4 @@ -<div class="comments-box"> +<div class="comments-box telegram-widget"> <div id="telegram-widget-container"></div> </div> |
