This commit is contained in:
Robert Clarke 2019-05-03 23:36:05 +00:00
commit 536c3856e1
89 changed files with 8421 additions and 0 deletions

View file

@ -0,0 +1,6 @@
{% extends "taxonomy_list.html" %}
{% block content %}
{% set title = "All Authors"%}
{{ super() }}
{% endblock content %}

View file

@ -0,0 +1,6 @@
{% extends "taxonomy_single.html" %}
{% block content %}
{% set title = "Author: " ~ term.name %}
{{ super() }}
{% endblock content %}

View file

@ -0,0 +1,6 @@
{% extends "taxonomy_list.html" %}
{% block content %}
{% set title = "All Categories"%}
{{ super() }}
{% endblock content %}

View file

@ -0,0 +1,6 @@
{% extends "taxonomy_single.html" %}
{% block content %}
{% set title = "Category: " ~ term.name %}
{{ super() }}
{% endblock content %}

85
templates/index.html Normal file
View file

@ -0,0 +1,85 @@
{% import "post_macros.html" as post_macros %}
{% import "index_macros.html" as index_macros %}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<!-- Enable responsiveness on mobile devices-->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<title>{% block title %}{{ config.title }}{% endblock title %}</title>
{% if config.extra.zulma_theme %}
<link rel="preload" as="style" href="{{ get_url(path=config.extra.zulma_theme ~ ".css", trailing_slash=false) }}" />
{% else %}
<link rel="preload" as="style" href="{{ get_url(path="default.css", trailing_slash=false) }}" />
{% endif %}
{% if config.generate_rss %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path="rss.xml") | safe }}">
{% endif %}
{% block css %}
{% if config.extra.zulma_theme %}
<link rel="stylesheet" href="{{ get_url(path=config.extra.zulma_theme ~ ".css", trailing_slash=false) }}" />
{% else %}
<link rel="stylesheet" href="{{ get_url(path="default.css", trailing_slash=false) }}" />
{% endif %}
{% endblock css %}
{% block extra_head %}
{% endblock extra_head %}
<noscript>
<style>
.navbar-menu {
display: block;
}
.js-only {
display: none;
}
</style>
</noscript>
</head>
<body>
{% block content %}
<!-- START NAV -->
{% block header %}
{{ index_macros::navbar() }}
{% endblock header %}
<!-- END NAV -->
<main class="index">
<!-- START HERO TITLE -->
{% if config.extra.zulma_title %}
{{ index_macros::hero(title=config.extra.zulma_title) }}
{% endif %}
<!-- END HERO TITLE -->
<div class="container">
<!-- START ARTICLE FEED -->
{% if paginator %}
{{ index_macros::list_articles(pages=paginator.pages) }}
{% else %}
{{ index_macros::list_articles(pages=section.pages) }}
{% endif %}
<!-- END ARTICLE FEED -->
<!-- START PAGINATION -->
{% if paginator %}
{{ index_macros::paginate(paginator=paginator) }}
{% endif %}
<!-- END PAGINATION -->
</div>
</main>
{% endblock content %}
<script async type="text/javascript" src="{{ get_url(path="elasticlunr.min.js") }}"></script>
<script async type="text/javascript" src="{{ get_url(path="search_index.en.js") }}"></script>
<script async type="text/javascript" src="{{ get_url(path="js/bulma.js") }}"></script>
<script async type="text/javascript" src="{{ get_url(path="js/search.js") }}"></script>
</body>
</html>

View file

