Unify intentation of Nunjucks if blocks
This commit is contained in:
parent
6027bdff52
commit
a61f8f5e6d
|
@ -2,9 +2,9 @@
|
||||||
<html lang="{{ sitemeta.siteLanguage }}" dir="ltr" id="top">
|
<html lang="{{ sitemeta.siteLanguage }}" dir="ltr" id="top">
|
||||||
<head>
|
<head>
|
||||||
{# Meta data #}
|
{# Meta data #}
|
||||||
{% block metaTitle %}
|
{% block metaTitle %}
|
||||||
<meta property="og:title" content="{{ title if title else sitemeta.siteName | safe }}">
|
<meta property="og:title" content="{{ title if title else sitemeta.siteName | safe }}">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% include "global/metagen.njk" %}
|
{% include "global/metagen.njk" %}
|
||||||
|
|
||||||
{# Feeds #}
|
{# Feeds #}
|
||||||
|
@ -17,9 +17,9 @@
|
||||||
|
|
||||||
{# CSS #}
|
{# CSS #}
|
||||||
{% include "global/css-bundle.njk" %}
|
{% include "global/css-bundle.njk" %}
|
||||||
{% if hasTooltips %}
|
{% if hasTooltips %}
|
||||||
<link rel="stylesheet" href="/assets/css/tooltips.css">
|
<link rel="stylesheet" href="/assets/css/tooltips.css">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<style>{% getBundle "css" %}</style>
|
<style>{% getBundle "css" %}</style>
|
||||||
|
|
||||||
{# Favicon #}
|
{# Favicon #}
|
||||||
|
@ -33,9 +33,9 @@
|
||||||
|
|
||||||
{# JavaScript #}
|
{# JavaScript #}
|
||||||
<script src="{% getBundleFileUrl 'js' %}" defer></script>
|
<script src="{% getBundleFileUrl 'js' %}" defer></script>
|
||||||
{% if toc %}
|
{% if toc %}
|
||||||
<script src="{{'/assets/js/details-utils.js'}}" defer></script>
|
<script src="{{'/assets/js/details-utils.js'}}" defer></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<title>
|
<title>
|
||||||
{% block pageTitle %}{{ title + " | " if title }}{{ sitemeta.siteName | safe }}{% endblock %}
|
{% block pageTitle %}{{ title + " | " if title }}{{ sitemeta.siteName | safe }}{% endblock %}
|
||||||
|
@ -50,15 +50,15 @@
|
||||||
</main>
|
</main>
|
||||||
{% block footer %}{% include "global/footer.njk" %}{% endblock %}
|
{% block footer %}{% include "global/footer.njk" %}{% endblock %}
|
||||||
{% if hasTooltips %}
|
{% if hasTooltips %}
|
||||||
<script src="/assets/js/tooltips.js"></script>
|
<script src="/assets/js/tooltips.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var selector = '[data-tooltip]';
|
var selector = '[data-tooltip]';
|
||||||
var els = document.querySelectorAll(selector);
|
var els = document.querySelectorAll(selector);
|
||||||
|
|
||||||
for ( var i = 0; i < els.length; i++ ) {
|
for ( var i = 0; i < els.length; i++ ) {
|
||||||
var dm = new ARIAtip( els[i] );
|
var dm = new ARIAtip( els[i] );
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -1,48 +1,48 @@
|
||||||
<header class="main__header">
|
<header class="main__header">
|
||||||
{% if isArticle or hasBreadcrumbs %}
|
{% if isArticle or hasBreadcrumbs %}
|
||||||
<nav aria-labelledby="breadcrumbs-title">
|
<nav aria-labelledby="breadcrumbs-title">
|
||||||
<h2 class="visually-hidden" id="breadcrumbs-title">Breadcrumbs</h2>
|
<h2 class="visually-hidden" id="breadcrumbs-title">Breadcrumbs</h2>
|
||||||
<ol class="breadcrumbs">
|
<ol class="breadcrumbs">
|
||||||
{% set breadcrumbNavPages = collections.all | eleventyNavigationBreadcrumb(eleventyNavigation.key or articleTitle or pageTitle or title) %}
|
{% set breadcrumbNavPages = collections.all | eleventyNavigationBreadcrumb(eleventyNavigation.key or articleTitle or pageTitle or title) %}
|
||||||
{%- for entry in breadcrumbNavPages %}
|
{%- for entry in breadcrumbNavPages %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ entry.url }}">{{ entry.title }}</a>
|
<a href="{{ entry.url }}">{{ entry.title }}</a>
|
||||||
</li>
|
</li>
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
</ol>
|
</ol>
|
||||||
</nav>
|
</nav>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<h1>{{ articleTitle or pageTitle or title }}</h1>
|
<h1>{{ articleTitle or pageTitle or title }}</h1>
|
||||||
|
|
||||||
{% if isArticle %}
|
{% if isArticle %}
|
||||||
<div class="article__info">
|
<div class="article__info">
|
||||||
<p class="article__info--desc">{{ desc }}</p>
|
<p class="article__info--desc">{{ desc }}</p>
|
||||||
<p>
|
<p>
|
||||||
{{ content | wordcount | thousands }} words.
|
{{ content | wordcount | thousands }} words.
|
||||||
Posted on <time datetime="{{ date }}">{{ date | formatDate }}</time> by {{ sitemeta.siteAuthor.name }}
|
Posted on <time datetime="{{ date }}">{{ date | formatDate }}</time> by {{ sitemeta.siteAuthor.name }}
|
||||||
</p>
|
</p>
|
||||||
{% if updated %}
|
{% if updated %}
|
||||||
<p>Last updated on <time datetime="{{ updated }}">{{ updated | formatDate }}</time></p>
|
<p>Last updated on <time datetime="{{ updated }}">{{ updated | formatDate }}</time></p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if categories %}
|
{% if categories %}
|
||||||
<p>Categories:
|
<p>Categories:
|
||||||
{% for cat in categories %}
|
{% for cat in categories %}
|
||||||
<a href="/categories/{{ cat | slugify }}">{{ cat }}</a>{% if not loop.last %}, {% endif %}
|
<a href="/categories/{{ cat | slugify }}">{{ cat }}</a>{% if not loop.last %}, {% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if desc %}
|
{% if desc %}
|
||||||
<p>{{ desc }}</p>
|
<p>{{ desc }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<content-wrapper>
|
<content-wrapper>
|
||||||
{% if toc %}
|
{% if toc %}
|
||||||
{% include "global/toc.njk" %}
|
{% include "global/toc.njk" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% set contentEl = "article" if isArticle or articleElement else "div" %}
|
{% set contentEl = "article" if isArticle or articleElement else "div" %}
|
||||||
|
@ -51,29 +51,29 @@
|
||||||
{{ content | safe }}
|
{{ content | safe }}
|
||||||
|
|
||||||
{% if tags and tags.includes("posts") %}
|
{% if tags and tags.includes("posts") %}
|
||||||
<nav class="blog__post--pagination" aria-labelledby="nextprev-title">
|
<nav class="blog__post--pagination" aria-labelledby="nextprev-title">
|
||||||
<h2 class="visually-hidden" id="nextprev-title">Next and Previous Blog Posts</h2>
|
{%- if collections.posts %}
|
||||||
{%- if collections.posts %}
|
<h2 class="visually-hidden" id="nextprev-title">Next and Previous Blog Posts</h2>
|
||||||
{%- set previousPost = collections.posts | getPreviousCollectionItem %}
|
{%- set previousPost = collections.posts | getPreviousCollectionItem %}
|
||||||
{%- set nextPost = collections.posts | getNextCollectionItem %}
|
{%- set nextPost = collections.posts | getNextCollectionItem %}
|
||||||
{%- if nextPost or previousPost %}
|
{%- if nextPost or previousPost %}
|
||||||
<ul class="blog__post--nextprev">
|
<ul class="blog__post--nextprev">
|
||||||
{%- if previousPost %}
|
{%- if previousPost %}
|
||||||
<li class="blog__post--prev">
|
<li class="blog__post--prev">
|
||||||
<p>Previous Post:</p>
|
<p>Previous Post:</p>
|
||||||
<a href="{{ previousPost.url }}">{{ previousPost.data.articleTitle }}</a>
|
<a href="{{ previousPost.url }}">{{ previousPost.data.articleTitle }}</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{%- if nextPost %}
|
{%- if nextPost %}
|
||||||
<li class="blog__post--next">
|
<li class="blog__post--next">
|
||||||
<p>Next Post:</p>
|
<p>Next Post:</p>
|
||||||
<a href="{{ nextPost.url }}">{{ nextPost.data.articleTitle }}</a>
|
<a href="{{ nextPost.url }}">{{ nextPost.data.articleTitle }}</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</nav>
|
</nav>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</{{contentEl}}>
|
</{{contentEl}}>
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
or page.url === "/articles/"
|
or page.url === "/articles/"
|
||||||
or tags and tags.includes("blog pages")
|
or tags and tags.includes("blog pages")
|
||||||
%}
|
%}
|
||||||
{% include "main/content-nav.njk" %}
|
{% include "main/content-nav.njk" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% block shrineInfo %}{% endblock %}
|
{% block shrineInfo %}{% endblock %}
|
||||||
|
|
Loading…
Reference in New Issue