Skip to content

Add llms.txt generation script#173

Merged
yel-hadd merged 2 commits intocloudlinux:masterfrom
a2u:feature/llms-txt-generation
Mar 6, 2026
Merged

Add llms.txt generation script#173
yel-hadd merged 2 commits intocloudlinux:masterfrom
a2u:feature/llms-txt-generation

Conversation

@a2u
Copy link
Copy Markdown
Contributor

@a2u a2u commented Feb 4, 2026

Summary

  • Add scripts/generate-llms-txt.js to generate LLM-friendly documentation files
  • Generates llms.txt (index with links) and llms-full.txt (full content)
  • Integrates into docs:build pipeline automatically
  • Copies markdown files to dist with proper naming (README.md → index.md)

Made with Cursor

- Add scripts/generate-llms-txt.js to generate llms.txt and llms-full.txt
- Integrate script into docs:build pipeline
- Generates structured documentation index for LLM consumption

Co-authored-by: Cursor <cursoragent@cursor.com>
@annkots annkots requested a review from yel-hadd March 6, 2026 11:48
Align sidebar route keys and llms generation to documented VuePress routes only, sanitize HTML-decorated titles for plain-text compatibility, and remove the obsolete WHMCS draft page while pointing to the canonical docs URL.

Made-with: Cursor
@yel-hadd
Copy link
Copy Markdown
Collaborator

yel-hadd commented Mar 6, 2026

Thanks for the PR — the main implementation is correct and works well.
I reviewed/build-tested it locally and added a small follow-up focused on output consistency and structure safety.

What was changed and why

  1. Sidebar key normalization for Imunify Patch

    • Changed key in docs/.vuepress/config-client/sidebar.ts from:
      • '/imunify_patch' -> '/imunify_patch/'
    • Why: all other sidebar section keys use trailing slashes. Keeping this consistent avoids subtle route-key mismatches in generators/parsers and reduces future maintenance risk.
  2. Exclude non-README markdown pages from llms generation

    • Updated scripts/generate-llms-txt.js so llms.txt / llms-full.txt are generated strictly from documented structure (documents.ts + sidebar.ts) instead of auto-including extra standalone *.md files.
    • Why: pages like docs/whmcs_plugin/whmcs_saved.md were being surfaced even though they are not part of intended VuePress navigation structure.
  3. Dynamic title sanitization in generated llms output

    • In scripts/generate-llms-txt.js, title generation now converts inline HTML markup to plain text (natural-language-compatible structure).
    • This applies generally to HTML-decorated titles, and also preserves deprecation semantics by normalizing badge-style markup to [DEPRECATED].
    • Why: llms.txt should be clean/plain-text friendly for LLM/indexing consumers while preserving meaning.
  4. WHMCS docs cleanup

    • Deleted docs/whmcs_plugin/whmcs_saved.md (not part of visible site structure).
    • Updated link in docs/whmcs_plugin/README.md to:
      • https://docs.cloudlinux.com/cln/whmcs_plugin/
    • Note: https://docs.cln.cloudlinux.com/whmcs_plugin/ is a redirect; this change points directly to the canonical destination.
    • Why: aligns docs references and avoids relying on redirect-only entry URLs.

Validation summary

  • yarn docs:build passes.
  • llms.txt and llms-full.txt are generated successfully.
  • No whmcs_saved.md links remain in generated llms output.
  • HTML-decorated titles are normalized to plain-text-compatible output.
  • Generated URLs resolve locally.
  • imunify_patch route was specifically regression-checked and remains non-breaking.

@annkots please review these follow-up adjustments.
Core PR behavior is mostly correct — these are targeted cleanup changes for consistency, output hygiene, and edge-case safety.

@yel-hadd yel-hadd merged commit 296611a into cloudlinux:master Mar 6, 2026
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