mirror of
https://github.com/vinta/awesome-python.git
synced 2026-10-06 17:05:16 +08:00
feat(website): add /sponsorship/ landing page
Adds a dedicated sponsorship page at /sponsorship/ built from the Jinja2 template, with hero stats, tier cards, and CSS. Updates the index.html sponsor sidebar link to point to /sponsorship/ instead of the GitHub SPONSORSHIP.md. Adds the URL to the sitemap and test fixtures. Also renames .impeccable.md to DESIGN.md. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -37,7 +37,7 @@ Your sponsorship puts your product in front of developers at the exact moment th
|
||||
|
||||
## Get Started
|
||||
|
||||
Email [vinta.chen@gmail.com](mailto:vinta.chen@gmail.com?subject=awesome-python%20Sponsorship) with:
|
||||
Email [vinta.chen@gmail.com](mailto:vinta.chen@gmail.com?subject=Awesome%20Python%20Sponsorship) with:
|
||||
|
||||
- **Tier:** Headline Sponsor ($500/mo) or Featured Sponsor ($150/mo)
|
||||
- **Content:** Product name, URL, logo, and description (Headline tier) or `[Name](URL) - Description.` entry (Featured tier)
|
||||
|
||||
@@ -25,6 +25,9 @@ BUILTIN_SLUG = "built-in"
|
||||
BUILTIN_PATH = f"/categories/{BUILTIN_SLUG}/"
|
||||
BUILTIN_PUBLIC_URL = f"{SITE_URL}categories/{BUILTIN_SLUG}/"
|
||||
|
||||
SPONSORSHIP_PATH = "/sponsorship/"
|
||||
SPONSORSHIP_PUBLIC_URL = f"{SITE_URL}sponsorship/"
|
||||
|
||||
SOURCE_TYPE_DOMAINS = {
|
||||
"docs.python.org": "Built-in",
|
||||
"gitlab.com": "GitLab",
|
||||
@@ -434,6 +437,23 @@ def build(repo_root: Path) -> None:
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
sponsorship_dir = site_dir / "sponsorship"
|
||||
sponsorship_dir.mkdir(parents=True, exist_ok=True)
|
||||
tpl_sponsorship = env.get_template("sponsorship.html")
|
||||
hero_stats: list[str] = []
|
||||
if repo_stars:
|
||||
hero_stats.append(f"{repo_stars}+ stars on GitHub")
|
||||
hero_stats.append(f"{total_entries}+ curated projects")
|
||||
hero_stats.append(f"Updated {build_date.strftime('%B %d, %Y')}")
|
||||
(sponsorship_dir / "index.html").write_text(
|
||||
tpl_sponsorship.render(
|
||||
total_entries=total_entries,
|
||||
total_categories=len(categories),
|
||||
hero_stats=hero_stats,
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
seen_subcats: set[tuple[str, str]] = set()
|
||||
for category in categories:
|
||||
cat_url_prefix = f"/categories/{category['slug']}/"
|
||||
@@ -491,6 +511,7 @@ def build(repo_root: Path) -> None:
|
||||
sitemap_urls.append((BUILTIN_PUBLIC_URL, sitemap_date))
|
||||
for cat_slug, sub_slug in sorted(seen_subcats):
|
||||
sitemap_urls.append((subcategory_public_url(cat_slug, sub_slug), sitemap_date))
|
||||
sitemap_urls.append((SPONSORSHIP_PUBLIC_URL, sitemap_date))
|
||||
write_sitemap_xml(site_dir / "sitemap.xml", sitemap_urls)
|
||||
(site_dir / "index.md").write_text(markdown_index, encoding="utf-8")
|
||||
(site_dir / "llms.txt").write_text(llms_txt, encoding="utf-8")
|
||||
|
||||
+308
-1
File diff suppressed because it is too large
Load Diff
@@ -85,14 +85,7 @@
|
||||
<div class="section-shell sponsor-shell">
|
||||
<header class="sponsor-meta">
|
||||
<p class="section-label" id="sponsor-heading">Sponsors</p>
|
||||
<a
|
||||
class="sponsor-become"
|
||||
href="https://github.com/vinta/awesome-python/blob/master/SPONSORSHIP.md"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
>
|
||||
Become a sponsor
|
||||
</a>
|
||||
<a class="sponsor-become" href="/sponsorship/"> Become a sponsor </a>
|
||||
</header>
|
||||
<ul class="sponsor-list">
|
||||
{% for sponsor in sponsors %}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -129,6 +129,12 @@ class TestBuild:
|
||||
"{% endblock %}",
|
||||
encoding="utf-8",
|
||||
)
|
||||
(tpl_dir / "sponsorship.html").write_text(
|
||||
'{% extends "base.html" %}{% block content %}'
|
||||
"<h1>Sponsor</h1>"
|
||||
"{% endblock %}",
|
||||
encoding="utf-8",
|
||||
)
|
||||
(tpl_dir / "llms.txt").write_text(
|
||||
"# Awesome Python\n"
|
||||
"\n"
|
||||
@@ -234,6 +240,7 @@ class TestBuild:
|
||||
"https://awesome-python.com/categories/widgets/",
|
||||
"https://awesome-python.com/categories/tools/",
|
||||
"https://awesome-python.com/categories/widgets/sync/",
|
||||
"https://awesome-python.com/sponsorship/",
|
||||
]
|
||||
assert len(lastmods) == len(locs)
|
||||
assert all(start_date <= date.fromisoformat(lastmod) <= end_date for lastmod in lastmods)
|
||||
|
||||
Reference in New Issue
Block a user