Add all categories to post render context

- Convert post date/time to web log timezone
This commit is contained in:
2022-04-26 22:24:17 -04:00
parent ff87a71c9c
commit 6e7f4cc8ce
8 changed files with 66 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
<div class="content">
{% for post in model.posts %}
{%- for post in model.posts %}
<article class="item">
<h1 class="item-heading">
<a href="/{{ post.permalink }}" title="Permanent Link to &quot;{{ post.title | escape }}&quot;">
@@ -8,11 +8,11 @@
</h1>
<h4 class="text-center">
<i class="fa fa-calendar" title="Date"></i> {{ post.published_on | date: "MMMM d, yyyy" }} &nbsp;
<i class="fa fa-clock-o" title="Time"></i> {{ post.published_on | date: "h:mmtt" | downcase }}
<i class="fa fa-clock-o" title="Time"></i> {{ post.published_on | date: "h:mm tt" | downcase }}
</h4>
{{ post.text }}
</article>
{% endfor %}
{%- endfor %}
<nav aria-label="pagination">
<ul class="pager">
{% if model.newer_link -%}
@@ -52,8 +52,13 @@
</div>
<div class="item">
<h4 class="item-heading">Categories</h4>
<div>
TODO: list_categories({ class: 'cat' })
</div>
<ul class="cat-list">
{% for cat in categories -%}
{%- assign indent = cat.parent_names | size -%}
<li class="cat-list-item"{% if indent > 0 %} style="padding-left:{{ indent }}rem;"{% endif %}>
<a href="/category/{{ cat.slug }}" class="cat-list-link">{{ cat.name }}</a>
</li>
{%- endfor %}
</ul>
</div>
</div>

View File

@@ -11,7 +11,7 @@
<link rel="preload" href="/themes/{{ web_log.theme_path }}/style.css" as="style">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link rel="stylesheet" href="/themes/{{ web_log.theme_path }}/style.css">
{% if is_home -%}
{%- if is_home %}
<link rel="alternate" type="application/rss+xml" title="{{ web_log.name | escape }}" href="/feed.xml">
{%- endif %}
<script src="/themes/{{ web_log.theme_path }}/djs.js"></script>
@@ -21,9 +21,9 @@
<p><a class="nav-home" href="/">{{ web_log.name }}</a></p>
{%- if web_log.subtitle %}<p>{{ web_log.subtitle.value }}</p>{% endif -%}
<p class="nav-spacer"></p>
{% for page in page_list %}
{%- for page in page_list %}
<p class="desktop"><a href="/{{ page.permalink }}">{{ page.title }}</a></p>
{% endfor %}
{%- endfor %}
<p class="desktop">
<a href="https://devotions.summershome.org" target="_blank" rel="noopener">A Word from the Word</a>
</p>
@@ -31,9 +31,9 @@
</nav>
{{ content }}
<footer class="part-1" id="links">
{% for page in page_list %}
{%- for page in page_list %}
<p class="mobile"><a href="{{ page.permalink }}">{{ page.title }}</a></p>
{% endfor %}
{%- endfor %}
<p class="mobile">
<a href="https://devotions.summershome.org" target="_blank" rel="noopener">A Word from the Word</a>
</p>

View File

@@ -5,7 +5,7 @@
<h4 class="text-center">
{% if post.published_on -%}
<i class="fa fa-calendar" title="Date"></i> {{ post.published_on | date: "MMMM d, yyyy" }} &nbsp;
<i class="fa fa-clock-o" title="Time"></i> {{ post.published_on | date: "h:mmtt" | downcase }}
<i class="fa fa-clock-o" title="Time"></i> {{ post.published_on | date: "h:mm tt" | downcase }}
{%- else -%}
**DRAFT**
{% endif %}
@@ -15,12 +15,12 @@
{% if cat_count > 0 -%}
<h4>
Categorized &nbsp;
{% for cat in post.category_ids -%}
{% assign cat_name = model.categories | value: cat %}
{% for cat_id in post.category_ids -%}
{% assign cat = categories | where: "id", cat_id | first %}
<span class="no-wrap">
<i class="fa fa-folder-open-o" title="Category"></i>
<a href="/category/{{ cat }}" title="Categorized under &ldquo;{{ cat_name | escape }}&rdquo;">
{{ cat_name }}
<a href="/category/{{ cat.slug }}" title="Categorized under &ldquo;{{ cat.name | escape }}&rdquo;">
{{ cat.name }}
</a> &nbsp; &nbsp;
</span>
{%- endfor %}