diff --git a/gitgen.py b/gitgen.py
index 45b297e..c69345a 100644
--- a/gitgen.py
+++ b/gitgen.py
@@ -15,11 +15,10 @@ import markdown
import re
from concurrent.futures import ThreadPoolExecutor
- ### Global config ###
- BASE_NAME = "Cybrkyd's git repositories"
+ # Global configuration
+ BASE_NAME = "Cybrkyd's Git Repositories"
BASE_URL = "https://git.cybrkyd.com"
- BASE_DESC = "Cybrkyd's Git Repositories. Welcome to my playpen."
- ###
+ BASE_DESC = "Cybrkyd's code, commits and diffs playground."
class GitRepoScanner:
"""Scans and processes Git repositories"""
@@ -279,33 +278,45 @@ class HTMLGenerator:
time_str = footer_time.strftime('%Y-%m-%d %H:%M:%S %z')
html_fragments = [
- """<!DOCTYPE html>
+ f"""<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>""" + BASE_NAME + """</title>
- <meta name="description" content=\"""" + BASE_DESC + """\">
+ <title>{BASE_NAME}</title>
+ <meta name="description" content="{BASE_DESC}">
<link rel="stylesheet" href="main.css">
<!-- Open Graph -->
- <meta property="og:site_name" content=\"""" + BASE_NAME + """\">
- <meta property="og:url" content=\"""" + BASE_URL + """\">
- <meta property="og:title" content=\"""" + BASE_NAME + """\">
- <meta property="og:description" content=\"""" + BASE_DESC + """\">
+ <meta property="og:site_name" content="{BASE_NAME}">
+ <meta property="og:url" content="{BASE_URL}">
+ <meta property="og:title" content="{BASE_NAME}">
+ <meta property="og:description" content="{BASE_DESC}">
<meta property="og:type" content="website">
<meta property="og:locale" content="en_GB">
<!-- Twitter Card -->
<meta property="twitter:card" content="summary">
- <meta property="twitter:url" content=\"""" + BASE_URL + """\">
- <meta property="twitter:title" content=\"""" + BASE_NAME + """\">
- <meta property="twitter:description" content=\"""" + BASE_DESC + """\">
+ <meta property="twitter:url" content="{BASE_URL}">
+ <meta property="twitter:title" content="{BASE_NAME}">
+ <meta property="twitter:description" content="{BASE_DESC}">
+
+ <!-- Microdata -->
+ <script type="application/ld+json">
+ {{
+ "@context": "http://schema.org",
+ "@type": "website",
+ "name": "{BASE_NAME}",
+ "headline": "{BASE_NAME}",
+ "url": "{BASE_URL}",
+ "description": "{BASE_DESC}"
+ }}
+ </script>
</head>
<body>
<div class="header">
- <h1><a href="/" title="gitgen"> <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 21 21" width="38" height="38" fill="none" stroke="#222222" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4.13 1.101v12.56m11.972-6.28a2.993 3.14 0 1 0 0-6.28 2.993 3.14 0 0 0 0 6.28M4.13 19.94a2.993 3.14 0 1 0 0-6.28 2.993 3.14 0 0 0 0 6.28" style="stroke-width:2.04357"/><path d="M13.109 4.241a8.978 9.42 0 0 0-8.978 9.42" style="stroke-width:2.04357"/><path stroke="#0f0" d="M16.172 13.915v6m3-3h-6"/><path stroke="red" d="M19.135 11.43h-6"/></svg></a> Cybrkyd's git repositories</h1>
- <p>Listing {} repositories</p>
+ <h1><a href="/" title="gitgen"> <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 21 21" width="38" height="38" fill="none" stroke="#222222" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4.13 1.101v12.56m11.972-6.28a2.993 3.14 0 1 0 0-6.28 2.993 3.14 0 0 0 0 6.28M4.13 19.94a2.993 3.14 0 1 0 0-6.28 2.993 3.14 0 0 0 0 6.28" style="stroke-width:2.04357"/><path d="M13.109 4.241a8.978 9.42 0 0 0-8.978 9.42" style="stroke-width:2.04357"/><path stroke="#0f0" d="M16.172 13.915v6m3-3h-6"/><path stroke="red" d="M19.135 11.43h-6"/></svg></a> {BASE_NAME}</h1>
+ <p>Listing {len(repos)} repositories</p>
</div>
<div class="repo-list">
@@ -318,7 +329,7 @@ class HTMLGenerator:
<th>Last Commit</th>
</tr>
</thead>
- <tbody>""".format(len(repos))
+ <tbody>"""
]
for repo in repos:
@@ -340,9 +351,7 @@ class HTMLGenerator:
html_fragments.append(f"""
<tr>
<td class="repo-name">
- <a href="{repo['name']}/index.html" class="repo-link">
- {repo['name_escaped']}
- </a>
+ <a href="{repo['name']}/index.html" class="repo-link">{repo['name_escaped']}</a>
</td>
<td class="repo-description">{repo['description_escaped']}</td>
<td class="repo-owner">{repo['owner_escaped']}</td>
@@ -377,7 +386,7 @@ class HTMLGenerator:
</head>
<body>
<div class="header">
- <h1><a href="../index.html" title="gitgen"> <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 21 21" width="38" height="38" fill="none" stroke="#222222" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4.13 1.101v12.56m11.972-6.28a2.993 3.14 0 1 0 0-6.28 2.993 3.14 0 0 0 0 6.28M4.13 19.94a2.993 3.14 0 1 0 0-6.28 2.993 3.14 0 0 0 0 6.28" style="stroke-width:2.04357"/><path d="M13.109 4.241a8.978 9.42 0 0 0-8.978 9.42" style="stroke-width:2.04357"/><path stroke="#0f0" d="M16.172 13.915v6m3-3h-6"/><path stroke="red" d="M19.135 11.43h-6"/></svg></a> Cybrkyd's git repositories</h1>
+ <h1><a href="../index.html" title="gitgen"> <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 21 21" width="38" height="38" fill="none" stroke="#222222" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4.13 1.101v12.56m11.972-6.28a2.993 3.14 0 1 0 0-6.28 2.993 3.14 0 0 0 0 6.28M4.13 19.94a2.993 3.14 0 1 0 0-6.28 2.993 3.14 0 0 0 0 6.28" style="stroke-width:2.04357"/><path d="M13.109 4.241a8.978 9.42 0 0 0-8.978 9.42" style="stroke-width:2.04357"/><path stroke="#0f0" d="M16.172 13.915v6m3-3h-6"/><path stroke="red" d="M19.135 11.43h-6"/></svg></a> {BASE_NAME}</h1>
<p>{repo['name_escaped']}</p>
</div>
@@ -433,7 +442,7 @@ class HTMLGenerator:
</head>
<body>
<div class="header">
- <h1><a href="../index.html" title="gitgen"> <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 21 21" width="38" height="38" fill="none" stroke="#222222" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4.13 1.101v12.56m11.972-6.28a2.993 3.14 0 1 0 0-6.28 2.993 3.14 0 0 0 0 6.28M4.13 19.94a2.993 3.14 0 1 0 0-6.28 2.993 3.14 0 0 0 0 6.28" style="stroke-width:2.04357"/><path d="M13.109 4.241a8.978 9.42 0 0 0-8.978 9.42" style="stroke-width:2.04357"/><path stroke="#0f0" d="M16.172 13.915v6m3-3h-6"/><path stroke="red" d="M19.135 11.43h-6"/></svg></a> Cybrkyd's git repositories</h1>
+ <h1><a href="../index.html" title="gitgen"> <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 21 21" width="38" height="38" fill="none" stroke="#222222" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4.13 1.101v12.56m11.972-6.28a2.993 3.14 0 1 0 0-6.28 2.993 3.14 0 0 0 0 6.28M4.13 19.94a2.993 3.14 0 1 0 0-6.28 2.993 3.14 0 0 0 0 6.28" style="stroke-width:2.04357"/><path d="M13.109 4.241a8.978 9.42 0 0 0-8.978 9.42" style="stroke-width:2.04357"/><path stroke="#0f0" d="M16.172 13.915v6m3-3h-6"/><path stroke="red" d="M19.135 11.43h-6"/></svg></a> {BASE_NAME}</h1>
<p>{repo['name_escaped']} - {len(files):,} files</p>
</div>
@@ -498,7 +507,7 @@ class HTMLGenerator:
</head>
<body>
<div class="header">
- <h1><a href="../index.html" title="gitgen"> <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 21 21" width="38" height="38" fill="none" stroke="#222222" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4.13 1.101v12.56m11.972-6.28a2.993 3.14 0 1 0 0-6.28 2.993 3.14 0 0 0 0 6.28M4.13 19.94a2.993 3.14 0 1 0 0-6.28 2.993 3.14 0 0 0 0 6.28" style="stroke-width:2.04357"/><path d="M13.109 4.241a8.978 9.42 0 0 0-8.978 9.42" style="stroke-width:2.04357"/><path stroke="#0f0" d="M16.172 13.915v6m3-3h-6"/><path stroke="red" d="M19.135 11.43h-6"/></svg></a> Cybrkyd's git repositories</h1>
+ <h1><a href="../index.html" title="gitgen"> <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 21 21" width="38" height="38" fill="none" stroke="#222222" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4.13 1.101v12.56m11.972-6.28a2.993 3.14 0 1 0 0-6.28 2.993 3.14 0 0 0 0 6.28M4.13 19.94a2.993 3.14 0 1 0 0-6.28 2.993 3.14 0 0 0 0 6.28" style="stroke-width:2.04357"/><path d="M13.109 4.241a8.978 9.42 0 0 0-8.978 9.42" style="stroke-width:2.04357"/><path stroke="#0f0" d="M16.172 13.915v6m3-3h-6"/><path stroke="red" d="M19.135 11.43h-6"/></svg></a> {BASE_NAME}</h1>
<p>{repo['name_escaped']} - Commit History</p>
</div>
@@ -687,7 +696,7 @@ class HTMLGenerator:
</head>
<body>
<div class="header">
- <h1><a href="../../index.html" title="gitgen"> <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 21 21" width="38" height="38" fill="none" stroke="#222222" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4.13 1.101v12.56m11.972-6.28a2.993 3.14 0 1 0 0-6.28 2.993 3.14 0 0 0 0 6.28M4.13 19.94a2.993 3.14 0 1 0 0-6.28 2.993 3.14 0 0 0 0 6.28" style="stroke-width:2.04357"/><path d="M13.109 4.241a8.978 9.42 0 0 0-8.978 9.42" style="stroke-width:2.04357"/><path stroke="#0f0" d="M16.172 13.915v6m3-3h-6"/><path stroke="red" d="M19.135 11.43h-6"/></svg></a> Cybrkyd's git repositories</h1>
+ <h1><a href="../../index.html" title="gitgen"> <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 21 21" width="38" height="38" fill="none" stroke="#222222" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4.13 1.101v12.56m11.972-6.28a2.993 3.14 0 1 0 0-6.28 2.993 3.14 0 0 0 0 6.28M4.13 19.94a2.993 3.14 0 1 0 0-6.28 2.993 3.14 0 0 0 0 6.28" style="stroke-width:2.04357"/><path d="M13.109 4.241a8.978 9.42 0 0 0-8.978 9.42" style="stroke-width:2.04357"/><path stroke="#0f0" d="M16.172 13.915v6m3-3h-6"/><path stroke="red" d="M19.135 11.43h-6"/></svg></a> {BASE_NAME}</h1>
<p>{repo['name_escaped']} • commit: {commit_details['short_hash']}</p>
</div>
@@ -798,4 +807,3 @@ def main():
if __name__ == "__main__":
main()
-