From: Mischa POSLAWSKY Date: Wed, 2 Dec 2020 22:46:30 +0000 (+0100) Subject: page: record creation time in template meta tag X-Git-Tag: v4.5~6 X-Git-Url: http://git.shiar.nl/minimedit.git/commitdiff_plain/063591ce4b064ed149aad58f0c619895c9ae4014 page: record creation time in template meta tag Another https://ogp.me/#no_vertical object for availability start. May be distinct from chosen (eg historic) dates shown for news articles. Values may be reconstructed for existing files from Git history: perl -i -pE ' close ARGV if eof; # reset line number $. == 1 or next; # ignore consecutive lines my $first = qx{git log --follow --pretty=%ai -- "$ARGV" | tail -n1} or next; # find earliest commit time chomp $first; print qq{}; say "" unless /^raw) and $User->admin("edit {$Article->link}")) { # open template as initial contents $Article->raw(file_exists("$Page/template.inc.html") ? "$Page/template.inc.html" : 'template.inc.html'); + $Article->meta['article:published_time'] = date('Y-m-d h:i:s O'); $Article->meta['article:author'] = '/' . $User->dir; }