1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-04 23:39:57 +00:00
TiddlyWiki5/core/templates/store.info.tiddler.template.tid
pmario c89b351cb4 add new store.info.template and store.info.tiddler.template tiddlers
the info.tiddler.template is tagged: $:/tags/InfoTiddlerTemplate so
several tagged tiddlers can be injected, if needed.

Important: The templates have to use the TW HTML template syntax

On branch 6684-add-last-saved-timestamp
Changes to be committed:
	new file:   core/templates/store.info.template.html.tid
	new file:   core/templates/store.info.tiddler.template.tid
2024-01-31 10:40:35 +01:00

22 lines
1.2 KiB
Plaintext

title: $:/core/templates/store.info.tiddler.template
tags: $:/tags/InfoTiddlerTemplate
<!-- This template will be injected into the html file when the wiki is saved. It is activated by $:/core/templates/store.info.template.html -->
\whitespace trim
\procedure readableFormat() [UTC]YYYY-0MM-0DD 0hh:0mm:0ss.0XXX UTC TZD
<!-- It's needed to use variables, to have the absolute same timestamp for all tiddlers -->
<$let
timestamp={{{ [<now format:[UTC]YYYY0MM0DD0hh0mm0ss0XXX>] }}}
timeReadable={{{ [<timestamp>format:date<readableFormat>] }}}
>
<% if [{$:/info/browser}match[yes]] %>
`{"title": "$:/info/last-saved/timestamp", "created":"`<<timestamp>>`", "modified":"`<<timestamp>>`", "text":"`<<timestamp>>`"}`
<$text text=<<join>>/>
`{"title": "$:/info/last-saved/date", "created":"`<<timestamp>>`", "modified":"`<<timestamp>>`", "text":"`<<timeReadable>>`"}`
<% elseif [{$:/info/node}match[yes]] %>
`{"title": "$:/info/server-created-wiki/timestamp", "created":"`<<timestamp>>`", "modified":"`<<timestamp>>`", "text":"`<<timestamp>>`"}`
<$text text=<<join>>/>
`{"title": "$:/info/server-created-wiki/date", "created":"`<<timestamp>>`", "modified":"`<<timestamp>>`", "text":"`<<timeReadable>>`"}`
<% endif %>
</$let>