[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: |
|
||||||||||||||||||||||||||||||
| Sub-Tasks: |
|
||||||||||||||||||||||||||||||
| 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
|
| 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.
|