notes/sources/site/includes/layouts/post.njk

109 lines
3.2 KiB
Text
Raw Normal View History

2022-11-04 23:25:35 -06:00
---
layout: base
---
<main id="main" class="main inner box-flex pt-900 pb-600" tabindex="-1">
<article id="container-centre" class="column centre">
<header class="page-header length-optimal mb-1000 pb-500">
<h1 class="post-title">{{ title }}</h1>
{% if sub_heading %}
<p class="sub-heading">{{ sub_heading }}</p>
{% endif %}
<div class="post-meta box-flex mt-800 text-400">
<time class="datetime" datetime="{{ date | timestamp }}">{%- if not date_override %}{{ date | dateDisplay }}{%- else -%}{{ date_override }}{% endif -%}</time>
2022-11-04 23:25:35 -06:00
{% if tags %}
<div class="box-flex">
<ul class="categories">
{# this will create a comma for multiple category links #}
{% set comma = joiner() %}
{% for item in tags %}
{%- if item !== 'notes' -%}
<li class="category"><a href="{{ '/categories/' + item | url }}">{{ comma() }} {{ item | capitalize }}</a></li>
{%- endif -%}
{% endfor %}
</ul>
</div>
{% endif %}
</div>
</header>
{# featured post image #}
{# if post_image %}
2022-11-04 23:25:35 -06:00
<figure class="post-image bg-white pt-600 pr-600 pl-600 mb-1000">
<img data-src="{{ post_image | url }}" alt="{{ image_alt }}">
{% if image_alt %}
<figcaption class="post-image-caption bg-white color-primary pt-600 pb-600 text-400">{{ image_alt }}</figcaption>
{% endif %}
</figure>
{% endif #}
2022-11-04 23:25:35 -06:00
<div class="content flow length-optimal">
{{ content | safe }}
<nav class="pagination mb-1000" aria-label="Pagination">
<ul class="items text-400 tablet:box-flex">
{% if previous_post %}<li class="mb-300"><span class="weight-bold">Previous:</span> <a href="{{ previous_post.url | url }}">{{ previous_post.data.title }}</a></li>{% endif %}
{% if next_post %}<li><span class="weight-bold">Next:</span> <a href="{{ next_post.url | url }}">{{ next_post.data.title }}</a></li>{% endif %}
</ul>
</nav>
</div>
</article>
{# schema #}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BlogPosting",
"headline": "{{ title | truncate(110) }}",
{% if post_image %}
"image": "{{ site.url }}{{ post_image }}",
{% endif %}
"author": {
"@type": "Person",
"name": "{{ site.author.name }}"
},
"publisher": {
"@type": "Organization",
"name": "{{ site.name }}",
"logo": {
"@type": "ImageObject",
"url": "{{ site.url }}/images/meta/article-schema.png"
}
},
"datePublished": "{{ date | timestamp }}",
"dateModified": "{{ date | timestamp }}"
}
</script>
</main>