diff --git a/gitgen.py b/gitgen.py
index 61bc39c..cbfec6b 100644
--- a/gitgen.py
+++ b/gitgen.py
@@ -175,14 +175,24 @@ class GitRepoScanner:
for line in log.strip().split('\n'):
parts = line.split('|', 5)
if len(parts) == 6:
+ commit_hash = parts[0]
+ # Get tags for this commit
+ tags_output = self.run_git_command(repo_path, [
+ 'tag', '--points-at', commit_hash
+ ])
+ tags = []
+ if tags_output:
+ tags = [tag.strip() for tag in tags_output.strip().split('\n') if tag.strip()]
+
commits.append({
- 'hash': parts[0],
- 'short_hash': parts[0][:7],
+ 'hash': commit_hash,
+ 'short_hash': commit_hash[:7],
'author': parts[1],
'email': parts[2],
'date': parts[3],
'message': parts[4],
'parent_hash': parts[5],
+ 'tags': tags,
'author_escaped': html.escape(parts[1]),
'email_escaped': html.escape(parts[2]),
'message_escaped': html.escape(parts[4]).replace('\n', '<br>'),
@@ -245,14 +255,14 @@ class HTMLGenerator:
self.output_dir.mkdir(exist_ok=True)
def generate_index(self, repos: List[Dict]) -> str:
- """Generate main index page with table layout"""
+ """Generate main index page"""
html_fragments = [
"""<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Git Repositories</title>
+ <title>Cybrkyd's Git Repositories</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
@@ -296,7 +306,8 @@ class HTMLGenerator:
</div>
<div class="footer">
- <p>Static Git Repository Browser • Generated on {}</p>
+ <p>Made with GitGen by Cybrkyd</p>
+ <p>Generated on {}</p>
</div>
</body>
</html>""".format(datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')))
@@ -346,7 +357,7 @@ class HTMLGenerator:
</div>
<div class="footer">
- <p>Repository: {repo['name_escaped']} • Generated on {datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}</p>
+ <p>Made with GitGen by Cybrkyd</p>
</div>
</body>
</html>"""
@@ -417,7 +428,7 @@ class HTMLGenerator:
</div>
<div class="footer">
- <p>Repository: {repo['name_escaped']} • Generated on {datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}</p>
+ <p>Made with GitGen by Cybrkyd</p>
</div>
</body>
</html>""")
@@ -425,7 +436,7 @@ class HTMLGenerator:
return "".join(html_fragments)
def generate_commits_page(self, repo: Dict, commits: List[Dict]) -> str:
- """Generate commits page"""
+ """Generate commits list page"""
html_fragments = [
f"""<!DOCTYPE html>
<html lang="en">
@@ -460,6 +471,13 @@ class HTMLGenerator:
for commit in commits:
commit_details = self.scanner.get_commit_details(repo['path'], commit['hash'])
formatted_message = commit_details.get('message_escaped', '') if commit_details else commit.get('message_escaped', '')
+
+ # Generate tags HTML if present
+ tags_html = ""
+ if commit.get('tags'):
+ tags_list = " ".join([f'<span class="tag-badge">{html.escape(tag)}</span>' for tag in commit['tags']])
+ tags_html = f'<span class="label" >tag:</span>{tags_list}</span>'
+
html_fragments.append(f"""
<div class="commit-item commit-meta">
<span class="label">commit:</span>
@@ -468,6 +486,7 @@ class HTMLGenerator:
<span class="value">{commit['date']}</span>
<span class="label">author:</span>
<span class="value">{commit['author_escaped']} <{commit['email_escaped']}></span>
+ {tags_html}
<div class="commit-message-box">
<h3>Commit Message</h3>
@@ -487,7 +506,7 @@ class HTMLGenerator:
</div>
<div class="footer">
- <p>Repository: {repo['name_escaped']} • Generated on {datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}</p>
+ <p>Made with GitGen by Cybrkyd</p>
</div>
</body>
</html>""")
@@ -630,7 +649,7 @@ class HTMLGenerator:
''' if commit_details.get('diff') else ''}
<div class="footer">
- <p>Repository: {repo['name_escaped']} • Commit: {commit_details['short_hash']} • Generated on {datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}</p>
+ <p>Made with GitGen by Cybrkyd</p>
</div>
</body>
</html>"""