Merge pull request #201 from igorkulman/delayed-disqus
Delayed Disqus comments
This commit is contained in:
commit
b6d8e54497
@ -25,6 +25,7 @@ pygmentsCodefencesGuessSyntax = true
|
||||
readingTime = true
|
||||
useHLJS = true
|
||||
socialShare = true
|
||||
delayDisqus = true
|
||||
showRelatedPosts = true
|
||||
# gcse = "012345678901234567890:abcdefghijk" # Get your code from google.com/cse. Make sure to go to "Look and Feel" and change Layout to "Full Width" and Theme to "Classic"
|
||||
|
||||
|
@ -63,6 +63,12 @@
|
||||
- id: yourWebsite
|
||||
translation: "Seu website"
|
||||
|
||||
# Delayed Disqus
|
||||
- id: show
|
||||
translation: "Mostrar"
|
||||
- id: comments
|
||||
translation: "comentários"
|
||||
|
||||
# Related posts
|
||||
- id: seeAlso
|
||||
translation: "Veja também"
|
||||
translation: "Veja também"
|
||||
|
22
i18n/de.yaml
22
i18n/de.yaml
@ -49,20 +49,26 @@
|
||||
|
||||
# Staticman
|
||||
- id: noComment
|
||||
translation: "No comment"
|
||||
translation: "Kein Kommentar"
|
||||
- id: oneComment
|
||||
translation: "comment"
|
||||
translation: "Kommentar"
|
||||
- id: moreComment
|
||||
translation: "comments"
|
||||
translation: "Kommentare"
|
||||
- id: useMarkdown
|
||||
translation: "You can use Markdown syntax"
|
||||
translation: "Sie können Markdown-Syntax verwenden"
|
||||
- id: yourName
|
||||
translation: "Your name"
|
||||
translation: "Irh Name"
|
||||
- id: yourEmail
|
||||
translation: "Your email address"
|
||||
translation: "Ihre Emailadresse"
|
||||
- id: yourWebsite
|
||||
translation: "You website"
|
||||
translation: "Ihre Website"
|
||||
|
||||
# Delayed Disqus
|
||||
- id: show
|
||||
translation: "Zeige"
|
||||
- id: comments
|
||||
translation: "Kommentare"
|
||||
|
||||
# Related posts
|
||||
- id: seeAlso
|
||||
translation: "Siehe auch"
|
||||
translation: "Siehe auch"
|
||||
|
@ -63,6 +63,12 @@
|
||||
- id: yourWebsite
|
||||
translation: "You website"
|
||||
|
||||
# Delayed Disqus
|
||||
- id: show
|
||||
translation: "Show"
|
||||
- id: comments
|
||||
translation: "comments"
|
||||
|
||||
# Related posts
|
||||
- id: seeAlso
|
||||
translation: "See also"
|
||||
translation: "See also"
|
||||
|
@ -63,6 +63,12 @@
|
||||
- id: yourWebsite
|
||||
translation: "Via retpaĝaro"
|
||||
|
||||
# Delayed Disqus
|
||||
- id: show
|
||||
translation: "Montru"
|
||||
- id: comments
|
||||
translation: "komentoj"
|
||||
|
||||
# Related posts
|
||||
- id: seeAlso
|
||||
translation: "Vidu ankaŭ"
|
||||
translation: "Vidu ankaŭ"
|
||||
|
22
i18n/es.yaml
22
i18n/es.yaml
@ -49,20 +49,26 @@
|
||||
|
||||
# Staticman
|
||||
- id: noComment
|
||||
translation: "No comment"
|
||||
translation: "Sin comentarios"
|
||||
- id: oneComment
|
||||
translation: "comment"
|
||||
translation: "comentario"
|
||||
- id: moreComment
|
||||
translation: "comments"
|
||||
translation: "comentarios"
|
||||
- id: useMarkdown
|
||||
translation: "You can use Markdown syntax"
|
||||
translation: "Puedes usar la sintaxis de Markdown"
|
||||
- id: yourName
|
||||
translation: "Your name"
|
||||
translation: "Tu nombre"
|
||||
- id: yourEmail
|
||||
translation: "Your email address"
|
||||
translation: "Tu correo electrónico"
|
||||
- id: yourWebsite
|
||||
translation: "You website"
|
||||
translation: "Tu sitio web"
|
||||
|
||||
# Delayed Disqus
|
||||
- id: show
|
||||
translation: "Mostrar"
|
||||
- id: comments
|
||||
translation: "comentarios"
|
||||
|
||||
# Related posts
|
||||
- id: seeAlso
|
||||
translation: "Ver también"
|
||||
translation: "Ver también"
|
||||
|
@ -63,6 +63,12 @@
|
||||
- id: yourWebsite
|
||||
translation: "Votre site web"
|
||||
|
||||
# Delayed Disqus
|
||||
- id: show
|
||||
translation: "Afficher"
|
||||
- id: comments
|
||||
translation: "commentaires"
|
||||
|
||||
# Related posts
|
||||
- id: seeAlso
|
||||
translation: "Voir également"
|
||||
translation: "Voir également"
|
||||
|
@ -63,6 +63,12 @@
|
||||
- id: yourWebsite
|
||||
translation: "Il tuo website"
|
||||
|
||||
# Delayed Disqus
|
||||
- id: show
|
||||
translation: "Mostra"
|
||||
- id: comments
|
||||
translation: "commenti"
|
||||
|
||||
# Related posts
|
||||
- id: seeAlso
|
||||
translation: "Guarda anche"
|
||||
translation: "Guarda anche"
|
||||
|
@ -63,6 +63,12 @@
|
||||
- id: yourWebsite
|
||||
translation: "You website"
|
||||
|
||||
# Delayed Disqus
|
||||
- id: show
|
||||
translation: "ショー"
|
||||
- id: comments
|
||||
translation: "コメント"
|
||||
|
||||
# Related posts
|
||||
- id: seeAlso
|
||||
translation: "も参照してください"
|
||||
translation: "も参照してください"
|
||||
|
@ -63,6 +63,12 @@
|
||||
- id: yourWebsite
|
||||
translation: "Din webside"
|
||||
|
||||
# Delayed Disqus
|
||||
- id: show
|
||||
translation: "Vis"
|
||||
- id: comments
|
||||
translation: "kommentarer"
|
||||
|
||||
# Related posts
|
||||
- id: seeAlso
|
||||
translation: "Se også"
|
||||
translation: "Se også"
|
||||
|
@ -63,6 +63,12 @@
|
||||
- id: yourWebsite
|
||||
translation: "Jouw website"
|
||||
|
||||
# Delayed Disqus
|
||||
- id: show
|
||||
translation: "Laat"
|
||||
- id: comments
|
||||
translation: "reacties zien"
|
||||
|
||||
# Related posts
|
||||
- id: seeAlso
|
||||
translation: "Zie ook"
|
||||
translation: "Zie ook"
|
||||
|
22
i18n/pl.yaml
22
i18n/pl.yaml
@ -49,20 +49,26 @@
|
||||
|
||||
# Staticman
|
||||
- id: noComment
|
||||
translation: "No comment"
|
||||
translation: "Bez komentarza"
|
||||
- id: oneComment
|
||||
translation: "comment"
|
||||
translation: "komentarz"
|
||||
- id: moreComment
|
||||
translation: "comments"
|
||||
translation: "komentarzy"
|
||||
- id: useMarkdown
|
||||
translation: "You can use Markdown syntax"
|
||||
translation: "Możesz użyć składni Markdown"
|
||||
- id: yourName
|
||||
translation: "Your name"
|
||||
translation: "Twoje imię"
|
||||
- id: yourEmail
|
||||
translation: "Your email address"
|
||||
translation: "Twój adres email"
|
||||
- id: yourWebsite
|
||||
translation: "You website"
|
||||
translation: "Twoja strona internetowa"
|
||||
|
||||
# Delayed Disqus
|
||||
- id: show
|
||||
translation: "Pokaż"
|
||||
- id: comments
|
||||
translation: "komentarzy"
|
||||
|
||||
# Related posts
|
||||
- id: seeAlso
|
||||
translation: "Zobacz też"
|
||||
translation: "Zobacz też"
|
||||
|
22
i18n/ru.yaml
22
i18n/ru.yaml
@ -49,20 +49,26 @@
|
||||
|
||||
# Staticman
|
||||
- id: noComment
|
||||
translation: "No comment"
|
||||
translation: "Без комментариев"
|
||||
- id: oneComment
|
||||
translation: "comment"
|
||||
translation: "комментарий"
|
||||
- id: moreComment
|
||||
translation: "comments"
|
||||
translation: "комментарии"
|
||||
- id: useMarkdown
|
||||
translation: "You can use Markdown syntax"
|
||||
translation: "Вы можете использовать синтаксис Markdown"
|
||||
- id: yourName
|
||||
translation: "Your name"
|
||||
translation: "Ваше имя"
|
||||
- id: yourEmail
|
||||
translation: "Your email address"
|
||||
translation: "Ваш адрес электронной почты"
|
||||
- id: yourWebsite
|
||||
translation: "You website"
|
||||
translation: "Ваш сайт"
|
||||
|
||||
# Delayed Disqus
|
||||
- id: show
|
||||
translation: "Показать"
|
||||
- id: comments
|
||||
translation: "комментариев"
|
||||
|
||||
# Related posts
|
||||
- id: seeAlso
|
||||
translation: "Смотрите также"
|
||||
translation: "Смотрите также"
|
||||
|
22
i18n/zh.yaml
22
i18n/zh.yaml
@ -49,20 +49,26 @@
|
||||
|
||||
# Staticman
|
||||
- id: noComment
|
||||
translation: "No comment"
|
||||
translation: "没有意见"
|
||||
- id: oneComment
|
||||
translation: "comment"
|
||||
translation: "评论"
|
||||
- id: moreComment
|
||||
translation: "comments"
|
||||
translation: "评论"
|
||||
- id: useMarkdown
|
||||
translation: "You can use Markdown syntax"
|
||||
translation: "您可以使用Markdown语法"
|
||||
- id: yourName
|
||||
translation: "Your name"
|
||||
translation: "你的名字"
|
||||
- id: yourEmail
|
||||
translation: "Your email address"
|
||||
translation: "您的电子邮件地址"
|
||||
- id: yourWebsite
|
||||
translation: "You website"
|
||||
translation: "你的网页"
|
||||
|
||||
# Delayed Disqus
|
||||
- id: show
|
||||
translation: "显示"
|
||||
- id: comments
|
||||
translation: "条评论"
|
||||
|
||||
# Related posts
|
||||
- id: seeAlso
|
||||
translation: "也可以看看"
|
||||
translation: "也可以看看"
|
||||
|
@ -53,9 +53,23 @@
|
||||
|
||||
{{ if (.Params.comments) | or (and (or (not (isset .Params "comments")) (eq .Params.comments nil)) (and .Site.Params.comments (ne .Type "page"))) }}
|
||||
{{ if .Site.DisqusShortname }}
|
||||
{{ if .Site.Params.delayDisqus }}
|
||||
<div class="disqus-comments">
|
||||
<button id="show-comments" class="btn btn-default" type="button">{{ i18n "show" }} <span class="disqus-comment-count" data-disqus-url="{{ trim .Permalink "/" }}">{{ i18n "comments" }}</span></button>
|
||||
<div id="disqus_thread"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var disqus_config = function () {
|
||||
this.page.url = '{{ trim .Permalink "/" }}';
|
||||
};
|
||||
|
||||
</script>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="disqus-comments">
|
||||
{{ template "_internal/disqus.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if .Site.Params.staticman }}
|
||||
<div class="staticman-comments">
|
||||
|
@ -112,4 +112,28 @@
|
||||
<!-- End Piwik Code -->
|
||||
{{ end }}
|
||||
|
||||
{{ if (.Site.Params.delayDisqus) (and .Site.DisqusShortname) }}
|
||||
<!-- Delayed Disqus -->
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('#show-comments').on('click', function(){
|
||||
var disqus_shortname = '{{ .Site.DisqusShortname }}';
|
||||
|
||||
(function() {
|
||||
var disqus = document.createElement('script');
|
||||
disqus.type = 'text/javascript';
|
||||
disqus.async = true;
|
||||
disqus.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(disqus);
|
||||
})();
|
||||
|
||||
$(this).hide();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<script id="dsq-count-scr" src="//{{ .Site.DisqusShortname }}.disqus.com/count.js" async></script>
|
||||
<!-- End Delayed Disqus -->
|
||||
{{ end }}
|
||||
|
||||
{{- partial "footer_custom.html" . }}
|
||||
|
@ -743,7 +743,31 @@ div.splitbox div.right {
|
||||
float:left;}
|
||||
}
|
||||
|
||||
/* Delayed Disqus */
|
||||
.disqus-comments button {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
text-transform: uppercase;
|
||||
font-size: 14px;
|
||||
font-weight: 800;
|
||||
letter-spacing: 1px;
|
||||
padding: 10px 5px;
|
||||
background: #FFF;
|
||||
border-radius: 0;
|
||||
color: #404040;
|
||||
}
|
||||
@media only screen and (min-width: 768px) {
|
||||
.disqus-comments button {
|
||||
padding: 15px 25px;
|
||||
}
|
||||
}
|
||||
.disqus-comments button:hover,
|
||||
.disqus-comments button:focus {
|
||||
color: #FFF;
|
||||
background: #0085a1;
|
||||
border: 1px solid #0085a1;
|
||||
|
||||
/* Related posts */
|
||||
h4.see-also {
|
||||
margin-top: 20px
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user