diff --git a/.github/resources/changelog-index-generator.py b/.github/resources/changelog-index-generator.py
index 7ad1bddfad..a92589ca36 100644
--- a/.github/resources/changelog-index-generator.py
+++ b/.github/resources/changelog-index-generator.py
@@ -1,45 +1,57 @@
import os
-
-# pip install packaging
from packaging.version import parse as parse_version
+from datetime import datetime
+import git
BREAK = "\n"
# folder path
dir_path = r'./changelog-versions'
-# list to store files
-changelog_files_extension = []
+# list to store files with creation dates and first commit dates
+changelog_files_with_dates = []
# Iterate directory
for path in os.listdir(dir_path):
# check if current path is a file
if os.path.isfile(os.path.join(dir_path, path)):
- changelog_files_extension.append(path)
- if path == ".DS_Store":
- changelog_files_extension.remove(path)
-# print(changelog_files_extension)
+ file_name = path.replace('.md', '') # Remove extension
+ file_path = os.path.join(dir_path, path)
+
+ # Get first commit date using gitpython
+ repo = git.Repo(search_parent_directories=True)
+ first_commit_date = repo.git.log('--format=%aI', '--', file_path).splitlines()[-1]
-# Remove extension from files
-changelog_files = list(
- map(lambda x: x.replace('.md', ''), changelog_files_extension))
-# print(changelog_files)
+ # Format the date
+ first_commit_date = datetime.fromisoformat(first_commit_date).strftime('%Y-%m-%d')
+
+ changelog_files_with_dates.append((file_name, first_commit_date))
# Sort files by version
-changelog_files_sorted = sorted(changelog_files, reverse=True, key=lambda x: [int(
- i) if i.isdigit() else i for i in x.split('.')])
-print(changelog_files_sorted)
+changelog_files_with_dates_sorted = sorted(changelog_files_with_dates, reverse=True, key=lambda x: [int(
+ i) if i.isdigit() else i for i in x[0].split('.')])
+# Generate list of versions in HTML table format
changelog_version = ""
-# Generate list of versions in markdown format
-for item in changelog_files_sorted:
- # print(item)
- # If version is major, then use ## for make this version as a "large" title
- major = "## " if item.endswith('.0.0') else ""
- changelog_version += major + "[" + item + "]" + \
- "(" + "changelog-versions/" + item + ".md" + ")" + BREAK + BREAK
- # print(changelog_version)
+# Agregar el encabezado de la tabla en HTML
+changelog_version += "
\n"
+changelog_version += "Version | Release date |
\n"
+
+for item, first_commit_date in changelog_files_with_dates_sorted:
+ if item.endswith('.0.0'):
+ major = f"{item}"
+ else:
+ major = f"{item}"
+
+ # Agregar una fila de la tabla en HTML para cada versión
+ changelog_version += f"{major} | {first_commit_date} |
\n"
+
+# Cerrar la tabla HTML
+changelog_version += "
\n"
+
+# Agregar saltos de línea según tu BREAK
+changelog_version += BREAK + BREAK
# Empty line
print()
@@ -47,7 +59,6 @@
# Draw markdown file
file_content = "# Figma Changelog" + BREAK + BREAK + changelog_version + "---" + BREAK + \
"[Changelog history →](https://paper.dropbox.com/doc/Changelog-Mistica-Design-System--BlDyPv0kWq8W502b64VVIPMsAQ-il1pWXaGur0Nm88P831X2)" + BREAK
-print(file_content)
# Save file
output_file_path = "./CHANGELOG.md"
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6c1b1b4adc..6670eadd99 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,72 +1,43 @@
# Figma Changelog
-[11.1.0](changelog-versions/11.1.0.md)
+
-## [11.0.0](changelog-versions/11.0.0.md)
-
-## [10.0.0](changelog-versions/10.0.0.md)
-
-[9.3.0](changelog-versions/9.3.0.md)
-
-[9.2.0](changelog-versions/9.2.0.md)
-
-[9.1.0](changelog-versions/9.1.0.md)
-
-## [9.0.0](changelog-versions/9.0.0.md)
-
-[8.4.0](changelog-versions/8.4.0.md)
-
-[8.3.0](changelog-versions/8.3.0.md)
-
-[8.2.0](changelog-versions/8.2.0.md)
-
-[8.1.0](changelog-versions/8.1.0.md)
-
-## [8.0.0](changelog-versions/8.0.0.md)
-
-[7.3.0](changelog-versions/7.3.0.md)
-
-[7.2.0](changelog-versions/7.2.0.md)
-
-[7.1.1](changelog-versions/7.1.1.md)
-
-[7.1.0](changelog-versions/7.1.0.md)
-
-[7.0.2](changelog-versions/7.0.2.md)
-
-[7.0.1](changelog-versions/7.0.1.md)
-
-## [7.0.0](changelog-versions/7.0.0.md)
-
-[6.3.0](changelog-versions/6.3.0.md)
-
-[6.2.0](changelog-versions/6.2.0.md)
-
-[6.1.0](changelog-versions/6.1.0.md)
-
-## [6.0.0](changelog-versions/6.0.0.md)
-
-[5.4.0](changelog-versions/5.4.0.md)
-
-[5.3.0](changelog-versions/5.3.0.md)
-
-[5.2.2](changelog-versions/5.2.2.md)
-
-[5.2.1](changelog-versions/5.2.1.md)
-
-[5.2.0](changelog-versions/5.2.0.md)
-
-[5.1.0](changelog-versions/5.1.0.md)
-
-## [5.0.0](changelog-versions/5.0.0.md)
-
-[4.11.0](changelog-versions/4.11.0.md)
-
-[4.10.0](changelog-versions/4.10.0.md)
-
-[4.9.0](changelog-versions/4.9.0.md)
-
-[4.8.0](changelog-versions/4.8.0.md)
---
[Changelog history →](https://paper.dropbox.com/doc/Changelog-Mistica-Design-System--BlDyPv0kWq8W502b64VVIPMsAQ-il1pWXaGur0Nm88P831X2)