You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mkbook/templates/page.html

102 lines
4.5 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ book.title }} | {{ chapter.front.title }}</title>
<link rel="stylesheet" href="../style.css" type="text/css" media="all" />
<link rel="shortcut icon" href="../favicon.ico" />
<meta property="og:title" content="{{ book.title }}" />
<meta property="og:site_name" content="{{ book.title }}" />
<meta property="og:type" content="book" />
<meta property="og:url" content="{{ book.url|safe }}/{{ chapter.front.url|safe }}" />
{#<meta property="og:description" content="{{ book.description }}" />#}
<meta property="book:author" content="{{ book.author }}" />
<meta property="book:release_date" content="{{ book.pubdate|rfc3339_utc }}" />
</head>
<body>
<nav class="big">
<header>
<h1><a href="../index.html">{{ book.title }}</a></h1>
<h2>by {{ book.author }}</h2>
</header>
<ol>
{% for chap in chapters %}
<li>
<a href="../{{ chap.front.url|safe }}"{% if chapter.front.url == chap.front.url %} class = "current"{% endif %}>{{ chap.front.title }}</a>
{% if chap.sections.len() > 0 %}
<ol>
{% for section in chap.sections %}
<li><a href="../{{ section.front.url|safe }}"{% if chapter.front.url == section.front.url %} class = "current"{% endif %}>{{ section.front.title }}</a></li>
{% endfor %}
</ol>
{% endif %}
</li>
{% endfor %}
</ol>
</nav>
<nav class="small">
<span>
<a href="../index.html" alt="Table of Contents">
<span class="icon">
<svg class="icon-list-ol">
<use xlink:href="../icons.svg#icon-list-ol">
</svg>
</span>
</a>
{% match prev_chapter %}
{% when Some with (chap) %}
<a href="../{{ chap.front.url }}" alt="{{ chap.front.title }}">
<span class="icon">
{% if chapter.sections.len() > 0 && chapter.front.url.ends_with("index.html") %}
<svg class="icon-arrow-up">
<use xlink:href="../icons.svg#icon-arrow-up">
</svg>
{% else %}
<svg class="icon-arrow-left">
<use xlink:href="../icons.svg#icon-arrow-left">
</svg>
{% endif %}
</span>
</a>
{% when None %}
<span class="placeholder"></span>
{% endmatch %}
</span>
<span class="title">{{ chapter.front.title }}</span>
<span>
<span class="placeholder"></span>
{% match next_chapter %}
{% when Some with (chapter) %}
<a href="../{{ chapter.front.url }}" alt="{{ chapter.front.title }}">
<span class="icon">
<svg class="icon-arrow-right">
<use xlink:href="../icons.svg#icon-arrow-right">
</svg>
</span>
</a>
{% when None %}
<span class="placeholder"></span>
{% endmatch %}
</span>
</nav>
<article>
{{ content|safe }}
{% match next_chapter %}
{% when Some with (chapter) %}
<div class="next-chapter">
<a href="../{{ chapter.front.url }}">
<span>Next chapter: “{{ chapter.front.title }}”</span>
<span class="icon">
<svg class="icon-arrow-right">
<use xlink:href="../icons.svg#icon-arrow-right">
</svg>
</span>
</a>
</div>
{% when None %}
{% endmatch %}
<footer><p>&copy; {{ book.pubdate|year }} {{ book.author }}</p></footer>
</article>
</body>
</html>