{% import "macros.html" as macros %}
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>{% block title %}{{ config.title }}{% endblock %}</title>
	<link rel="alternate" type="application/atom+xml" title="Atom" href="{{ get_url(path="/atom.xml") }}">
	<link rel="stylesheet" href="{{ get_url(path="/style.css") }}">
	<link rel="icon" href="{{ get_url(path="/favicon.svg") }}">
</head>
<body>
	<header>
		<div class="wrap">
			<a href="{{ config.base_url }}" class="title">{{ config.title }}</a>
			<div class="links">
				{% if config.extra.repository_url %}
					<a href="{{ config.extra.repository_url }}">Source</a>,
				{% endif %}
				<a href="{{ get_url(path="/atom.xml") }}">RSS/Atom</a>
			</div>
		</div>
	</header>
	<div class="wrap grid">
		<nav>
			<span class="title">Navigation</span>
			<ul class="main">
				{% for item in config.extra.nav %}
					<li><a href="{{ get_url(path=item.path, trailing_slash=true) }}">{{ item.title }}</a></li>
				{% endfor %}
			</ul>
			{% if page.toc and not page.extra.notoc %}
				<span class="title">Table of Contents</span>
				{{ macros::toc() }}
			{% endif %}
			<span class="title">Categories</span>
			{{ macros::list_taxonomy(kind="categories") }}
		</nav>
		<main>
			{% block content %}
				{{ macros::list_posts(section="posts", count=config.extra.latest_posts_count) }}
				<div class="all-posts">
					<a href="{{ get_url(path="/posts/") }}">All Posts &raquo;</a>
				</div>
			{% endblock %}
		</main>
	</div>
	{% block script %}{% endblock %}
</body>
</html>
