diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e290340..107b5f5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,3 +27,9 @@ repos: language: system types: [python] args: ["--rcfile=pyproject.toml"] + + - id: update-index-date + name: update-index-date + entry: poetry run python scripts/update_index_date.py + language: system + pass_filenames: false diff --git a/index.html b/index.html index fedef61..8ccfba4 100644 --- a/index.html +++ b/index.html @@ -39,7 +39,7 @@ "url": "https://sayyedasif.com/", "jobTitle": "Data Scientist" }, - "dateModified": "2026-07-25" + "dateModified": "2026-07-26" }, { "@context": "https://schema.org", @@ -53,7 +53,7 @@ "name": "Asif Sayyed", "url": "https://sayyedasif.com/" }, - "dateModified": "2026-07-25" + "dateModified": "2026-07-26" }, { "@context": "https://schema.org", @@ -143,7 +143,7 @@
-
Project by Asif Sayyed | Last Updated:
+
Project by Asif Sayyed | Last Updated:

The Ship of Theseus

Track how much of your codebase's original code still diff --git a/scripts/update_index_date.py b/scripts/update_index_date.py new file mode 100644 index 0000000..f304c86 --- /dev/null +++ b/scripts/update_index_date.py @@ -0,0 +1,32 @@ +import re +import datetime +from pathlib import Path + +def update_date(): + index_path = Path("index.html") + if not index_path.exists(): + return + + content = index_path.read_text(encoding="utf-8") + original_content = content + + now = datetime.datetime.now() + iso_date = now.strftime("%Y-%m-%d") + human_date = now.strftime("%B %d, %Y").replace(" 0", " ") # Format like 'July 26, 2026' + + # Update dateModified in JSON-LD + content = re.sub(r'"dateModified": "\d{4}-\d{2}-\d{2}"', f'"dateModified": "{iso_date}"', content) + + # Update time tag + content = re.sub( + r'', + f'', + content + ) + + if content != original_content: + index_path.write_text(content, encoding="utf-8") + print(f"Updated index.html date to {iso_date}") + +if __name__ == "__main__": + update_date()