scripts.ejs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  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.type = 'text/javascript';
  10. dsq.async = true;
  11. dsq.src = '//' + disqus_shortname + '.disqus.com/<% if (page.comments) { %>embed.js<% } else { %>count.js<% } %>';
  12. (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  13. })();
  14. </script>
  15. <% } %>
  16. <script src="//apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
  17. <script src='//cdn.bootcss.com/node-waves/0.7.5/waves.min.js'></script>
  18. <script src="//cdn.bootcss.com/scrollReveal.js/3.3.2/scrollreveal.min.js"></script>
  19. <%- js('js/jquery.fitvids.js') %>
  20. <script>
  21. var GOOGLE_CUSTOM_SEARCH_API_KEY = "<%- theme.search.google_api_key %>";
  22. var GOOGLE_CUSTOM_SEARCH_ENGINE_ID = "<%- theme.search.google_engine_id %>";
  23. var ALGOLIA_API_KEY = "<%- theme.search.algolia_api_key %>";
  24. var ALGOLIA_APP_ID = "<%- theme.search.algolia_app_id %>";
  25. var ALGOLIA_INDEX_NAME = "<%- theme.search.algolia_index_name %>";
  26. var AZURE_SERVICE_NAME = "<%- theme.search.azure_service_name %>";
  27. var AZURE_INDEX_NAME = "<%- theme.search.azure_index_name %>";
  28. var AZURE_QUERY_KEY = "<%- theme.search.azure_query_key %>";
  29. var BAIDU_API_ID = "<%- theme.search.baidu_api_id %>";
  30. var SEARCH_SERVICE = "<%- theme.search.service %>";
  31. var ROOT = "<%- config.root %>"||"/";
  32. if(!ROOT.endsWith('/'))ROOT += '/';
  33. </script>
  34. <%- js('js/search.js') %>
  35. <%- js('js/app.js') %>