Skip to content

Commit a29e24a

Browse files
authored
add last updated date to posts (cotes2020#2341)
This PR is related to cotes2020#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.
1 parent 06ca08c commit a29e24a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

_layouts/post.liquid

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ layout: default
1818
<header class="post-header">
1919
<h1 class="post-title">{{ page.title }}</h1>
2020
<p class="post-meta">
21-
{{ page.date | date: '%B %d, %Y' }}
22-
{% if page.author %}• {{ page.author }}{% endif %}
21+
Created in {{ page.date | date: '%B %d, %Y' }}
22+
{% if page.author %}by {{ page.author }}{% endif %}
23+
{% if page.last_updated %}, last updated in {{ page.last_updated | date: '%B %d, %Y' }}{% endif %}
2324
{% if page.meta %}• {{ page.meta }}{% endif %}
2425
</p>
2526
<p class="post-tags">

_posts/2024-01-27-vega-lite.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
layout: post
33
title: a post with vega lite
44
date: 2024-01-27 00:20:00
5+
last_updated: 2024-04-14 04:30:00
56
description: this is what included vega lite code could look like
67
tags: formatting charts
78
categories: sample-posts

0 commit comments

Comments
 (0)