<!DOCTYPE html>
<html>
  <head>
    <title>{% if page.title %}{{ page.title }} • {% endif %}{{ site.title }}</title>
    {% if page.description %}
    <meta name="description" content="{{ page.description }}" />
    {% endif %}
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

    <link rel="stylesheet" media="screen" href="/stylesheets/code.css" type="text/css" />
	  <link rel="stylesheet" media="screen" href="/stylesheets/page.css" type="text/css" />
    {% if page.examples %}
    <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
    <script src="/components/github-files/index.js"></script>
    <script type = "text/javascript">
      for(var i = 0; i < "{{page.examples}}".split(" ").length; i++){
        var filePath = "{{page.path}}"+"{{page.examples}}".split(" ")[i];
        (function(filePath){
          $.getGithubFileByFilePath("github", "teach.github.com", filePath, function(contents) {
            $("#example pre code").append("<h3>"+ filePath +"</h3>");
            $("#example pre code").append(contents)
          });
        })(filePath);
      }
    </script>
    {% endif %}

    {% if site.feedburner %}
    <link href="http://feeds.feedburner.com/{{ site.feedburner.id }}" rel="alternate" title="{{ site.title }}" type="application/atom+xml" />
    {% endif %}
    
    {% if site.google_analytics %}
    <!-- google analytics async -->
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', '{{ site.google_analytics.account }}']);
      _gaq.push(['_trackPageview']);
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
    </script>
    {% endif %}
  </head>
  <body>
    <div class="top">
      <header>
        <div class="logo"><a href ="/">GitHub Teach</a></div>
        <a href="https://github.com/github/teach.github.com/blob/gh-pages/{{page.path}}" class="mini-button"><span>R</span>View it on GitHub</a>
      </header>
    </div>

    <div id="content-wrapper">
      <h1>{{page.title}}</h1>
      {{ content }}
      <div id="example">
        <pre>
          <code></code>
        </pre>
      </div>

      <div id="relatedposts">
        <h3 class="relatedposts">Related Posts</h3>
        <ul class="relatedposts">
          {% for post in site.related_posts limit:7 %}
          <li><a href="{{ post.url }}">{{ post.title }}</a></li>
          {% endfor %}
        </ul>
      </div>
    </div>

  </body>
</html>
