Version 2, ready for beta
This commit was merged in pull request #1.
This commit is contained in:
62
src/default-theme/single-post.liquid
Normal file
62
src/default-theme/single-post.liquid
Normal file
@@ -0,0 +1,62 @@
|
||||
{%- assign post = model.posts | first -%}
|
||||
<h1>{{ post.title }}</h1>
|
||||
<h4 class="item-meta text-muted">
|
||||
{% if post.published_on -%}
|
||||
Published {{ post.published_on | date: "dddd, MMMM d, yyyy" }}
|
||||
at {{ post.published_on | date: "h:mm tt" | downcase }}
|
||||
{%- else -%}
|
||||
**DRAFT**
|
||||
{% endif %}
|
||||
by {{ model.authors | value: post.author_id }}
|
||||
{% if logged_on %} • <a hx-boost="false" href="{{ post | edit_post_link }}">Edit Post</a> {% endif %}
|
||||
</h4>
|
||||
<div>
|
||||
<article class="container mt-3">
|
||||
<div>{{ post.text }}</div>
|
||||
{%- assign cat_count = post.category_ids | size -%}
|
||||
{% if cat_count > 0 -%}
|
||||
<h4 class="item-meta text-muted">
|
||||
Categorized under
|
||||
{% for cat_id in post.category_ids -%}
|
||||
{% assign cat = categories | where: "id", cat_id | first %}
|
||||
<span class="text-nowrap">
|
||||
<a href="{{ cat | category_link }}" title="Categorized under “{{ cat.name | escape }}”">
|
||||
{{ cat.name }}
|
||||
</a>
|
||||
</span>
|
||||
{% unless forloop.last %} • {% endunless %}
|
||||
{%- endfor %}
|
||||
</h4>
|
||||
{%- endif %}
|
||||
{%- assign tag_count = post.tags | size -%}
|
||||
{% if tag_count > 0 -%}
|
||||
<h4 class="item-meta text-muted">
|
||||
Tagged
|
||||
{% for tag in post.tags %}
|
||||
<span class="text-nowrap">
|
||||
<a href="{{ tag | tag_link }}" title="Posts tagged “{{ tag | escape }}”" rel="tag">{{ tag }}</a>
|
||||
</span>
|
||||
{% unless forloop.last %} • {% endunless %}
|
||||
{%- endfor %}
|
||||
</h4>
|
||||
{%- endif %}
|
||||
</article>
|
||||
<div>
|
||||
<nav aria-label="pagination">
|
||||
<ul class="pagination justify-content-evenly mt-5">
|
||||
{% if model.newer_link -%}
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="{{ model.newer_link.value | relative_link }}">{{ model.newer_name.value }}</a>
|
||||
<span class="text-muted">« Previous Post</span>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if model.older_link -%}
|
||||
<li class="page-item text-end">
|
||||
<a class="page-link" href="{{ model.older_link.value | relative_link }}">{{ model.older_name.value }}</a>
|
||||
<span class="text-muted">Next Post »</span>
|
||||
</li>
|
||||
{%- endif -%}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user