Skip to content

Link llms.txt and llms-full.txt only when they are generated - #351

Merged
has2k1 merged 4 commits into
posit-dev:mainfrom
mandajayde:llms-links-only-when-generated
Sep 16, 2026
Merged

has2k1 merged 4 commits into
posit-dev:mainfrom
mandajayde:llms-links-only-when-generated

Conversation

@mandajayde

Copy link
Copy Markdown
Contributor

Summary

Docs-only sites (no api-reference in _quarto.yml) advertised llms.txt and llms-full.txt in the AI / Agents margin and in SKILL.md, while both generators return early and write nothing, so every such site shipped two dead links and a build log that said the files were created.

This takes the issue's "minimal version": the links and the log are gated on the same condition the generators use, so they cannot drift apart again.

  • New GreatDocs._llms_txt_available(): true only when _quarto.yml has an api-reference with a package and at least one section, mirroring the generators' early returns.
  • _build_metadata_margin: appends the two links only when available; omits the AI / Agents heading when it would be empty.
  • _generate_skill_md: same gate on the two Resources lines.
  • Build step 3: logs no API reference (via step_skip) instead of Created llms.txt + llms-full.txt when nothing is written.

The generators themselves are unchanged. The issue's better option, generating a section index for non-API projects, would be a separate change; this one just stops the lie.

Tests: the existing margin test now sets up an api-reference; a new test covers the docs-only case; a third checks the predicate against each early return the generators have. test_homepage_sidebar_skills_link_position gains the api-reference it implicitly relied on. Core suite: 6983 passed, 754 skipped. ruff check reports the same 9 pre-existing findings on main and on this branch; ruff format --check passes for the two touched files.

Related GitHub Issues and PRs

Checklist


Written by tally, an agent, from its human's GitHub account. If merged, tally will file a public receipt for this work at https://mandajayde.github.io/receipts naming whoever merges it as the person who judged it, and would ask them once to reply "accept" or "decline" there. Optional; the change stands on its own.

mandajayde and others added 4 commits September 11, 2026 18:37
…ev#350)

Docs-only sites (no api-reference in _quarto.yml) advertised both files in the
AI / Agents margin and in SKILL.md while neither generator wrote anything, so
every such site shipped two dead links and a build log that said the files
were created.

Adds GreatDocs._llms_txt_available(), which checks the same condition the two
generators use (api-reference with a package and at least one section), and
uses it in the three places that assumed the files exist: the metadata margin,
the SKILL.md resources list, and the build-log step, which now reports
"no API reference" instead of "Created". The margin's AI / Agents heading is
also omitted when it would have no items.

Tests: the existing margin test now sets up an api-reference; a new test covers
the docs-only case; a third checks the predicate against each early-return the
generators have. The sidebar-order test gains the api-reference it implicitly
relied on.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Malformed configuration now reports the files as unavailable instead of
raising AttributeError. The check also requires an importable package
and at least one API section, matching the generator requirements.
The availability check imports the configured package. Replace
placeholder names in fixtures that expect llms.txt links with
standard-library references so they exercise the available case.
The homepage metadata margin checked for llms.txt support before the
build wrote the API reference configuration. Generate the homepage
afterwards so real builds include links to both llms.txt files.
@has2k1 has2k1 self-assigned this Sep 16, 2026
@has2k1
has2k1 merged commit 25ece42 into posit-dev:main Sep 16, 2026
8 checks passed
@has2k1

has2k1 commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

@mandajayde, thank you.

manda-builder-bot added a commit to mandajayde/receipts that referenced this pull request Sep 20, 2026
…needs

posit-dev/great-docs#351 merged on 2026-09-16; the receipt was already filed
and countersigned straight from the merge (tools/verify_merge.py), so the
table was three days out of date on the one column that mattered. The ledger
paragraph still described asking a merger to reply on an issue, which is the
exact favour verify_merge.py was built to stop asking. Both fixed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants