Skip to content

Commit

Permalink
add last updated date to posts (alshedivat#2341)
Browse files Browse the repository at this point in the history
This PR is related to alshedivat#2309. I added an optional `last_updated` field.
This new field represents the timestamp for when the post was last
updated. Consequently, the existing `date` metadata should now be
interpreted as the creation date of the post.

The formatting for displaying these dates has been standardized as
follows:

```text
Created: July 11, 2023   |   Last Updated: April 14, 2024
```

For a practical implementation example, please refer to [this
post](https://torydeng.github.io/blog/2023/deploying-server/) on my
website, where I have applied these changes.

---

Any feedback is wellcome.
  • Loading branch information
ToryDeng authored and Suraj-Bhor committed Aug 13, 2024
1 parent f4e2007 commit 7933ecc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions _layouts/post.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ layout: default
<header class="post-header">
<h1 class="post-title">{{ page.title }}</h1>
<p class="post-meta">
{{ page.date | date: '%B %d, %Y' }}
{% if page.author %}• {{ page.author }}{% endif %}
Created in {{ page.date | date: '%B %d, %Y' }}
{% if page.author %}by {{ page.author }}{% endif %}
{% if page.last_updated %}, last updated in {{ page.last_updated | date: '%B %d, %Y' }}{% endif %}
{% if page.meta %}• {{ page.meta }}{% endif %}
</p>
<p class="post-tags">
Expand Down
1 change: 1 addition & 0 deletions _posts/2024-01-27-vega-lite.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
layout: post
title: a post with vega lite
date: 2024-01-27 00:20:00
last_updated: 2024-04-14 04:30:00
description: this is what included vega lite code could look like
tags: formatting charts
categories: sample-posts
Expand Down

0 comments on commit 7933ecc

Please sign in to comment.