post listing with some more metadata
This commit is contained in:
@ -32,5 +32,6 @@
|
||||
</head>
|
||||
<body>
|
||||
{% block content %} Placeholder {% endblock %}
|
||||
{# footer, should be not dependant on the each individual handler but it should have it's own handler #}
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% if posts.len() == 0 %}
|
||||
{% extends "base.html" %} {% block content %} {% if posts.len() == 0 %}
|
||||
<p class="no-posts">You've found void in the space.</p>
|
||||
{% else %}
|
||||
<h1>{# if filters.tags #} {# <em>{filters.tags}</em> #} Blog posts</h1>
|
||||
@ -12,10 +12,11 @@
|
||||
<ul>
|
||||
{% for post in posts %}
|
||||
<li>
|
||||
{# <ArticlePreviewCard {article} {segment} /> #} {#
|
||||
<ArticleFooter {article} {segment} /> #} {{post.metadata.title}}
|
||||
{% include "post_preview_card.html" %} {#
|
||||
<ArticlePreviewCard {article} {segment} /> #} {#
|
||||
<ArticleFooter {article} {segment} /> #}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{# <ArticlePreviewList {...data} segment="blog" /> #}
|
||||
{# <ArticlePreviewList {...data} segment="blog" /> #} {% endblock %}
|
||||
|
27
axum_server/templates/post_preview_card.html
Normal file
27
axum_server/templates/post_preview_card.html
Normal file
@ -0,0 +1,27 @@
|
||||
<article>
|
||||
<header>
|
||||
<h2>
|
||||
<a rel="prefetch" href="/blog/{{post.slug}}">{{post.metadata.title}}</a>
|
||||
</h2>
|
||||
</header>
|
||||
{# article preview, maybe implement as a filter? #}
|
||||
</article>
|
||||
|
||||
<footer>
|
||||
<div class="article-tags">
|
||||
{% if post.metadata.tags.len() > 0 %}
|
||||
<span class="lighten">Tags:</span>
|
||||
<ul>
|
||||
{% for tag in post.metadata.tags %}
|
||||
<li class="{tagsListLiClass}">
|
||||
<a href="/blog/tags/{{tag}}">{{tag}}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="created-at">
|
||||
<span>Published on</span>
|
||||
<time datetime="{post.metadata.date}"> {{post.metadata.date}} </time>
|
||||
</div>
|
||||
</footer>
|
Reference in New Issue
Block a user