{% if GITHUB_USER %}

  {% if GITHUB_REPO_COUNT is not defined %}
    {% set GITHUB_REPO_COUNT = 5 %}
  {% endif %}
  {% if GITHUB_SKIP_FORK is not defined %}
    {% set GITHUB_SKIP_FORK = "false" %}
  {% else %}
    {% if GITHUB_SKIP_FORK %}
      {% set GITHUB_SKIP_FORK = "true" %}
    {% else %}
      {% set GITHUB_SKIP_FORK = "false" %}
    {% endif %}
  {% endif %}

  <section>
    <h1>GitHub Repos</h1>
    <ul id="gh_repos">
      <li class="loading">Status updating...</li>
    </ul>
    {% if GITHUB_SHOW_USER_LINK is defined %}
      <a href="https://github.com/{{ GITHUB_USER }}">@{{ GITHUB_USER }}</a> on GitHub
    {% endif %}
    <script type="text/javascript">
      $.domReady(function(){
          if (!window.jXHR){
              var jxhr = document.createElement('script');
              jxhr.type = 'text/javascript';
              jxhr.src = '{{ SITEURL }}/theme/js/jXHR.js';
              var s = document.getElementsByTagName('script')[0];
              s.parentNode.insertBefore(jxhr, s);
          }

          github.showRepos({
              user: '{{ GITHUB_USER }}',
              count: {{ GITHUB_REPO_COUNT }},
              skip_forks: {{ GITHUB_SKIP_FORK }},
              target: '#gh_repos'
          });
      });
    </script>
    <script src="{{ SITEURL }}/theme/js/github.js" type="text/javascript"> </script>
  </section>
{% endif %}