mirror of
https://github.com/vinta/awesome-python.git
synced 2026-10-02 08:23:10 +08:00
add build date to llms.txt
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user