add build date to llms.txt

This commit is contained in:
Vinta Chen
2026-08-16 20:16:05 +08:00
parent 30c9f18bc2
commit ee8089d0d5
3 changed files with 5 additions and 2 deletions
+3
View File
@@ -394,6 +394,7 @@ def build_llms_txt(
*,
readme_text: str,
subtitle: str,
build_date: str,
stars_data: dict[str, dict],
downloads_data: dict[str, int],
categories: Sequence[ParsedSection],
@@ -411,6 +412,7 @@ def build_llms_txt(
text_env = Environment(autoescape=False, trim_blocks=True, lstrip_blocks=True)
rendered = text_env.from_string(template_text).render(
subtitle=subtitle,
build_date=build_date,
site_url=SITE_URL,
github_repo_url="https://github.com/vinta/awesome-python",
contributing_url="https://github.com/vinta/awesome-python/blob/master/CONTRIBUTING.md",
@@ -763,6 +765,7 @@ def build(repo_root: Path) -> None:
llms_template,
readme_text=readme_text,
subtitle=subtitle,
build_date=build_date.strftime("%Y/%m/%d"),
stars_data=stars_data,
downloads_data=downloads_data,
categories=categories,
+1 -1
View File
@@ -2,7 +2,7 @@
{{ subtitle }}
{{ total_entries }} projects across {{ total_categories }} {% if total_categories == 1 %}category{% else %}categories{% endif %}.
{{ total_entries }} projects across {{ total_categories }} {% if total_categories == 1 %}category{% else %}categories{% endif %}, updated on {{ build_date }}.
Scan the category index, then jump to the matching section for direct project links and short descriptions. Entries end with `PyPI downloads/month: N` (last 30 days, mirrors and CI included) and `GitHub stars: N` notes in parentheses where known; treat both as popularity context, not a quality guarantee. Use the homepage for project context outside the shortlist.
+1 -1
View File
@@ -348,7 +348,7 @@ class TestBuild:
assert '<link rel="alternate" type="text/plain" href="/llms.txt" title="LLMs text entry point" />' in index_html
assert llms_txt.startswith("# Awesome Python\n\nIntro.\n")
assert "2 projects across 1 category." in llms_txt
assert "2 projects across 1 category, updated on " in llms_txt
assert "Scan the category index" in llms_txt
assert "Homepage: https://awesome-python.com/" in llms_txt
assert "Markdown homepage" not in llms_txt