Visitar URL original
feat(docs): add social cards and llms.txt, fix zensical 0.0.72 privacy error by stasadev · Pull Request #9009 · ddev/ddev · GitHub
Skip to content

feat(docs): add social cards and llms.txt, fix zensical 0.0.72 privacy error - #9009

Merged
rfay merged 1 commit into
ddev:mainfrom
stasadev:20261024_stasadev_zensical_social_llmstxt
Oct 23, 2026
Merged

rfay merged 1 commit into
ddev:mainfrom
stasadev:20261024_stasadev_zensical_social_llmstxt

Conversation

@stasadev

@stasadev stasadev commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Short Summary (TL;DR)

zensical 0.0.72 broke the docs build on every PR. This PR fixes the privacy plugin config, and adds social cards, llms.txt, and a "Copy as Markdown" button.

The Issue

  • zensical build fails with Error: privacy enabled must be a boolean, because !ENV [ READTHEDOCS, '' ] gives an empty string when READTHEDOCS is unset. Earlier zensical versions ignored the privacy plugin, so docs.ddev.com has loaded Google Fonts from Google since the migration to zensical.
  • zensical 0.0.67 added native social and llmstxt plugins. Before, a shared docs link showed no preview image, and AI agents had to scrape HTML.

How This PR Solves The Issue

Privacy:

  • Use false as the fallback. Read the Docs sets READTHEDOCS=True, which zensical parses as a boolean.
  • Fetch only Google Fonts. The theme JS also references unused libraries on unpkg, and those pull in video and Google ad SDKs. That was 6.4 MB from 9 hosts, and one timeout failed a local --strict build. With the allow-list, the build fetches 31 font files (896 KB).
  • Require zensical 0.0.72, because older versions skip privacy without a warning.

Social cards and llms.txt:

  • social makes a 1200x630 card for each page and adds Open Graph and Twitter tags. The card crops its logo to a square, and logo.svg is wider than tall. So docs/social-logo.svg is a copy of the logo with a square viewBox.
  • llmstxt writes llms.txt, llms-full.txt, and an index.md next to each page. It also adds <link rel="describedby"> and <link rel="alternate" type="text/markdown"> to each page.
  • The content.action.copy feature shows the button. It needs llmstxt, which only exports pages that its sections match. So the sections use one wildcard per docs directory, and a new page in an existing directory is covered without config changes.
  • A new FAQ entry tells users about these files, because most assistants don't look for llms.txt on their own. Its links are relative, so each docs version links to its own files. .linkspector.yml ignores them, because they don't exist in docs/content.

The cards add about 4 seconds to an uncached build. The first build downloads the card font from Google Fonts into .cache/plugin/social.

zensical writes & from the page text as &amp; in the Markdown copies, and as &amp;amp; in llms.txt titles. This bug is upstream, and it affects 10 pages. It also turns & in our llms.txt section headings into &amp;. So the sections say "and" instead, for example "Debugging and Profiling" for the nav's "Debugging & Profiling".

Manual Testing Instructions

scripts/install-dev-tools.sh
make zensical
# Expect "No issues found"
READTHEDOCS=True zensical build --clean --strict
ls site/assets/external
# Expect only fonts.googleapis.com and fonts.gstatic.com
ls site/llms.txt site/llms-full.txt site/users/quickstart/index.md
grep 'og:image' site/users/quickstart/index.html

In the Read the Docs preview, open https://ddev--9009.org.readthedocs.build/en/9009/users/quickstart/ and click "Copy as Markdown" next to the edit button. Then open https://ddev--9009.org.readthedocs.build/en/9009/assets/images/social/users/quickstart.png. In https://ddev--9009.org.readthedocs.build/en/9009/users/usage/faq/#can-ai-assistants-read-the-ddev-docs, the llms.txt and llms-full.txt links must open the files for that version.

Automated Testing Overview

The docs-check workflow builds with --strict and no READTHEDOCS, which covers the boolean fix. A section path without a wildcard that names no page also fails that build.

🤖 Developed with assistance from Claude Code

