<!doctype html>
<html class="no-js" lang="{{ DEFAULT_LANG }}">
<head>
    {% block head %}
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>{% block title %}{{ SITENAME }}{% endblock title %}</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <link rel="stylesheet" type="text/css" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/css/main.css">
    <link rel="stylesheet" type="text/css" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/css/custom.css">
    <link rel="icon" type="image/png" href="/aide/theme/img/slm.png"/>
    <script type="text/javascript" src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/jquery.js"></script>
    <script type="text/javascript" src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/custom.js"></script>
    {% endblock %}
</head>
<body itemscope itemtype="http://schema.org/Blog">
  <a name="begin"></a>
    {% include "fragments/header.html" %}

    <section class="main-content">
    {% block content %}{% endblock %}
    </section>

    {% include "fragments/footer.html" %}
    <script type="text/javascript">
      /**
       * Crée un sommaire dans les pages, en examinant les éléments "h2>a",
       * dans la première division de classe "span1"
       **/
      function sommaire(){
	  var ancres = $("h2>a");
	  var container = $("<div class='summary'>≡</div>");
	  container.append($("<a name='sommaire'>"));
	  container.on("click", deplieSommaire);
	  $("section.main-content").prepend(container);
	  var div = $("<div class='collapsible'>");
	  container.append(div);
	  div.on("mouseover", restartSommaireTimer);
	  div.append($("<h3>").text("{{ STATIC_TRANSLATIONS.Summary }}"));
	  var ul = $("<ul>").addClass("sidetitles");
	  div.append(ul);
	  var numero = 1;
	  ancres.each(function(_, a){
	      a= $(a);
	      a.attr("name", "name-" + numero);
	      var h2 = a.parent()
	      var text = h2.text();
	      var href = "#name-" + numero;
	      var li = $("<li>");
	      ul.append(li);
	      li.append($("<a>").attr({href: href,}).text(text));
	      var button = $("<button>").addClass("sommaire").attr({
		  onclick: "retourAuSommaire();",
		  title: "Remonter au sommaire",
	      }).addClass("gotop").text("↟");
	      button.insertBefore(h2);
	      numero +=1;
	  });
	  restartSommaireTimer();
      }

      $( document ).ready(function(){sommaire();});
    </script>
</body>
</html>
