Use last commit date instead of unix mtime

* simplify last website mtime script
* link appropriate commit to last mtime
This commit is contained in:
thopic committed 2023-07-11 11:23:24 +02:00
1 parent 0b79ea838c
commit d0ee343b45
2 files changed
+9 -13

No files matched your search

+3 -4
View File
@@ -1,6 +1,5 @@
<?php
date_default_timezone_set('Europe/Paris');
$mtime = date("d M Y H:i:s", filemtime($this_file));
setlocale(LC_TIME, 'fr_FR.utf8','fra');
$last_rev = exec('git log -1 --pretty=format:"%H" '.$this_file);
$mtime = exec('LANG="fr_FR.UTF-8" git log -1 --pretty="format:%cr" '.$this_file);
?>
<p style="text-align:right;">Mis à jour le <?php echo strftime("%d %B %Y à %H:%M:%S UTC%z", strtotime($mtime)); ?></p>
<p style="text-align:right;">Dernière mise à jour <a href="https://git.gnous.fr/gnous/main_website/commit/<?php echo $last_rev;?>" target="_blank"><?php echo $mtime; ?></a></p>