github-js.html 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. {% if GITHUB_USER %}
  2. {% if GITHUB_REPO_COUNT is not defined %}
  3. {% set GITHUB_REPO_COUNT = 5 %}
  4. {% endif %}
  5. {% if GITHUB_SKIP_FORK is not defined %}
  6. {% set GITHUB_SKIP_FORK = "false" %}
  7. {% else %}
  8. {% if GITHUB_SKIP_FORK %}
  9. {% set GITHUB_SKIP_FORK = "true" %}
  10. {% else %}
  11. {% set GITHUB_SKIP_FORK = "false" %}
  12. {% endif %}
  13. {% endif %}
  14. <!-- GitHub JS -->
  15. <script type="text/javascript">
  16. $(document).ready(function () {
  17. if (!window.jXHR) {
  18. var jxhr = document.createElement('script');
  19. jxhr.type = 'text/javascript';
  20. jxhr.src = '{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/jXHR.js';
  21. var s = document.getElementsByTagName('script')[0];
  22. s.parentNode.insertBefore(jxhr, s);
  23. }
  24. github.showRepos({
  25. user: '{{ GITHUB_USER }}',
  26. count: {{ GITHUB_REPO_COUNT }},
  27. skip_forks: {{ GITHUB_SKIP_FORK }},
  28. target: '#gh_repos'
  29. });
  30. });
  31. </script>
  32. <script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/github.js" type="text/javascript"></script>
  33. <!-- End GitHub JS Code -->
  34. {% endif %}