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
|
readingTime = true
|
||||||
useHLJS = true
|
useHLJS = true
|
||||||
socialShare = true
|
socialShare = true
|
||||||
|
delayDisqus = true
|
||||||
showRelatedPosts = 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"
|
# 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
|
- id: yourWebsite
|
||||||
translation: "Seu website"
|
translation: "Seu website"
|
||||||
|
|
||||||
|
# Delayed Disqus
|
||||||
|
- id: show
|
||||||
|
translation: "Mostrar"
|
||||||
|
- id: comments
|
||||||
|
translation: "comentários"
|
||||||
|
|
||||||
# Related posts
|
# Related posts
|
||||||
- id: seeAlso
|
- id: seeAlso
|
||||||
translation: "Veja também"
|
translation: "Veja também"
|
||||||
|
22
i18n/de.yaml
22
i18n/de.yaml
@ -49,20 +49,26 @@
|
|||||||
|
|
||||||
# Staticman
|
# Staticman
|
||||||
- id: noComment
|
- id: noComment
|
||||||
translation: "No comment"
|
translation: "Kein Kommentar"
|
||||||
- id: oneComment
|
- id: oneComment
|
||||||
translation: "comment"
|
translation: "Kommentar"
|
||||||
- id: moreComment
|
- id: moreComment
|
||||||
translation: "comments"
|
translation: "Kommentare"
|
||||||
- id: useMarkdown
|
- id: useMarkdown
|
||||||
translation: "You can use Markdown syntax"
|
translation: "Sie können Markdown-Syntax verwenden"
|
||||||
- id: yourName
|
- id: yourName
|
||||||
translation: "Your name"
|
translation: "Irh Name"
|
||||||
- id: yourEmail
|
- id: yourEmail
|
||||||
translation: "Your email address"
|
translation: "Ihre Emailadresse"
|
||||||
- id: yourWebsite
|
- id: yourWebsite
|
||||||
translation: "You website"
|
translation: "Ihre Website"
|
||||||
|
|
||||||
|
# Delayed Disqus
|
||||||
|
- id: show
|
||||||
|
translation: "Zeige"
|
||||||
|
- id: comments
|
||||||
|
translation: "Kommentare"
|
||||||
|
|
||||||
# Related posts
|
# Related posts
|
||||||
- id: seeAlso
|
- id: seeAlso
|
||||||
translation: "Siehe auch"
|
translation: "Siehe auch"
|
||||||
|
@ -63,6 +63,12 @@
|
|||||||
- id: yourWebsite
|
- id: yourWebsite
|
||||||
translation: "You website"
|
translation: "You website"
|
||||||
|
|
||||||
|
# Delayed Disqus
|
||||||
|
- id: show
|
||||||
|
translation: "Show"
|
||||||
|
- id: comments
|
||||||
|
translation: "comments"
|
||||||
|
|
||||||
# Related posts
|
# Related posts
|
||||||
- id: seeAlso
|
- id: seeAlso
|
||||||
translation: "See also"
|
translation: "See also"
|
||||||
|
@ -63,6 +63,12 @@
|
|||||||
- id: yourWebsite
|
- id: yourWebsite
|
||||||
translation: "Via retpaĝaro"
|
translation: "Via retpaĝaro"
|
||||||
|
|
||||||
|
# Delayed Disqus
|
||||||
|
- id: show
|
||||||
|
translation: "Montru"
|
||||||
|
- id: comments
|
||||||
|
translation: "komentoj"
|
||||||
|
|
||||||
# Related posts
|
# Related posts
|
||||||
- id: seeAlso
|
- id: seeAlso
|
||||||
translation: "Vidu ankaŭ"
|
translation: "Vidu ankaŭ"
|
||||||
|
22
i18n/es.yaml
22
i18n/es.yaml
@ -49,20 +49,26 @@
|
|||||||
|
|
||||||
# Staticman
|
# Staticman
|
||||||
- id: noComment
|
- id: noComment
|
||||||
translation: "No comment"
|
translation: "Sin comentarios"
|
||||||
- id: oneComment
|
- id: oneComment
|
||||||
translation: "comment"
|
translation: "comentario"
|
||||||
- id: moreComment
|
- id: moreComment
|
||||||
translation: "comments"
|
translation: "comentarios"
|
||||||
- id: useMarkdown
|
- id: useMarkdown
|
||||||
translation: "You can use Markdown syntax"
|
translation: "Puedes usar la sintaxis de Markdown"
|
||||||
- id: yourName
|
- id: yourName
|
||||||
translation: "Your name"
|
translation: "Tu nombre"
|
||||||
- id: yourEmail
|
- id: yourEmail
|
||||||
translation: "Your email address"
|
translation: "Tu correo electrónico"
|
||||||
- id: yourWebsite
|
- id: yourWebsite
|
||||||
translation: "You website"
|
translation: "Tu sitio web"
|
||||||
|
|
||||||
|
# Delayed Disqus
|
||||||
|
- id: show
|
||||||
|
translation: "Mostrar"
|
||||||
|
- id: comments
|
||||||
|
translation: "comentarios"
|
||||||
|
|
||||||
# Related posts
|
# Related posts
|
||||||
- id: seeAlso
|
- id: seeAlso
|
||||||
translation: "Ver también"
|
translation: "Ver también"
|
||||||
|
@ -63,6 +63,12 @@
|
|||||||
- id: yourWebsite
|
- id: yourWebsite
|
||||||
translation: "Votre site web"
|
translation: "Votre site web"
|
||||||
|
|
||||||
|
# Delayed Disqus
|
||||||
|
- id: show
|
||||||
|
translation: "Afficher"
|
||||||
|
- id: comments
|
||||||
|
translation: "commentaires"
|
||||||
|
|
||||||
# Related posts
|
# Related posts
|
||||||
- id: seeAlso
|
- id: seeAlso
|
||||||
translation: "Voir également"
|
translation: "Voir également"
|
||||||
|
@ -63,6 +63,12 @@
|
|||||||
- id: yourWebsite
|
- id: yourWebsite
|
||||||
translation: "Il tuo website"
|
translation: "Il tuo website"
|
||||||
|
|
||||||
|
# Delayed Disqus
|
||||||
|
- id: show
|
||||||
|
translation: "Mostra"
|
||||||
|
- id: comments
|
||||||
|
translation: "commenti"
|
||||||
|
|
||||||
# Related posts
|
# Related posts
|
||||||
- id: seeAlso
|
- id: seeAlso
|
||||||
translation: "Guarda anche"
|
translation: "Guarda anche"
|
||||||
|
@ -63,6 +63,12 @@
|
|||||||
- id: yourWebsite
|
- id: yourWebsite
|
||||||
translation: "You website"
|
translation: "You website"
|
||||||
|
|
||||||
|
# Delayed Disqus
|
||||||
|
- id: show
|
||||||
|
translation: "ショー"
|
||||||
|
- id: comments
|
||||||
|
translation: "コメント"
|
||||||
|
|
||||||
# Related posts
|
# Related posts
|
||||||
- id: seeAlso
|
- id: seeAlso
|
||||||
translation: "も参照してください"
|
translation: "も参照してください"
|
||||||
|
@ -63,6 +63,12 @@
|
|||||||
- id: yourWebsite
|
- id: yourWebsite
|
||||||
translation: "Din webside"
|
translation: "Din webside"
|
||||||
|
|
||||||
|
# Delayed Disqus
|
||||||
|
- id: show
|
||||||
|
translation: "Vis"
|
||||||
|
- id: comments
|
||||||
|
translation: "kommentarer"
|
||||||
|
|
||||||
# Related posts
|
# Related posts
|
||||||
- id: seeAlso
|
- id: seeAlso
|
||||||
translation: "Se også"
|
translation: "Se også"
|
||||||
|
@ -63,6 +63,12 @@
|
|||||||
- id: yourWebsite
|
- id: yourWebsite
|
||||||
translation: "Jouw website"
|
translation: "Jouw website"
|
||||||
|
|
||||||
|
# Delayed Disqus
|
||||||
|
- id: show
|
||||||
|
translation: "Laat"
|
||||||
|
- id: comments
|
||||||
|
translation: "reacties zien"
|
||||||
|
|
||||||
# Related posts
|
# Related posts
|
||||||
- id: seeAlso
|
- id: seeAlso
|
||||||
translation: "Zie ook"
|
translation: "Zie ook"
|
||||||
|
20
i18n/pl.yaml
20
i18n/pl.yaml
@ -49,19 +49,25 @@
|
|||||||
|
|
||||||
# Staticman
|
# Staticman
|
||||||
- id: noComment
|
- id: noComment
|
||||||
translation: "No comment"
|
translation: "Bez komentarza"
|
||||||
- id: oneComment
|
- id: oneComment
|
||||||
translation: "comment"
|
translation: "komentarz"
|
||||||
- id: moreComment
|
- id: moreComment
|
||||||
translation: "comments"
|
translation: "komentarzy"
|
||||||
- id: useMarkdown
|
- id: useMarkdown
|
||||||
translation: "You can use Markdown syntax"
|
translation: "Możesz użyć składni Markdown"
|
||||||
- id: yourName
|
- id: yourName
|
||||||
translation: "Your name"
|
translation: "Twoje imię"
|
||||||
- id: yourEmail
|
- id: yourEmail
|
||||||
translation: "Your email address"
|
translation: "Twój adres email"
|
||||||
- id: yourWebsite
|
- id: yourWebsite
|
||||||
translation: "You website"
|
translation: "Twoja strona internetowa"
|
||||||
|
|
||||||
|
# Delayed Disqus
|
||||||
|
- id: show
|
||||||
|
translation: "Pokaż"
|
||||||
|
- id: comments
|
||||||
|
translation: "komentarzy"
|
||||||
|
|
||||||
# Related posts
|
# Related posts
|
||||||
- id: seeAlso
|
- id: seeAlso
|
||||||
|
22
i18n/ru.yaml
22
i18n/ru.yaml
@ -49,20 +49,26 @@
|
|||||||
|
|
||||||
# Staticman
|
# Staticman
|
||||||
- id: noComment
|
- id: noComment
|
||||||
translation: "No comment"
|
translation: "Без комментариев"
|
||||||
- id: oneComment
|
- id: oneComment
|
||||||
translation: "comment"
|
translation: "комментарий"
|
||||||
- id: moreComment
|
- id: moreComment
|
||||||
translation: "comments"
|
translation: "комментарии"
|
||||||
- id: useMarkdown
|
- id: useMarkdown
|
||||||
translation: "You can use Markdown syntax"
|
translation: "Вы можете использовать синтаксис Markdown"
|
||||||
- id: yourName
|
- id: yourName
|
||||||
translation: "Your name"
|
translation: "Ваше имя"
|
||||||
- id: yourEmail
|
- id: yourEmail
|
||||||
translation: "Your email address"
|
translation: "Ваш адрес электронной почты"
|
||||||
- id: yourWebsite
|
- id: yourWebsite
|
||||||
translation: "You website"
|
translation: "Ваш сайт"
|
||||||
|
|
||||||
|
# Delayed Disqus
|
||||||
|
- id: show
|
||||||
|
translation: "Показать"
|
||||||
|
- id: comments
|
||||||
|
translation: "комментариев"
|
||||||
|
|
||||||
# Related posts
|
# Related posts
|
||||||
- id: seeAlso
|
- id: seeAlso
|
||||||
translation: "Смотрите также"
|
translation: "Смотрите также"
|
||||||
|
22
i18n/zh.yaml
22
i18n/zh.yaml
@ -49,20 +49,26 @@
|
|||||||
|
|
||||||
# Staticman
|
# Staticman
|
||||||
- id: noComment
|
- id: noComment
|
||||||
translation: "No comment"
|
translation: "没有意见"
|
||||||
- id: oneComment
|
- id: oneComment
|
||||||
translation: "comment"
|
translation: "评论"
|
||||||
- id: moreComment
|
- id: moreComment
|
||||||
translation: "comments"
|
translation: "评论"
|
||||||
- id: useMarkdown
|
- id: useMarkdown
|
||||||
translation: "You can use Markdown syntax"
|
translation: "您可以使用Markdown语法"
|
||||||
- id: yourName
|
- id: yourName
|
||||||
translation: "Your name"
|
translation: "你的名字"
|
||||||
- id: yourEmail
|
- id: yourEmail
|
||||||
translation: "Your email address"
|
translation: "您的电子邮件地址"
|
||||||
- id: yourWebsite
|
- id: yourWebsite
|
||||||
translation: "You website"
|
translation: "你的网页"
|
||||||
|
|
||||||
|
# Delayed Disqus
|
||||||
|
- id: show
|
||||||
|
translation: "显示"
|
||||||
|
- id: comments
|
||||||
|
translation: "条评论"
|
||||||
|
|
||||||
# Related posts
|
# Related posts
|
||||||
- id: seeAlso
|
- id: seeAlso
|
||||||
translation: "也可以看看"
|
translation: "也可以看看"
|
||||||
|
@ -53,10 +53,24 @@
|
|||||||
|
|
||||||
{{ if (.Params.comments) | or (and (or (not (isset .Params "comments")) (eq .Params.comments nil)) (and .Site.Params.comments (ne .Type "page"))) }}
|
{{ 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.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">
|
<div class="disqus-comments">
|
||||||
{{ template "_internal/disqus.html" . }}
|
{{ template "_internal/disqus.html" . }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
{{ if .Site.Params.staticman }}
|
{{ if .Site.Params.staticman }}
|
||||||
<div class="staticman-comments">
|
<div class="staticman-comments">
|
||||||
{{ partial "staticman-comments.html" . }}
|
{{ partial "staticman-comments.html" . }}
|
||||||
|
@ -112,4 +112,28 @@
|
|||||||
<!-- End Piwik Code -->
|
<!-- End Piwik Code -->
|
||||||
{{ end }}
|
{{ 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" . }}
|
{{- partial "footer_custom.html" . }}
|
||||||
|
@ -743,7 +743,31 @@ div.splitbox div.right {
|
|||||||
float:left;}
|
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 */
|
/* Related posts */
|
||||||
h4.see-also {
|
h4.see-also {
|
||||||
margin-top: 20px
|
margin-top: 20px
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user