@ -0,0 +1,94 @@
{% macro hero(title) %}
<section class="hero is-primary is-bold">
<header>
<div class="hero-body">
<div class="container has-text-centered">
<h1 class="title">{{title}}</h1>
</div>
</div>
</header>
</section>
{% endmacro hero %}
{% macro list_articles(pages) %}
<section class="articles">
<div class="columns is-desktop">
<div class="column is-10-desktop is-offset-1-desktop">
{% for page in pages %}
{{ post_macros::page_in_list(page=page) }}
{% endfor %}
</div>
</div>
</section>
{% endmacro list_articles %}
{% macro paginate(paginator) %}
<section class="paginator-container">
<div class="columns">
<div class="column is-10 is-offset-1">
<nav class="pagination is-centered" role="navigation" aria-label="pagination">
{% if paginator.previous %}
<a class="button is-primary pagination-previous" href="{{ paginator.previous }}">&laquo; Previous</a>
{% endif %}
<ul class="pagination-list">
<li>Page {{ paginator.current_index }} of {{ paginator.number_pagers }}</li>
</ul>
{% if paginator.next %}
<a class="button is-primary pagination-next" href="{{ paginator.next }}">Next &raquo;</a>
{% endif %}
</nav>
</div>
</div>
</section>
{% endmacro paginate %}
{% macro navbar() %}
{% if config.extra.zulma_menu or config.extra.zulma_brand or config.build_search_index %}
<header>
<nav class="navbar">
<div class="container">
<div class="navbar-brand">
{% if config.extra.zulma_brand %}
<a class="navbar-item" href="/">
{% if config.extra.zulma_brand.image %}
<img src="{{ config.extra.zulma_brand.image | safe | replace(from="$BASE_URL", to=config.base_url) }}"
alt="{{ config.extra.zulma_brand.text }}">
{% else %}
<span>{{ config.extra.zulma_brand.text }}</span>
{% endif %}
</a>
{% endif %}
<span class="navbar-burger burger" data-target="navbarMenu">
<span></span>
<span></span>
<span></span>
</span>
</div>
<div id="navbarMenu" class="navbar-menu">
<div class="navbar-end">
{% if config.extra.zulma_menu %}
{% for item in config.extra.zulma_menu %}
<a itemprop="url"
class="navbar-item {% if item.url | replace(from="$BASE_URL", to=config.base_url) == current_url %}is-active{% endif %}"
href="{{ item.url | safe | replace(from="$BASE_URL", to=config.base_url) }}">
<span itemprop="name">{{ item.name }}
</span>
</a>
{% endfor %}
{% endif %}
{% if config.build_search_index %}
<div class="navbar-item search-container js-only">
<input class="input is-primary" id="search" type="search" placeholder="Search">
<div class="search-results box">
<div class="search-results__items"></div>
</div>
</div>
{% endif %}
</div>
</div>
</div>
</nav>
</header>
{% endif %}
{% endmacro navbar %}

29
templates/page.html Normal file
View file

@ -0,0 +1,29 @@
{% extends "index.html" %}
{% import "post_macros.html" as post_macros %}
{% block content %}
<!-- START NAV -->
{% block header %}
{{ super() }}
{% endblock header %}
<!-- END NAV -->
<section class="container">
<div class="columns is-desktop">
<div class="column is-10-desktop is-offset-1-desktop">
<article itemscope itemtype="http://schema.org/BlogPosting">
<div class="card article">
<div class="card-content">
{{ post_macros::article_header(page = page) }}
<div itemprop="articleBody" class="content article-body">
{{ page.content | safe }}
</div>
</div>
{% block page_footer %}
{{ post_macros::post_footer(page=page) }}
{% endblock page_footer %}
</div>
</article>
</div>
</div>
</section>
{% endblock content %}

126
templates/post_macros.html Normal file
View file

