deca.eco/_includes/layouts/post.vto

88 lines
2.2 KiB
Plaintext
Raw Permalink Normal View History

2024-04-10 02:36:54 +00:00
---
layout: layouts/base.vto
bodyClass: body-post
---
<article class="post" data-pagefind-body data-title="{{ title }}" data-pagefind-index-attrs="data-title">
<header class="post-header">
<h1 class="post-title">{{ title }}</h1>
{{ include "templates/post-details.vto" }}
</header>
{{ if toc.length }}
<nav class="toc">
<h2>Table of contents</h2>
<ol>
{{ for item of toc }}
<li>
<a href="#{{ item.slug }}">{{ item.text }}</a>
{{ if item.children.length }}
<ul>
{{ for child of item.children }}
<li>
<a href="#{{ child.slug }}">{{ child.text }}</a>
</li>
{{ /for }}
</ul>
{{ /if }}
</li>
{{ /for }}
</ol>
</nav>
{{ /if }}
<div class="post-body body">
{{ content }}
</div>
{{ if it.footnotes.length }}
<aside role="note" class="footnotes">
<dl>
{{ for note of footnotes }}
<div id={{ note.id }} class="footnote">
<dt><a href="#{{ note.refId }}">{{ note.label }}</a></dt>
<dd>{{ note.content }}</dd>
</div>
{{ /for }}
</dl>
</aside>
{{ /if }}
{{ if it.comments?.src }}
<aside class="comments-section">
<header class="comments-header">
<h2>{{ i18n.comments.title }}</h2>
<p>{{ i18n.comments.description.replace(":src:", it.comments.src) }}</p>
</header>
<mastodon-comments src="{{ it.comments.src }}" cache="{{ it.comments.cache ?? 60 }}" class="comments">
{{ i18n.comments.empty }}
</mastodon-comments>
{{ /if }}
</aside>
</article>
<nav class="page-pagination pagination">
<ul>
{{- set previousPost = search.previousPage(url, "type=post") }}
{{- if previousPost }}
<li class="pagination-prev">
<a href="{{ previousPost.url }}" rel="prev">
<span>{{ i18n.nav.previous_post }}</span>
<strong>{{ previousPost.title }}</strong>
</a>
</li>
{{ /if }}
{{- set nextPost = search.nextPage(url, "type=post") }}
{{- if nextPost }}
<li class="pagination-next">
<a href="{{ nextPost.url }}" rel="next">
<span>{{ i18n.nav.next_post }}</span>
<strong>{{ nextPost.title }}</strong>
</a>
</li>
{{ /if }}
</ul>
</nav>