Files
website-template/theme-overrides/home.html
Jon Lockwood 45e5bd0603 fix(main_website): blog type required
the main website would not build due to requiring the extra.blog
config.

nofusscomputing/infrastructure/website!8 !2
2022-08-29 10:30:53 +09:30

69 lines
2.7 KiB
HTML

{% extends "base.html" %}
{% block content %}
<div itemscope itemtype="https://schema.org/WebSite">
{{ page.content }}
{% set article_posts = [] %}
{% for page in nav.pages %}
{% if page.url.startswith(config.extra.blog.dir) and page.meta.date is defined %}
<!-- or "" suppresses "None" output-->
{{ article_posts.append( page ) or "" }}
{% endif %}
{% endfor %}
<div class="container">
<div class="row" >
<div itemprop="hasPart" itemscope itemtype="https://schema.org/CreativeWork" class="column">
<a itemprop="url" href="articles/index.html"><h2 itemprop="name">Articles</h2></a>
<ul>
{% for page in (article_posts|sort(attribute="meta.date", reverse=True))[:config.extra.blog.list_length] %}
{% if page.meta.type == "blog" %}
<li itemprop="hasPart" itemscope itemtype="https://schema.org/BlogPosting">
{% elif page.meta.type == "article" %}
<li itemprop="hasPart" itemscope itemtype="https://schema.org/Article">
{% else %}
<li>
{% endif %}
<p>
<h3><a itemprop="url" href="{{ page.url|url }}"><span itemprop="name">{{ page.title }}</span></a></h3>
<aside class="mdx-author">
<span>
<span itemprop="author" itemscope itemtype="https://schema.org/Person">
<img itemprop="image" alt={{ config.extra.blog.author }} src={{ config.extra.blog.author_image }} style="vertical-align: middle;">
<strong style="padding-left: 5px;" itemprop="name" >{{ config.extra.blog.author }}</strong>
</span>
<span class="twemoji">
{% include ".icons/octicons/calendar-24.svg" %}
</span>
<span itemprop="dateCreated">{{ page.meta.date.strftime("%Y-%m-%d") }}</span> ·
<span class="twemoji">
{% include ".icons/octicons/clock-24.svg" %}
</span>
<!--Min reading time is 1 minute-->
{% set read_time = page.content | wordcount // config.extra.blog.words_read_per_minute|default(300, true) %}
{% if read_time == 0 %}
{% set read_time = 1 %}
{% endif %}
<span itemprop="timeRequired">{{ read_time }} min</span> read
</span>
</aside>
</p>
</li>
{% endfor %}
</ul>
</div>
<div class="column">
<h2>Quick Links</h2>
<ul>
<li><h3>About us</h3></li>
<li><h3><a href="operations/index.html">Operations</a></h3></li>
<li><h3><a href="projects/index.html">Our Projects</a></h3></li>
<li><h3>link 4</h3></li>
</ul>
</div>
</div>
</div>
</div>
{% endblock %}