blog/themes/cmd/layout/includes/layout.swig

136 lines
4.4 KiB
Text
Raw Normal View History

2020-12-27 13:17:29 +00:00
{% set pageTitle = page.title || config.subtitle || '' %}
{% if is_archive() %}
{% set pageTitle = 'Archives' %}
{% endif %}
{% if is_tag() %}
{% set pageTitle = 'Tag: ' + page.tag %}
{% endif %}
{% if is_category() %}
{% set pageTitle = 'Category: ' + page.category %}
{% endif %}
{% if is_month() %}
{% set pageTitle = pageTitle + ': ' + page.month + '/' + page.year %}
{% endif %}
{% if is_year() %}
{% set pageTitle = pageTitle + ': ' + page.year %}
{% endif %}
{% if pageTitle == '' %}
{% set pageTitle = config.title %}
{% endif %}
<!doctype html>
<html lang="{{ config.language }}">
<head>
<meta charset="UTF-8">
<title>{{ pageTitle }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
{% if theme.stylesheets !== undefined && theme.stylesheets.length > 0 %}
{# stylesheet list from _config.yml #}
{% for url in theme.stylesheets %}
2020-12-28 02:32:48 +00:00
<link rel="stylesheet" href="{{ url }}" media="print" onload="this.media='all'; this.onload=null;">
<noscript><link rel="stylesheet" href="{{ url }}"></noscript>
2020-12-27 13:17:29 +00:00
{% endfor %}
{% endif %}
2020-12-29 09:33:08 +00:00
<link rel="stylesheet" href="/materialize/css/materialize.css">
2020-12-27 13:17:29 +00:00
{% if site.data.theme.site_rss %}
{% if site.data.theme.site_rss.rss %}
<link rel="alternate" type="application/rss+xml" title="{{ config.title }}" href="{{ full_url_for(site.data.theme.site_rss.rss) }}" />
{% endif %}
{% if site.data.theme.site_rss.atom %}
<link rel="alternate" type="application/atom+xml" title="{{ config.title }}" href="{{ full_url_for(site.data.theme.site_rss.atom) }}" />
{% endif %}
{% endif %}
2020-12-27 13:17:29 +00:00
{% block add_head %}{% endblock %}
</head>
<body>
<ul id="nav-mobile" class="sidenav">
2021-08-30 05:50:31 +00:00
{% if site.data.theme.menu %}
{% for key in Object.keys(site.data.theme.menu) %}
<li><a href="{{ site.data.theme.menu[key] }}">{{ key }}</a></li>
{% endfor %}
{% else %}
{% for key in Object.keys(theme.menu) %}
<li><a href="{{ theme.menu[key] }}">{{ key }}</a></li>
{% endfor %}
{% endif %}
2020-12-27 13:17:29 +00:00
</ul>
<nav class="light-blue lighten-1" role="navigation">
<a href="#" data-target="nav-mobile" class="sidenav-trigger"><div class="mdi mdi-menu"></div></a>
<div class="nav-wrapper">
<ul class="right hide-on-med-and-down">
2021-08-30 05:50:31 +00:00
{% if site.data.theme.menu %}
{% for key in Object.keys(site.data.theme.menu) %}
<li><a href="{{ site.data.theme.menu[key] }}">{{ key }}</a></li>
{% endfor %}
{% else %}
{% for key in Object.keys(theme.menu) %}
<li><a href="{{ theme.menu[key] }}">{{ key }}</a></li>
{% endfor %}
{% endif %}
2020-12-27 13:17:29 +00:00
</ul>
</div>
</nav>
<main id="content" class="container xscontainer">
{% block body %}{% endblock %}
</main>
<footer class="page-footer light-blue darken-4">
<div class="container">
<div class="row">
2021-08-30 05:41:40 +00:00
{% if site.data.theme.about_this_blog %}
2020-12-27 13:17:29 +00:00
<div class="col s12 m4">
<h5 class="white-text">About {{config.title}}</h5>
2021-08-30 05:41:40 +00:00
<p>{{site.data.theme.about_this_blog}}</p>
2020-12-27 13:17:29 +00:00
</div>
{% endif %}
2021-08-30 05:41:40 +00:00
{% if site.data.theme.footer_links %}
2020-12-27 13:17:29 +00:00
<div class="col s6 m4">
<h5 class="white-text"> Links </h5>
<ul>
2021-08-30 05:41:40 +00:00
{% for name in Object.keys(site.data.theme.footer_links) %}
<li><a class="grey-text text-lighten-3" href="{{site.data.theme.footer_links[name]}}">{{name}}</a></li>
2020-12-27 13:17:29 +00:00
{% endfor %}
2020-12-27 15:19:30 +00:00
{% if theme.my_mastodon %}
2021-08-30 05:41:40 +00:00
<li><a class="grey-text text-lighten-3" rel="me" href="{{site.data.theme.my_mastodon}}">My Mastodon</a></li>
2020-12-27 15:19:30 +00:00
{% endif %}
2020-12-27 13:17:29 +00:00
</ul>
</div>
{% endif %}
{% if theme.theme_self_claim %}
<div class="col s6 m4">
<p>This blog uses Classical Material Design theme.</p>
</div>
{% endif %}
</div>
</div>
<div class="footer-copyright">
<div class="container truncate">
2021-08-30 05:41:40 +00:00
© Copyright {{ site.data.theme.copyright_year_string }} {{ config.author }}. {{ site.data.theme.copyright_addtional }}
2020-12-27 13:17:29 +00:00
</div>
</div>
</footer>
{% if theme.scripts !== undefined && theme.scripts.length > 0 %}
{# scripts list from config.yml #}
{% for url in theme.scripts %}
<script src="{{ url }}"></script>
{% endfor %}
{% endif %}
{% block add_scripts %}{% endblock %}
</body>
</html>