From 1cb8cd68cc7e4e244c66a73ea69dcb0461b9b41d Mon Sep 17 00:00:00 2001 From: mjfernez Date: Sat, 25 Nov 2023 13:04:03 -0500 Subject: Change latest page to show first write date Previous was to show the last update to the page --- files/latest.html | 22 +++++++++++----------- update_latest.py | 10 ++++++---- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/files/latest.html b/files/latest.html index dfc1bab..c524e9a 100644 --- a/files/latest.html +++ b/files/latest.html @@ -1,17 +1,17 @@ -

LATEST CHANGES

+

LATEST POSTS

diff --git a/update_latest.py b/update_latest.py index 94bf5a2..26bff62 100644 --- a/update_latest.py +++ b/update_latest.py @@ -5,9 +5,11 @@ from datetime import date from email.utils import parsedate def file_last_modified(path): - git_time = f"git log -n1 --pretty=%aD {path}".split() + git_log = f"git log --pretty=%aD {path}".split() try: - mod_time = subprocess.check_output(git_time) + ps = subprocess.Popen(git_log, stdout=subprocess.PIPE) + mod_time = subprocess.check_output(["tail", "-n1"], + stdin=ps.stdout) except: # File is not in the git log, no biggie, just blank the date return None @@ -30,14 +32,14 @@ for top in dirs: updates[path] = mktime(t) print("") print("") -print("

LATEST CHANGES

") +print("

LATEST POSTS

") print("") print("") -- cgit v1.2.3