{% from '_macros.html' import tags_list,
                              google_analytics,
                              disqus_comments,
                              disqus_counter,
                              addthis,
                              pluso,
                              img -%}
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">

		{% if commons.description -%}
			<meta name="description" content="{{ commons.description }}">
		{% endif -%}

		{% if commons.keywords -%}
			<meta name="keywords" content="{{ commons.keywords }}">
		{% endif -%}

		{%- if commons.author -%}
			<meta name="author" content="{{ commons.author }}">
		{% endif -%}

		{%- if commons.generator -%}
			<meta name="generator" content="{{ commons.generator }} {{ generator_version }}">
		{% endif -%}

		<link rel="shortcut icon" href="{{ commons.rel_root_url }}favicon.png">

		<title>{{ page.title }}</title>

		<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
		<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css" rel="stylesheet">
		<link href="{{ commons.rel_root_url }}css/custom.css" rel="stylesheet">
		<link href="{{ commons.rel_root_url }}favicon.ico" type="image/x-icon" rel="shortcut icon">
		<link href="{{ commons.rel_root_url }}{{ atom_feed }}" rel="alternate" title="drafts.cc feed" type="application/atom+xml">

		<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
		<!--[if lt IE 9]>
			<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
			<script src="{{ commons.rel_root_url }}js/respond.min.js"></script>
		<![endif]-->
	</head>

	<body>
		{% block nav %}
			<div class="navbar navbar-default navbar-static-top">
				<div class="container">
					<div class="navbar-header">
						<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
							<span class="icon-bar"></span>
							<span class="icon-bar"></span>
							<span class="icon-bar"></span>
						</button>
						<a class="navbar-brand" href="{{ commons.rel_root_url }}" title="{{ commons.site_title }}"><i class="icon-home"></i></a>
					</div>

					<div class="navbar-collapse collapse">
						{% if commons.menu -%}
							<ul class="nav navbar-nav">
								{% for item in commons.menu -%}
									<li><a href="{{item.href}}">{{ item.title }}</a></li>
								{%- endfor %}
							</ul>
						{%- endif %}

						{%- if commons.enable_search_form -%}
							<form action="http://google.com/search" method="get" class="navbar-form navbar-right">
								<div class="form-group">
									<fieldset role="search">
										<input type="hidden" name="q" value="site:{{ commons.root_url|trimurl }}">
										<input type="text" name="q" placeholder="Search" class="form-control input-sm">
									</fieldset>
								</div>
								<button type="submit" class="btn btn-sm btn-search"><i class="icon-search"></i></button>
							</form>
						{%- endif -%}
					</div>
				</div>
			</div>
		{% endblock %}

		<div class="container">
			{%- block title -%}
			{%- endblock -%}

			{%- block main -%}
				{%- block content -%}
					{{ page.content }}
				{%- endblock -%}
			{%- endblock -%}

			{%- block middle -%}
			{%- endblock -%}

			{%- block comments -%}
			{%- endblock-%}
		</div>

		{%- block footer -%}
			<div class="container text-muted center footer">
				<hr>
				<a href="http://drafts.cc/">drafts.cc</a> • Created by <a href="{{ commons.author_url }}">{{ commons.author }}</a>, {{ commons.time.year }} • Licensed under <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_US">CC BY-NC-SA 3.0</a><br>
				Content sources <a href="{{ commons.source_url }}">at GitHub</a> • Generated with <a href="{{ commons.generator_url }}">{{ commons.generator }}</a> {{ commons.generator_version }}
			</div>
		{%- endblock -%}

		<script src="//code.jquery.com/jquery-latest.min.js"></script>
		<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
		<script src="//cdnjs.cloudflare.com/ajax/libs/prettify/r224/prettify.js"></script>
		<script>
			!function ($) {
				$(function() { window.prettyPrint && prettyPrint() });
				$('pre').addClass('prettyprint linenums');
			}(window.jQuery);
		</script>

		{%- if commons.id_google_analytics -%}
			{{- google_analytics(commons.id_google_analytics) -}}
		{%- endif -%}

		{%- if commons.id_addthis -%}
			{{- addthis(commons.id_addthis, page.url) -}}
		{%- endif -%}

	</body>
</html>
