[DOCU-2624] Render page update timestamp in the page footer (HowTo ideas) Created: 13/Dec/22  Updated: 15/Dec/22

Status: In Progress
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Story Priority: Neutral
Reporter: Martin Drápela Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: File Commit Date Renderer.user.js     PNG File image-2022-12-13-16-18-18-701.png    
Sub-Tasks:
Key
Summary
Type
Status
Assignee
DOCU-2625 Testing solutions AM Sub-task In Progress Alex Mansell  
DOCU-2626 Testing solutions MD Sub-task Closed Martin Drápela  
DOCU-2627 Try core stamper functionality on a t... Sub-task Closed Martin Drápela  
DOCU-2628 Create stamp renderer JS Sub-task Closed Martin Drápela  
DOCU-2630 Cloning the hook issue Sub-task In Progress Martin Drápela  
Template:
Acceptance criteria:
Empty

 Description   

Possible solutions

Using pre-commit hooks

a) Run a pre-commit hook, adding (modifying) the first line of each file to be committed:

<updateStamp><output-of-Date.now()></updateStamp>

CSSed with:

updateStamp {display: none;}

b) On a live doc page, JavaScript the page for the highest value found in all stamps.

c) Then, do with it what's required, eg. display in a page footer as

"Page last updated on: <converted with toISOString()>"

Resources

Concerns/Thoughts

  • How do we get the .git folder to not be ignored as part of the build pipeline?
  • How do we potentially centralize the wording/content around the timestamp?
  • Can we ensure collaborative work (PRs) will reflect the correct permissions for .filters, .git, etc.?


 Comments   
Comment by Martin Drápela [ 13/Dec/22 ]

Implementation adapted from: https://stackoverflow.com/questions/14640306/git-hook-modify-commit-files

 

With PR https://git.magnolia-cms.com/projects/DOCUMENTATION/repos/product-docs/pull-requests/1322/overview

 

The pre-commit in pre-commit.zip must be upacked to .git/hooks/ manually.

It should then work automatically on a single page called pageupdate-test.adoc on the master62-dateStampedPages-test branch. Just update the page, hit the commit button, add commit message and ok, the unix INT time value should update automatically at the top of the page.

 

Generated at Mon Feb 12 01:28:46 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.