Skip to content

Commit

Permalink
Fix disqus issue under Vue app.
Browse files Browse the repository at this point in the history
  • Loading branch information
AmazingRise committed May 24, 2020
1 parent e705be3 commit b4c734f
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions i18n/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
translation: No older posts.
- id: comments_disabled
translation: Comments Disabled.
- id: livere_comments_activate_js
translation: Please activate JavaScript to use Livere Comment.
- id: comments_activate_js
translation: Please activate JavaScript to view comments.
- id: hugo_theme
translation: Hugo Theme
- id: ported_from
Expand Down
4 changes: 2 additions & 2 deletions i18n/fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
translation: Pas de post plus ancien.
- id: comments_disabled
translation: Commentaires Désactivés.
- id: livere_comments_activate_js
translation: Veuillez activer JavaScript pour utiliser le système de commentaires Livere.
- id: comments_activate_js
translation: Veuillez activer JavaScript pour utiliser le système de commentaires.
- id: hugo_theme
translation: Theme Hugo
- id: ported_from
Expand Down
4 changes: 2 additions & 2 deletions i18n/zh-hant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
translation: 這是最舊的文章了。
- id: comments_disabled
translation: 此篇文章的評論功能已經停用。
- id: livere_comments_activate_js
translation: 請開啓 JavaScript 以便使用 Livere 評論服務
- id: comments_activate_js
translation: 請開啓 JavaScript 以便使用評論服務
- id: hugo_theme
translation: Hugo Theme
- id: ported_from
Expand Down
4 changes: 2 additions & 2 deletions i18n/zh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
translation: 这是最旧的文章了。
- id: comments_disabled
translation: 此篇文章的评论功能已经停用。
- id: livere_comments_activate_js
translation: 请开启 JavaScript 以便使用 Livere 评论服务
- id: comments_activate_js
translation: 请开启 JavaScript 以便使用评论服务
- id: hugo_theme
translation: Hugo Theme
- id: ported_from
Expand Down
8 changes: 5 additions & 3 deletions layouts/partials/comment.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{{ if .Site.Params.disqusShortname }}
<div class="post-comment-wrapper">
{{ template "_internal/disqus.html" . }}
<div class="comments">
<vue-disqus shortname="{{.Site.Params.disqusShortname}}"></vue-disqus>
</div>
<noscript><noscript>{{ i18n "comments_activate_js" }}</noscript></noscript>
<a href="https://disqus.com/" class="dsq-brlink">Comments powered by <span class="logo-disqus">Disqus</span></a>
{{ end }}

{{ if .Site.Params.enableGitalk }}
Expand All @@ -15,6 +17,6 @@

{{ if .Site.Params.livereId }}
<div id="lv-container" data-id="city" data-uid={{.Site.Params.livereId}}>
<noscript>{{ i18n "livere_comments_activate_js" }}</noscript>
<noscript>{{ i18n "comments_activate_js" }}</noscript>
</div>
{{ end }}
4 changes: 4 additions & 0 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,8 @@
<script src='https://unpkg.com/valine@1.4.14/dist/Valine.min.js'></script>
{{ end }}

{{ if .Site.Params.disqusShortname }}
<script src="https://cdn.jsdelivr.net/npm/vue-disqus@3/dist/vue-disqus.js"></script>
{{ end }}

</head>
1 change: 1 addition & 0 deletions layouts/partials/journal.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
this.handleScroll();
this.handleResize();
this.mounted = true;

{{ if and (.Site.Params.enableValine) (.IsPage) }}
new Valine({
el: '#vcomments',
Expand Down

0 comments on commit b4c734f

Please sign in to comment.