satchlj.com/themes/zenn/templates/site.html

187 lines
8.4 KiB
HTML

{% import "post_macros.html" as post_macros %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="/favicon.png" />
<title>
{% block title %}
{% if page.title %}
{{ page.title }} &middot;
{% endif %}
{% if section.title %}
{{ section.title }} &middot;
{% endif %}
{{ config.title }}
{% endblock title %}
</title>
{% block css %}
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Zilla+Slab:400,700|Merriweather:400,400i,700,700i|Fira+Mono&display=swap" rel="stylesheet">
<link rel="stylesheet" href="{{ get_url(path="site.css", trailing_slash=false) | safe }}">
{% if page.extra.zenn_applause %}
<link rel="stylesheet" href="{{ get_url(path="vendor/applause-button/applause-button.css", trailing_slash=false) | safe }}">
{% endif %}
{% endblock css %}
{% block js %}
{% if page.extra.zenn_applause %}
<script src="{{ get_url(path="vendor/applause-button/applause-button.js", trailing_slash=false) | safe }}"></script>
{% endif %}
{% endblock js %}
{% if config.generate_rss %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path="rss.xml") | safe }}">
{% endif %}
{% block extra_head %}
{% endblock extra_head %}
</head>
<body>
{% if config.extra.zenn_title %}
{% block header %}
<header id="banner">
<a href="/" class="logo">{{ config.extra.zenn_title }}</a>
</header>
{% endblock header %}
{% endif %}
{% block main %}
<main>
<content>
{% if section.title %}
<header>
<h1>
{% include "anchor-link.html" %}
{{ section.title }}
{% if paginator %}
{% if paginator.current_index > 1 %}
&nbsp;&middot;&nbsp; Page {{ paginator.current_index }}
{% endif %}
{% endif %}
</h1>
{% if not section.extra.zenn_hide_header_meta %}
{% block header_meta %}{% endblock header_meta %}
{% endif %}
</header>
{% endif %}
{% if page.title %}
<header>
<h1>
{% include "anchor-link.html" %}
{{ page.title }}
</h1>
{% if not page.extra.zenn_hide_header_meta %}
{% block header_meta %}{% endblock header_meta %}
{% endif %}
</header>
{% endif %}
{% block body %}{% endblock body %}
{% block page_footer %}{% endblock page_footer %}
</content>
<sidebar>
{% if config.extra.zenn_menu %}
<section>
<ul>
<nav itemscope itemtype="http://schema.org/SiteNavigationElement">
{% for item in config.extra.zenn_menu %}
<li>
<a itemprop="url"
class="{% if item.url | replace(from="$BASE_URL", to=config.base_url) == current_url %}active{% endif %}"
href="{{ item.url | safe | replace(from="$BASE_URL", to=config.base_url) }}">
<span itemprop="name">{{ item.name }}</span>
</a>
</li>
{% endfor %}
</nav>
</ul>
</section>
{% endif %}
{# Table of contents #}
{% if toc %}
<section>
<h1>Contents</h1>
<ul>
<li><a href="{{ current_url }}#">0. {{ page.title }}</a></li>
{% for h1 in toc %}
<li>
<a href="{{ h1.permalink | safe }}">{{ loop.index }}. {{ h1.title }}</a>
{% if h1.children %}
{# <ul> #}
{% for h2 in h1.children %}
<li class="sub">
<a href="{{h2.permalink | safe}}">{{ loop.index }}. {{ h2.title }}</a>
</li>
{% endfor %}
{# </ul> #}
{% endif %}
</li>
{% endfor %}
</ul>
</section>
{% endif %}
{# Categories #}
{% set categories = get_taxonomy(kind="categories") %}
{% if categories.items | length > 0 %}
<section>
<h1><a href="/categories">Categories</a></h1>
<ul>
<nav itemscope itemtype="http://schema.org/SiteNavigationElement">
{% for category in categories.items %}
<li>
<a itemprop="url"
class="{% if category.permalink | replace(from="$BASE_URL", to=config.base_url) == current_url %}active{% endif %}"
href="{{ category.permalink | safe }}">
<span itemprop="name">{{ category.name | title }}</span>
</a>
</li>
{% endfor %}
</nav>
</ul>
</section>
{% endif %}
{# Tags #}
{% set tags = get_taxonomy(kind="tags") %}
{% if tags.items | length > 0 %}
<section>
<h1><a href="/tags">Tags</a></h1>
<div class="tags">
{% for tag in tags.items %}
<a href="{{ tag.permalink | safe }}"
class="tag {% if tag.permalink | replace(from="$BASE_URL", to=config.base_url) == current_url %}active{% endif %}">
{{ tag.name }}
</a>
{% endfor %}
</div>
</section>
{% endif %}
<p class="muted">
Copyright &copy; {{ config.title }} {{ now() | date(format="%Y") }}
{% if config.extra.zenn_source %}
<br /><a href="{{ config.extra.zenn_source }}" target="_blank">Source</a>
{% endif %}
</p>
</sidebar>
</main>
{% endblock main %}
</body>
</html>