From 1f1e82d6c409ed49f5307298c51b2e1360702a1a Mon Sep 17 00:00:00 2001 From: Sebastian Gode Date: Wed, 18 Sep 2024 07:27:54 +0000 Subject: [PATCH] Update confpy template --- templates/conf.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/templates/conf.py b/templates/conf.py index c578a1ca4..d7d040e68 100644 --- a/templates/conf.py +++ b/templates/conf.py @@ -16,6 +16,8 @@ import os import sys +from git import Repo +from datetime import datetime extensions = [ 'otcdocstheme', @@ -118,3 +120,8 @@ latex_documents = [ {% endif -%} ] +# Get the Git commit values for last updated timestamp on each page +repo = Repo(search_parent_directories=True) +commit = repo.head.commit +current_commit_hash = commit.hexsha +current_commit_time = commit.committed_datetime.strftime('%Y-%m-%d %H:%M')