- Zola static site with zolanight theme - Blog section with sample posts - Projects section for listing external projects - Custom index template showing latest post and recent posts list
42 lines
1.2 KiB
HTML
42 lines
1.2 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}{{ section.title }} - {{ config.title }}{% endblock title %}
|
|
|
|
{% block content %}
|
|
<section>
|
|
{% if section.title %}
|
|
<h1>{{ section.title }}</h1>
|
|
{% endif %}
|
|
<div>
|
|
{{ section.content | safe }}
|
|
</div>
|
|
</section>
|
|
|
|
{% set blog_section = get_section(path="blog/_index.md") %}
|
|
{% if blog_section.pages | length > 0 %}
|
|
{% set latest = blog_section.pages | first %}
|
|
<article>
|
|
<h2><a href="{{ latest.permalink }}">{{ latest.title }}</a></h2>
|
|
{% if latest.date %}
|
|
<p><time datetime="{{ latest.date | date(format="%Y-%m-%d") }}">{{ latest.date | date(format="%Y-%m-%d") }}</time></p>
|
|
{% endif %}
|
|
{{ latest.content | safe }}
|
|
</article>
|
|
|
|
{% if blog_section.pages | length > 1 %}
|
|
<h2>Recent Posts</h2>
|
|
<ul>
|
|
{% for page in blog_section.pages | slice(start=1, end=6) %}
|
|
<li>
|
|
{% if page.date %}
|
|
<time datetime="{{ page.date | date(format="%Y-%m-%d") }}">{{ page.date | date(format="%Y-%m-%d") }}</time>
|
|
{% endif %}
|
|
<a href="{{ page.permalink }}">{{ page.title }}</a>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
|
|
<p><a href="{{ get_url(path='@/blog/_index.md') }}">All posts →</a></p>
|
|
{% endif %}
|
|
{% endblock content %}
|