@ -0,0 +1,126 @@
{% macro read_time(page) %}
<svg class="i-clock" viewBox="0 0 32 32" width="16" height="16" fill="none" stroke="currentcolor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="6.25%">
<circle cx="16" cy="16" r="14" />
<path d="M16 8 L16 16 20 20" />
</svg>
<span>&nbsp;{{ page.reading_time }} minute read</span>
{% endmacro read_time %}
{% macro article_header(page) %}
<header>
<div class="has-text-centered">
<a href="{{ page.permalink | safe }}">
<p class="title article-title">{{ page.title }}</p>
</a>
<div class="tags has-addons level-item">
{% if page.extra.author %}
<span class="tag is-rounded is-info">{{ page.extra.author }}</span>
{% endif %}
<span class="tag is-rounded">{{ page.date | date(format="%F") }}</span>
<span class="tag is-rounded">{{ self::read_time(page=page) }}</span>
</div>
</div>
</header>
{% endmacro article_header %}
{% macro page_in_list(page) %}
<article itemscope itemtype="http://schema.org/CreativeWork">
<div class="card article">
<div class="card-content">
{{ self::article_header(page = page) }}
{% if page.summary %}
<div itemprop="summary" class="content article-body">
{{ page.summary | safe }}
<nav class="readmore">
<a itemprop="url" href="{{ page.permalink | safe }}">Read More&nbsp;&raquo;
</a>
</nav>
</div>
{% endif %}
</div>
</div>
</article>
{% endmacro page_in_list %}
{% macro post_footer(page) %}
<footer class="card-footer article-footer">
<div class="columns is-multiline">
<div class="column is-12">
<p>
Published
{{self::post_footer_date(page=page)}}
{{self::post_footer_authors(page=page)}}
{{self::post_footer_categories(page=page)}}
{{self::post_footer_tags(page=page)}}
</p>
</div>
<div class="column">
<a class="button is-pulled-right is-info" href="/">Back Home</a>
</div>
</div>
</footer>
{% endmacro post_footer %}
{% macro post_footer_date(page) %}
{% if page.date %}
<time datetime="{{ page.date | date(format="%F") }}">
{{ page.date | date(format="%F") }}
</time>
{% endif %}
{% endmacro post_footer_date %}
{% macro post_footer_authors(page) %}
{% if page.taxonomies.authors %}
by
{% for author in page.taxonomies.authors %}
<a href="{{ get_taxonomy_url(kind="authors", name=author) | safe }}">
<span class="tag is-success">{{ author }} </span>
</a>
{% if page.taxonomies.authors | length > 1 %}
{% if loop.index != page.taxonomies.authors | length %}
{% if loop.index == page.taxonomies.authors | length - 1 %}
and
{% else %}
,
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% endmacro post_footer_authors %}
{% macro post_footer_categories(page) %}
{% if page.taxonomies.categories %}
{% set category = page.taxonomies.categories[0] %}
in <a href="{{ get_taxonomy_url(kind="categories", name=category) | safe }}">
<span class="tag is-primary">
{{ category }}
</span>
</a>
{% endif %}
{% endmacro post_footer_date %}
{% macro post_footer_tags(page) %}
{% if page.taxonomies.tags %}
and tagged
{% for tag in page.taxonomies.tags %}
<a href="{{ get_taxonomy_url(kind="tags", name=tag) | safe }}">
<span class="tag is-link">{{ tag }} </span>
</a>
{% if page.taxonomies.tags | length > 1 %}
{% if loop.index != page.taxonomies.tags | length %}
{% if loop.index == page.taxonomies.tags | length - 1 %}
and
{% else %}
,
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% endmacro post_footer_tags %}

6
templates/tags/list.html Normal file
View file

@ -0,0 +1,6 @@
{% extends "taxonomy_list.html" %}
{% block content %}
{% set title = "All Tags"%}
{{ super() }}
{% endblock content %}

View file

@ -0,0 +1,6 @@
{% extends "taxonomy_single.html" %}
{% block content %}
{% set title = "Tag: " ~ term.name %}
{{ super() }}
{% endblock content %}

View file

@ -0,0 +1,19 @@
{% extends "index.html" %}
{% import "index_macros.html" as index_macros %}
{% import "taxonomy_macros.html" as taxonomy_macros %}
{% block content %}
<!-- START NAV -->
{% block header %}
{{ super() }}
{% endblock header %}
<!-- END NAV -->
<main>
<!-- START HERO TITLE -->
{{ index_macros::hero(title=title) }}
<!-- END HERO TITLE -->
<!-- START TAXONOMY LIST -->
{{ taxonomy_macros::list(terms=terms) }}
<!-- END TAXONOMY LIST -->
</main>
{% endblock content %}

View file

@ -0,0 +1,19 @@
{% macro list(terms) %}
<section>
<div class="container">
<div class="columns">
<div class="column is-8 is-offset-2">
{% if terms %}
<div class="list box">
{% for term in terms %}
<a href="{{ term.permalink | safe }}">
<span class="tag is-large is-primary">{{ term.name }}({{ term.pages | length }})</span>
</a>
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
</section>
{% endmacro list %}

View file

@ -0,0 +1,31 @@
{% extends "index.html" %}
{% import "post_macros.html" as post_macros %}
{% import "index_macros.html" as index_macros %}
{% block content %}
<!-- START NAV -->
{% block header %}
{{ super() }}
{% endblock header %}
<!-- END NAV -->
<main>
<!-- START HERO TITLE -->
{{ index_macros::hero(title=title) }}
<!-- END HERO TITLE -->
<div class="container">
<!-- START ARTICLE FEED -->
{% if paginator %}
{{ index_macros::list_articles(pages=paginator.pages) }}
{% else %}
{{ index_macros::list_articles(pages=term.pages) }}
{% endif %}
<!-- END ARTICLE FEED -->
<!-- START PAGINATION -->
{% if paginator %}
{{ index_macros::paginate(paginator=paginator) }}
{% endif %}
<!-- END PAGINATION -->
</div>
</main>
{% endblock content %}