fix: timestamp for programmatically updated + now pages

This commit is contained in:
Cory Dransfeldt 2024-07-15 15:46:52 -07:00
parent b50a4670d2
commit 16eb58fe0f
No known key found for this signature in database
4 changed files with 15 additions and 8 deletions

View file

@ -1,7 +1,14 @@
---
layout: base
---
{%- capture updateTime -%}
{% if updated == "now" %}
{{ 'now' | date: "%B %-d, %l:%M %P", "America/Los_Angeles" }}
{% elsif page.updated %}
{{ page.updated | date: "%B %-d, %l:%M %P", "America/Los_Angeles" }}
{% endif %}
{%- endcapture -%}
<div class="main-wrapper">
<main>{{ content }}</main>
{% render "partials/footer.liquid", page:page, nav:nav, updated:page.updated %}
{% render "partials/footer.liquid", page:page, nav:nav, updated:updateTime %}
</div>

View file

@ -1,6 +1,6 @@
<footer{% unless updated %} style="margin-top:var(--sizing-3xl)"{% endunless %}>
{% if updated %}
<p class="explainer text-small text-centered"><em>This page was last updated on {{ updated | date: "%B %-d, %-I:%M%p", "America/Los_Angeles" }}.</em></p>
<p class="explainer text-small text-centered"><em>This page was last updated on {{ updated | strip }}.</em></p>
{% endif %}
<nav aria-label="Social icons" class="social flex-centered justify-centered text-centered">
{% for link in nav.footer_icons %}