@stasadev
stasadev requested a review from a team as a code owner October 23, 2026 21:48
…y error [skip buildkite]

## Short Summary (TL;DR)

zensical 0.0.72 broke the docs build on every PR. This PR fixes the privacy plugin config, and adds social cards, `llms.txt`, and a "Copy as Markdown" button.

## The Issue

- `zensical build` fails with `Error: privacy enabled must be a boolean`, because `!ENV [ READTHEDOCS, '' ]` gives an empty string when `READTHEDOCS` is unset. Earlier zensical versions ignored the `privacy` plugin, so docs.ddev.com has loaded Google Fonts from Google since the migration to zensical.
- zensical 0.0.67 added native `social` and `llmstxt` plugins. Before, a shared docs link showed no preview image, and AI agents had to scrape HTML.

## How This PR Solves The Issue

Privacy:

- Use `false` as the fallback. Read the Docs sets `READTHEDOCS=True`, which zensical parses as a boolean.
- Fetch only Google Fonts. The theme JS also references unused libraries on unpkg, and those pull in video and Google ad SDKs. That was 6.4 MB from 9 hosts, and one timeout failed a local `--strict` build. With the allow-list, the build fetches 31 font files (896 KB).
- Require zensical 0.0.72, because older versions skip `privacy` without a warning.

Social cards and `llms.txt`:

- `social` makes a 1200x630 card for each page and adds Open Graph and Twitter tags. The card crops its logo to a square, and `logo.svg` is wider than tall. So `docs/social-logo.svg` is a copy of the logo with a square viewBox.
- `llmstxt` writes [`llms.txt`](https://llmstxt.org/), `llms-full.txt`, and an `index.md` next to each page. It also adds `<link rel="describedby">` and `<link rel="alternate" type="text/markdown">` to each page.
- The `content.action.copy` feature shows the button. It needs `llmstxt`, which only exports pages that its `sections` match. So the sections use one wildcard per docs directory, and a new page in an existing directory is covered without config changes.
- A new FAQ entry tells users about these files, because most assistants don't look for `llms.txt` on their own. Its links are relative, so each docs version links to its own files. `.linkspector.yml` ignores them, because they don't exist in `docs/content`.

The cards add about 4 seconds to an uncached build. The first build downloads the card font from Google Fonts into `.cache/plugin/social`.

zensical writes `&` from the page text as `&amp;` in the Markdown copies, and as `&amp;amp;` in `llms.txt` titles. This bug is upstream, and it affects 10 pages.

## Manual Testing Instructions

```bash
scripts/install-dev-tools.sh
make zensical
# Expect "No issues found"
READTHEDOCS=True zensical build --clean --strict
ls site/assets/external
# Expect only fonts.googleapis.com and fonts.gstatic.com
ls site/llms.txt site/llms-full.txt site/users/quickstart/index.md
grep 'og:image' site/users/quickstart/index.html
```

In the Read the Docs preview, open https://ddev--9009.org.readthedocs.build/en/9009/users/quickstart/ and click "Copy as Markdown" next to the edit button. Then open https://ddev--9009.org.readthedocs.build/en/9009/assets/images/social/users/quickstart.png. In https://ddev--9009.org.readthedocs.build/en/9009/users/usage/faq/#can-ai-assistants-read-the-ddev-docs, the `llms.txt` and `llms-full.txt` links must open the files for that version.

## Automated Testing Overview

The docs-check workflow builds with `--strict` and no `READTHEDOCS`, which covers the boolean fix. A section path without a wildcard that names no page also fails that build.

🤖 Developed with assistance from [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@stasadev
stasadev force-pushed the 20261024_stasadev_zensical_social_llmstxt branch from df994a7 to 2226ded Compare October 23, 2026 21:54

@rfay rfay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wondered what that was, thanks!

@rfay
rfay merged commit c017916 into ddev:main Oct 23, 2026
11 checks passed
@rfay
rfay deleted the 20261024_stasadev_zensical_social_llmstxt branch October 23, 2026 22:43
stasadev added a commit that referenced this pull request Oct 25, 2026
…y error (#9009)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants