Skip to content

Commit 8f4b94e

Browse files
committed
feat: add maintainer information and enhance site generation by implementing dynamic context for templates, while removing outdated static HTML files
1 parent 87cdc3d commit 8f4b94e

File tree

5 files changed

+90
-23
lines changed

5 files changed

+90
-23
lines changed

dump.rdb

88 Bytes
Binary file not shown.

scripts/build_docs_site.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
SITE_URL = "https://sirstig.github.io/yokedcache"
2626
GITHUB_REPO = "https://github.com/sirstig/yokedcache"
2727

28+
MAINTAINER_SAME_AS: list[str] = [
29+
"https://github.com/SirStig",
30+
"https://solutions.ironcoffee.com",
31+
"https://www.linkedin.com/in/joshua-kac-aa50b7131",
32+
]
33+
2834
NAV: list[tuple[str, list[tuple[str, str]]]] = [
2935
(
3036
"Start",
@@ -172,7 +178,13 @@ def main() -> int:
172178
OUT.mkdir(parents=True)
173179

174180
if STATIC_DIR.is_dir():
175-
shutil.copytree(STATIC_DIR, OUT, dirs_exist_ok=True)
181+
182+
def _skip_root_html(src: str, names: list[str]) -> set[str]:
183+
if Path(src).resolve() == STATIC_DIR.resolve():
184+
return {n for n in names if n in ("index.html", "changelog.html")}
185+
return set()
186+
187+
shutil.copytree(STATIC_DIR, OUT, dirs_exist_ok=True, ignore=_skip_root_html)
176188
shutil.copytree(ASSETS_DIR, OUT / "assets")
177189

178190
(OUT / ".nojekyll").write_text("", encoding="utf-8")
@@ -243,9 +255,27 @@ def main() -> int:
243255
favicon_href=site_href("favicon.png"),
244256
favicon_svg_href=site_href("favicon.svg"),
245257
og_image_url=f"{SITE_URL}/og-image.png",
258+
site_url=SITE_URL,
259+
github_repo=GITHUB_REPO,
260+
maintainer_same_as=MAINTAINER_SAME_AS,
246261
)
247262
out_path.write_text(html, encoding="utf-8")
248263

264+
home_canonical = f"{SITE_URL}/"
265+
standalone_ctx = {
266+
"site_url": SITE_URL,
267+
"github_repo": GITHUB_REPO,
268+
"og_image_url": f"{SITE_URL}/og-image.png",
269+
"version": version,
270+
"maintainer_same_as": MAINTAINER_SAME_AS,
271+
"home_canonical": home_canonical,
272+
"changelog_canonical": f"{SITE_URL}/changelog.html",
273+
}
274+
for standalone in ("index.html.jinja2", "changelog.html.jinja2"):
275+
stpl = env.get_template(standalone)
276+
out_name = standalone.replace(".jinja2", "")
277+
(OUT / out_name).write_text(stpl.render(**standalone_ctx), encoding="utf-8")
278+
249279
print(f"Built site -> {OUT} ({version})")
250280
return 0
251281

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,54 @@
66
<title>Changelog — YokedCache</title>
77
<meta name="description" content="Release history for YokedCache: features, fixes, and migrations.">
88
<meta name="keywords" content="yokedcache, changelog, releases, python, fastapi, redis">
9+
<meta name="author" content="Joshua Kac">
910
<meta name="robots" content="index,follow">
10-
<link rel="canonical" href="https://sirstig.github.io/yokedcache/changelog.html">
11+
<link rel="canonical" href="{{ changelog_canonical }}">
1112
<link rel="icon" type="image/svg+xml" href="favicon.svg">
1213
<link rel="icon" type="image/png" sizes="32x32" href="favicon.png">
1314
<link rel="apple-touch-icon" href="favicon.png">
1415
<meta property="og:type" content="website">
15-
<meta property="og:url" content="https://sirstig.github.io/yokedcache/changelog.html">
16+
<meta property="og:locale" content="en_US">
17+
<meta property="og:url" content="{{ changelog_canonical }}">
1618
<meta property="og:title" content="Changelog — YokedCache">
1719
<meta property="og:description" content="Release history for YokedCache: features, fixes, and migrations.">
18-
<meta property="og:image" content="https://sirstig.github.io/yokedcache/og-image.png">
20+
<meta property="og:image" content="{{ og_image_url }}">
1921
<meta property="og:image:width" content="1200">
2022
<meta property="og:image:height" content="630">
2123
<meta property="og:site_name" content="YokedCache">
2224
<meta name="twitter:card" content="summary_large_image">
2325
<meta name="twitter:title" content="Changelog — YokedCache">
2426
<meta name="twitter:description" content="Release history for YokedCache: features, fixes, and migrations.">
25-
<meta name="twitter:image" content="https://sirstig.github.io/yokedcache/og-image.png">
27+
<meta name="twitter:image" content="{{ og_image_url }}">
2628
<link rel="preconnect" href="https://fonts.googleapis.com">
2729
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
2830
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
2931
<link rel="stylesheet" href="assets/style.css">
32+
<script type="application/ld+json">
33+
{
34+
"@context": "https://schema.org",
35+
"@type": "WebPage",
36+
"name": "Changelog — YokedCache",
37+
"description": "Release history for YokedCache: features, fixes, and migrations.",
38+
"url": "{{ changelog_canonical }}",
39+
"isPartOf": {
40+
"@type": "WebSite",
41+
"name": "YokedCache",
42+
"url": "{{ home_canonical }}"
43+
},
44+
"about": {
45+
"@type": "SoftwareApplication",
46+
"name": "YokedCache",
47+
"url": "{{ site_url }}",
48+
"codeRepository": "{{ github_repo }}"
49+
},
50+
"author": {
51+
"@type": "Person",
52+
"name": "Joshua Kac",
53+
"sameAs": {{ maintainer_same_as | tojson }}
54+
}
55+
}
56+
</script>
3057
</head>
3158
<body>
3259

@@ -38,7 +65,7 @@
3865
<a href="api/index.html">API</a>
3966
<a href="changelog.html" class="active">Changelog</a>
4067
<a class="header-badge" href="https://pypi.org/project/yokedcache/" target="_blank" rel="noopener">PyPI ↗</a>
41-
<a class="header-badge" href="https://github.com/sirstig/yokedcache" target="_blank" rel="noopener" style="margin-left:0.2rem">GitHub ↗</a>
68+
<a class="header-badge" href="{{ github_repo }}" target="_blank" rel="noopener" style="margin-left:0.2rem">GitHub ↗</a>
4269
<button class="theme-btn" type="button" aria-label="Toggle theme">☀ Light</button>
4370
</nav>
4471
<button class="menu-btn" type="button" id="menuBtn" aria-label="Open menu">
@@ -53,7 +80,7 @@
5380
<div style="position:relative;z-index:1;padding-top:var(--header-h)">
5481
<div class="changelog-wrap">
5582
<h1 class="page-title">Changelog</h1>
56-
<p class="page-sub">Release history for <code>yokedcache</code> · <a href="https://github.com/sirstig/yokedcache/blob/main/CHANGELOG.md" target="_blank" rel="noopener">View on GitHub ↗</a></p>
83+
<p class="page-sub">Release history for <code>yokedcache</code> · <a href="{{ github_repo }}/blob/main/CHANGELOG.md" target="_blank" rel="noopener">View on GitHub ↗</a></p>
5784

5885
<p id="changelog-status" style="color:var(--muted);font-size:0.9rem">Loading…</p>
5986
<article id="changelog-body" aria-live="polite"></article>
@@ -62,7 +89,7 @@ <h1 class="page-title">Changelog</h1>
6289
<a href="./">Home</a>
6390
<a href="getting-started.html">Docs</a>
6491
<a href="api/index.html">API</a>
65-
<a href="https://github.com/sirstig/yokedcache" target="_blank" rel="noopener">GitHub</a>
92+
<a href="{{ github_repo }}" target="_blank" rel="noopener">GitHub</a>
6693
</footer>
6794
</div>
6895
</div>

site-src/templates/doc_page.html.jinja2

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
<title>{{ title }} — YokedCache</title>
77
<meta name="description" content="{{ description }}">
88
{% if keywords %}<meta name="keywords" content="{{ keywords }}">{% endif %}
9+
<meta name="author" content="Joshua Kac">
910
<meta name="robots" content="index,follow">
1011
<link rel="canonical" href="{{ canonical }}">
1112
<link rel="icon" type="image/svg+xml" href="{{ favicon_svg_href }}">
1213
<link rel="icon" type="image/png" sizes="32x32" href="{{ favicon_href }}">
1314
<link rel="apple-touch-icon" href="{{ favicon_href }}">
1415
<meta property="og:type" content="website">
16+
<meta property="og:locale" content="en_US">
1517
<meta property="og:url" content="{{ canonical }}">
1618
<meta property="og:title" content="{{ title }} — YokedCache">
1719
<meta property="og:description" content="{{ description }}">
@@ -37,6 +39,10 @@
3739
"programmingLanguage": "Python",
3840
"softwareVersion": "{{ version }}",
3941
"offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" },
42+
"url": "{{ site_url }}",
43+
"downloadUrl": "https://pypi.org/project/yokedcache/",
44+
"codeRepository": "{{ github_repo }}",
45+
"license": "https://opensource.org/licenses/MIT",
4046
"author": {
4147
"@type": "Organization",
4248
"name": "Project Yoked LLC",
@@ -46,7 +52,8 @@
4652
"@type": "Person",
4753
"name": "Joshua Kac",
4854
"jobTitle": "CTO",
49-
"worksFor": { "@type": "Organization", "name": "Project Yoked LLC" }
55+
"worksFor": { "@type": "Organization", "name": "Project Yoked LLC" },
56+
"sameAs": {{ maintainer_same_as | tojson }}
5057
}
5158
}
5259
</script>
@@ -61,7 +68,7 @@
6168
<a href="{{ api_href }}">API</a>
6269
<a href="{{ changelog_href }}">Changelog</a>
6370
<a class="header-badge" href="https://pypi.org/project/yokedcache/" target="_blank" rel="noopener">PyPI ↗</a>
64-
<a class="header-badge" href="https://github.com/sirstig/yokedcache" target="_blank" rel="noopener" style="margin-left:0.2rem">GitHub ↗</a>
71+
<a class="header-badge" href="{{ github_repo }}" target="_blank" rel="noopener" style="margin-left:0.2rem">GitHub ↗</a>
6572
<button class="theme-btn" type="button" aria-label="Toggle theme">☀ Light</button>
6673
</nav>
6774
<button class="menu-btn" type="button" id="menuBtn" aria-label="Open menu">
@@ -94,7 +101,7 @@
94101
<a href="{{ home_href }}">Home</a>
95102
<a href="{{ changelog_href }}">Changelog</a>
96103
<a href="{{ api_href }}">API</a>
97-
<a href="https://github.com/sirstig/yokedcache" target="_blank" rel="noopener">GitHub</a>
104+
<a href="{{ github_repo }}" target="_blank" rel="noopener">GitHub</a>
98105
<a href="https://pypi.org/project/yokedcache/" target="_blank" rel="noopener">PyPI</a>
99106
</footer>
100107
</div>
Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,26 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<title>YokedCache — Python caching for FastAPI with Redis</title>
77
<meta name="description" content="Async Python caching library with Redis auto-invalidation, vector search cache helpers, FastAPI integration, and production monitoring. MIT licensed.">
8-
<meta name="keywords" content="python, fastapi, redis, caching, cache invalidation, yokedcache">
8+
<meta name="keywords" content="python, fastapi, redis, sqlalchemy, caching, cache invalidation, memcached, prometheus, yokedcache, Joshua Kac, Project Yoked">
9+
<meta name="author" content="Joshua Kac">
910
<meta name="robots" content="index,follow">
10-
<link rel="canonical" href="https://sirstig.github.io/yokedcache/">
11+
<link rel="canonical" href="{{ home_canonical }}">
1112
<link rel="icon" type="image/svg+xml" href="favicon.svg">
1213
<link rel="icon" type="image/png" sizes="32x32" href="favicon.png">
1314
<link rel="apple-touch-icon" href="favicon.png">
1415
<meta property="og:type" content="website">
15-
<meta property="og:url" content="https://sirstig.github.io/yokedcache/">
16+
<meta property="og:locale" content="en_US">
17+
<meta property="og:url" content="{{ home_canonical }}">
1618
<meta property="og:title" content="YokedCache — Python caching for FastAPI with Redis">
1719
<meta property="og:description" content="Async Python caching library with Redis auto-invalidation, vector search cache helpers, FastAPI integration, and production monitoring. MIT licensed.">
18-
<meta property="og:image" content="https://sirstig.github.io/yokedcache/og-image.png">
20+
<meta property="og:image" content="{{ og_image_url }}">
1921
<meta property="og:image:width" content="1200">
2022
<meta property="og:image:height" content="630">
2123
<meta property="og:site_name" content="YokedCache">
2224
<meta name="twitter:card" content="summary_large_image">
2325
<meta name="twitter:title" content="YokedCache — Python caching for FastAPI with Redis">
2426
<meta name="twitter:description" content="Async Python caching library with Redis auto-invalidation, vector search cache helpers, FastAPI integration, and production monitoring. MIT licensed.">
25-
<meta name="twitter:image" content="https://sirstig.github.io/yokedcache/og-image.png">
27+
<meta name="twitter:image" content="{{ og_image_url }}">
2628
<link rel="preconnect" href="https://fonts.googleapis.com">
2729
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
2830
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
@@ -35,11 +37,11 @@
3537
"applicationCategory": "DeveloperApplication",
3638
"operatingSystem": "Linux, macOS, Windows",
3739
"programmingLanguage": "Python",
38-
"softwareVersion": "1.0.0",
40+
"softwareVersion": "{{ version }}",
3941
"offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" },
40-
"url": "https://sirstig.github.io/yokedcache",
42+
"url": "{{ site_url }}",
4143
"downloadUrl": "https://pypi.org/project/yokedcache/",
42-
"codeRepository": "https://github.com/sirstig/yokedcache",
44+
"codeRepository": "{{ github_repo }}",
4345
"license": "https://opensource.org/licenses/MIT",
4446
"author": {
4547
"@type": "Organization",
@@ -50,7 +52,8 @@
5052
"@type": "Person",
5153
"name": "Joshua Kac",
5254
"jobTitle": "CTO",
53-
"worksFor": { "@type": "Organization", "name": "Project Yoked LLC" }
55+
"worksFor": { "@type": "Organization", "name": "Project Yoked LLC" },
56+
"sameAs": {{ maintainer_same_as | tojson }}
5457
}
5558
}
5659
</script>
@@ -65,7 +68,7 @@
6568
<a href="api/index.html">API</a>
6669
<a href="changelog.html">Changelog</a>
6770
<a class="header-badge" href="https://pypi.org/project/yokedcache/" target="_blank" rel="noopener">PyPI ↗</a>
68-
<a class="header-badge" href="https://github.com/sirstig/yokedcache" target="_blank" rel="noopener" style="margin-left:0.2rem">GitHub ↗</a>
71+
<a class="header-badge" href="{{ github_repo }}" target="_blank" rel="noopener" style="margin-left:0.2rem">GitHub ↗</a>
6972
<button class="theme-btn" type="button" aria-label="Toggle theme">☀ Light</button>
7073
</nav>
7174
<button class="menu-btn" type="button" id="menuBtn" aria-label="Open menu">
@@ -92,7 +95,7 @@ <h1>Python caching built<br>for FastAPI</h1>
9295
<div class="hero-ctas">
9396
<a class="btn btn-primary" href="getting-started.html">Documentation</a>
9497
<a class="btn btn-ghost" href="api/index.html">API reference</a>
95-
<a class="btn btn-ghost" href="https://github.com/sirstig/yokedcache" target="_blank" rel="noopener">GitHub ↗</a>
98+
<a class="btn btn-ghost" href="{{ github_repo }}" target="_blank" rel="noopener">GitHub ↗</a>
9699
</div>
97100
</section>
98101

@@ -181,7 +184,7 @@ <h2>Documentation</h2>
181184
<footer class="site-footer">
182185
<span>MIT License · <a href="https://www.projectyoked.com" target="_blank" rel="noopener">Project Yoked LLC</a></span>
183186
<span>
184-
<a href="https://github.com/sirstig/yokedcache" target="_blank" rel="noopener">GitHub</a> ·
187+
<a href="{{ github_repo }}" target="_blank" rel="noopener">GitHub</a> ·
185188
<a href="https://pypi.org/project/yokedcache/" target="_blank" rel="noopener">PyPI</a> ·
186189
<a href="changelog.html">Changelog</a> ·
187190
<a href="llms.txt">llms.txt</a>

0 commit comments

Comments
 (0)