Skip to content

Commit

Permalink
move last updated to sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
Pixel998 committed Feb 12, 2025
1 parent 261ccde commit 13596ba
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 0 additions & 3 deletions src/_includes/components/hero.macro.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
<div class="span-1-7 content-container">
{%- if params.post -%}
<p class="post__meta">Published <time datetime="{{ params.post.date }}">{{ params.post.date }}</time> under <a href="/blog/category/{{ params.post.categoryURL }}">{{ params.post.category }}</a></p>
{% if params.post.lastUpdated %}
<p class="post__meta">Last updated <time datetime="{{ params.post.lastUpdated }}">{{ params.post.lastUpdated }}</time></p>
{% endif %}
{%- endif -%}
<h1 class="section-title">{{ params.title }}</h1>
<p class="section-supporting-text">
Expand Down
4 changes: 0 additions & 4 deletions src/_includes/layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
{% set hero_title = title %}
{% set hero_supporting_text = teaser %}
{% set hero_date = page.date | readableDate %}
{% set git_last_updated = page.inputPath | gitLastUpdated %}
{% set last_updated = page.date if git_last_updated and git_last_updated < page.date else git_last_updated %}
{% set hero_last_updated = last_updated | readableDate if last_updated %}
{% set hero_category = categories[0] %}
{% set hero_category_url = categories[0] | slugify %}

Expand All @@ -29,7 +26,6 @@
supporting_text: hero_supporting_text,
post: {
date: hero_date,
lastUpdated: hero_last_updated,
category: hero_category,
categoryURL: hero_category_url
}
Expand Down
8 changes: 8 additions & 0 deletions src/_includes/partials/post-sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ <h2 class="post__sidebar-module__title">Contributors</h2>
{% endfor %}
</div>

{% set git_last_updated = page.inputPath | gitLastUpdated %}
{% set last_updated = page.date if git_last_updated and git_last_updated < page.date else git_last_updated %}
{% if last_updated %}
<div class="post__sidebar-module">
<h2 class="post__sidebar-module__title">Last updated <time datetime="{{ last_updated | readableDate }}">{{ last_updated | readableDate }}</time></h2>
</div>
{% endif %}

{% if tags %}
<div class="post__sidebar-module">
<h2 class="post__sidebar-module__title">Tags</h2>
Expand Down

0 comments on commit 13596ba

Please sign in to comment.