diff options
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/comments.html | 39 | ||||
-rw-r--r-- | layouts/partials/footer.html | 20 | ||||
-rw-r--r-- | layouts/partials/head.html | 5 | ||||
-rw-r--r-- | layouts/post/single.html | 4 |
4 files changed, 56 insertions, 12 deletions
diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index 8728c17..afce2a3 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -4,24 +4,23 @@ <div id="disqus_thread"></div> <script type="text/javascript"> (function() { - // Don't ever inject Disqus on localhost--it creates unwanted - // discussions from 'localhost:1313' on your Disqus account... - if (window.location.hostname === 'localhost') return; + // Don't ever inject Disqus on localhost--it creates unwanted + // discussions from 'localhost:1313' on your Disqus account... + if (window.location.hostname === 'localhost') return; - var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - var disqus_shortname = '{{ .Site.DisqusShortname }}'; - dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; - (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + var disqus_shortname = '{{ .Site.DisqusShortname }}'; + dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> - <a href="http://disqus.com/" class="dsq-brlink" target="_blank">comments powered by <span class="logo-disqus">Disqus</span></a> {{- end }} <!-- changyan --> {{- if and .Site.Params.changyanAppid .Site.Params.changyanAppkey -}} - <div id="SOHUCS"></div> - <script type="text/javascript"> + <div id="SOHUCS"></div> + <script type="text/javascript"> (function(){ if (window.location.hostname === 'localhost') return; @@ -32,4 +31,24 @@ })(); </script> {{- end }} + + <!-- LiveRe --> + {{- if .Site.Params.livereUID -}} + <div id="lv-container" data-id="city" data-uid="{{ .Site.Params.livereUID }}"> + <script type="text/javascript"> + (function(d, s) { + var j, e = d.getElementsByTagName(s)[0]; + + if (typeof LivereTower === 'function') { return; } + + j = d.createElement(s); + j.src = 'https://cdn-city.livere.com/js/embed.dist.js'; + j.async = true; + + e.parentNode.insertBefore(j, e); + })(document, 'script'); + </script> + <noscript>Please enable JavaScript to view the comments powered by <a href="https://livere.com/">LiveRe.</a></noscript> + </div> + {{- end }} {{- end }}
\ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 7ce1aaf..50ddeb4 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,3 +1,4 @@ +{{ $lang := .Site.Data.even.default -}} <div class="social-links"> {{- range $name, $path := .Site.Params.social }} {{- if $path }} @@ -10,14 +11,29 @@ <div class="copyright"> <span class="power-by"> - {{ (printf .Site.Data.even.default.footer.powered `<a class="hexo-link" href="https://gohugo.io">Hugo</a>`) | safeHTML }} + {{ (printf $lang.footer.powered `<a class="hexo-link" href="https://gohugo.io">Hugo</a>`) | safeHTML }} </span> <span class="division">|</span> <span class="theme-info"> - {{ .Site.Data.even.default.footer.theme }} - + {{ $lang.footer.theme }} - <a class="theme-link" href="https://github.com/olOwOlo/hugo-theme-even">Even</a> </span> + {{ if .Site.Params.busuanzi.enable -}} + <div class="busuanzi-footer"> + {{ $spinner := "img/spinner.svg" | relURL -}} + {{ if and .Site.Params.busuanzi.enable .Site.Params.busuanzi.sitePV -}} + {{ $valueSpan := printf `<span id="busuanzi_value_site_pv"><img src="%s" alt="spinner.svg"/></span>` $spinner -}} + <span id="busuanzi_container_site_pv"> {{ printf $lang.traffic.sitePV $valueSpan | safeHTML }} </span> + {{ if .Site.Params.busuanzi.siteUV }}<span class="division">|</span>{{ end }} + {{- end }} + {{ if and .Site.Params.busuanzi.enable .Site.Params.busuanzi.siteUV -}} + {{ $valueSpan := printf `<span id="busuanzi_value_site_uv"><img src="%s" alt="spinner.svg"/></span>` $spinner -}} + <span id="busuanzi_container_site_uv"> {{ printf $lang.traffic.siteUV $valueSpan | safeHTML }} </span> + {{- end }} + </div> + {{- end }} + <span class="copyright-year"> {{- $current := now.Format "2006" }} © diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 086adee..46c771e 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -56,6 +56,11 @@ <script>eruda.init();</script> {{- end }} +<!-- busuanzi --> +{{ if .Site.Params.busuanzi.enable -}} +<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script> +{{- end }} + <!-- Styles --> <link href="{{ "dist/even.min.css?v=2.7.0" | relURL }}" rel="stylesheet"> {{ if .Site.Params.bootcdn -}} diff --git a/layouts/post/single.html b/layouts/post/single.html index 3a737d3..6f8e545 100644 --- a/layouts/post/single.html +++ b/layouts/post/single.html @@ -18,6 +18,10 @@ <span class="more-meta"> {{ printf $lang.posts.header.wordCount .WordCount }} </span> <span class="more-meta"> {{ printf $lang.posts.header.readingTime .ReadingTime }} </span> {{- end }} + {{ if and .Site.Params.busuanzi.enable .Site.Params.busuanzi.pagePV -}} + {{ $valueSpan := printf `<span id="busuanzi_value_page_pv"><img src="%s" alt="spinner.svg"/></span>` ("img/spinner.svg" | relURL) -}} + <span id="busuanzi_container_page_pv" class="more-meta"> {{ printf $lang.traffic.pagePV $valueSpan | safeHTML }} </span> + {{- end }} </div> </header> |