after-footer.ejs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <% if (config.disqus_shortname){ %>
  2. <script>
  3. var disqus_shortname = '<%= config.disqus_shortname %>';
  4. <% if (page.permalink){ %>
  5. var disqus_url = '<%= page.permalink %>';
  6. <% } %>
  7. (function(){
  8. var dsq = document.createElement('script');
  9. dsq.async = true;
  10. dsq.src = 'https://' + disqus_shortname + '.disqus.com/<% if (page.comments) { %>embed.js<% } else { %>count.js<% } %>';
  11. (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  12. })();
  13. </script>
  14. <% } %>
  15. <%- js('js/jquery-3.4.1.min.js') %>
  16. <% if (theme.fancybox){ %>
  17. <%- js('fancybox/jquery.fancybox.min.js') %>
  18. <% } %>
  19. <%- js('js/script') %>
  20. <%- partial('gauges-analytics') %>
  21. <% if(theme.valine.enable && theme.valine.appId && theme.valine.appKey){ %>
  22. <%- js('https://cdn.jsdelivr.net/npm/valine@1.3.10/dist/Valine.min.js') %>
  23. <script>
  24. var GUEST_INFO = ['nick','mail','link'];
  25. var guest_info = '<%= theme.valine.guest_info %>'.split(',').filter(function(item){
  26. return GUEST_INFO.indexOf(item) > -1
  27. });
  28. var notify = '<%= theme.valine.notify %>' == true;
  29. var verify = '<%= theme.valine.verify %>' == true;
  30. new Valine({
  31. el: '.vcomment',
  32. notify: notify,
  33. verify: verify,
  34. appId: "<%= theme.valine.appId %>",
  35. appKey: "<%= theme.valine.appKey %>",
  36. placeholder: "<%= theme.valine.placeholder %>",
  37. pageSize:'<%= theme.valine.pageSize %>',
  38. avatar:'<%= theme.valine.avatar %>',
  39. lang:'<%= theme.valine.lang %>'
  40. });
  41. </script>
  42. <% } %>