Skip to content

Commit

Permalink
Link to GitHub history of page
Browse files Browse the repository at this point in the history
The previous commit added the last updated date to the bottom of each
contentful page. This adds a link to the respective GitHub history page,
for more detailed information (e.g. to check that the last update was
meaningful and not just a dev fixing formatting across multiple files)

The last updated date could in some cases give a misleading sense of
security that the page is more up to date than its content, so this
provides a quick way to check
  • Loading branch information
yndajas committed May 9, 2023
1 parent 548e280 commit 7675bf8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/_includes/page-content.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% capture last_modified_at %}{{ page.last_modified_at | date: '%s' }}{% endcapture %}
{% capture last_reviewed_at %}{{ page.last_reviewed_at | date: '%s' }}{% endcapture %}
{% capture commit_history_url %}https://github.com/dxw/playbook/commits/main/src/{{ page.path }}{% endcapture %}

<article class="page-content">
<div>
Expand All @@ -21,7 +22,7 @@ <h1>{{ page.title }}</h1>
Last reviewed: {{ page.last_reviewed_at | date: "%-d %B %Y" }}
<br>
{% endif %}
Last updated: {{ page.last_modified_at | date: "%-d %B %Y" }}
Last updated: {{ page.last_modified_at | date: "%-d %B %Y" }} (<a href="{{ commit_history_url }}">history</a>)
</i>
</p>
{% endif %}
Expand Down

0 comments on commit 7675bf8

Please sign in to comment.