{"_id":"@alexcarol/astro-llms-txt","_rev":"2-c991f2ef131f55afc2559a1748773532","name":"@alexcarol/astro-llms-txt","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@alexcarol/astro-llms-txt","version":"0.1.0","keywords":["astro-integration","withastro","llms-txt","llms","ai","seo"],"author":{"name":"Alex Carol"},"license":"MIT","_id":"@alexcarol/astro-llms-txt@0.1.0","maintainers":[{"name":"alexcarol","email":"picard150@gmail.com"}],"homepage":"https://github.com/alexcarol/astro-kit#readme","bugs":{"url":"https://github.com/alexcarol/astro-kit/issues"},"dist":{"shasum":"3e1c900a1937c0f05cf28ef7e1817e2efdab2f9d","tarball":"https://registry.npmjs.org/@alexcarol/astro-llms-txt/-/astro-llms-txt-0.1.0.tgz","fileCount":3,"integrity":"sha512-RV4UK0Af8nn3z8F9rPcB1vE5XzpeTXJylexvfvpsFy3CvhT60W0pDAQq5g+WHmvdKpLjfobE1RZGHUifLSqpuQ==","signatures":[{"sig":"MEUCIQD8Gknz2y8Ep9kekqyr0zTKJq7VD+DtcPAWFig96BgJNAIgRFyUd17Cdn7MUTPQxfiFPtakpPEqdd16A1FUcOHwLWw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11113},"type":"module","engines":{"node":">=22"},"exports":{".":"./src/index.mjs"},"gitHead":"c36d0858ff7a5fe93c0fb2e4ad8e47072e59efe2","scripts":{"test":"vitest run"},"_npmUser":{"name":"alexcarol","email":"picard150@gmail.com"},"repository":{"url":"git+https://github.com/alexcarol/astro-kit.git","type":"git","directory":"packages/astro-llms-txt"},"_npmVersion":"11.11.1","description":"Astro integration that generates llms.txt and llms-full.txt at build time","directories":{},"_nodeVersion":"25.8.2","dependencies":{"turndown":"^7.2.2","node-html-parser":"^7.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"4.1.2"},"_npmOperationalInternal":{"tmp":"tmp/astro-llms-txt_0.1.0_1774715489395_0.2253535683115393","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@alexcarol/astro-llms-txt","version":"0.1.1","description":"Astro integration that generates llms.txt and llms-full.txt at build time","type":"module","license":"MIT","author":{"name":"Alex Carol"},"repository":{"type":"git","url":"git+https://github.com/alexcarol/astro-kit.git","directory":"packages/astro-llms-txt"},"keywords":["astro-integration","withastro","llms-txt","llms","ai","seo"],"exports":{".":"./src/index.mjs"},"engines":{"node":">=22"},"dependencies":{"node-html-parser":"^7.0.0","turndown":"^7.2.2"},"devDependencies":{"vitest":"4.1.2"},"scripts":{"test":"vitest run"},"gitHead":"ed198594e9937f6bc09f5a63186e8d3bc9e747ed","_id":"@alexcarol/astro-llms-txt@0.1.1","bugs":{"url":"https://github.com/alexcarol/astro-kit/issues"},"homepage":"https://github.com/alexcarol/astro-kit#readme","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-9gBFKh7XW/oVjNiCZ9HRkih80U8k1u5mQMK+i2k+lDAwaWy7hqIY+QKp+RQYOYVekHYGOlFSX+rNuaizARa+fg==","shasum":"7b6bd9bd522af104a405a77602a96310fecc347d","tarball":"https://registry.npmjs.org/@alexcarol/astro-llms-txt/-/astro-llms-txt-0.1.1.tgz","fileCount":3,"unpackedSize":11475,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alexcarol%2fastro-llms-txt@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAT7fz/vW6huYpB4hUYoBtw3VJKUIENn+EnHXzfebL9dAiBdTPqsrJJu7qP/EuzlEsMOrhacxnziDGBwj6AM+95n6Q=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:02e95924-b00d-4781-9c62-f217ae5dc6a4"}},"directories":{},"maintainers":[{"name":"alexcarol","email":"picard150@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/astro-llms-txt_0.1.1_1774990281428_0.36790708167470365"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-28T16:31:29.281Z","modified":"2026-03-31T20:51:22.381Z","0.1.0":"2026-03-28T16:31:29.546Z","0.1.1":"2026-03-31T20:51:21.580Z"},"bugs":{"url":"https://github.com/alexcarol/astro-kit/issues"},"author":{"name":"Alex Carol"},"license":"MIT","homepage":"https://github.com/alexcarol/astro-kit#readme","keywords":["astro-integration","withastro","llms-txt","llms","ai","seo"],"repository":{"type":"git","url":"git+https://github.com/alexcarol/astro-kit.git","directory":"packages/astro-llms-txt"},"description":"Astro integration that generates llms.txt and llms-full.txt at build time","maintainers":[{"name":"alexcarol","email":"picard150@gmail.com"}],"readme":"# astro-llms-txt\n\nAstro integration that generates [`llms.txt`](https://llmstxt.org/) and `llms-full.txt` at build\ntime by reading your rendered HTML output.\n\n- **`llms.txt`** - a lightweight index of all pages with links and descriptions\n- **`llms-full.txt`** - the full text content of every page\n\n## Install\n\n```bash\nnpx astro add @alexcarol/astro-llms-txt\n```\n\n> **Note:** `astro add` will auto-generate the import name `alexcarolllmsTxt` from the scoped\n> package name. You may want to rename it to `llmsTxt` for readability.\n\nOr install manually:\n\n```bash\nnpm install @alexcarol/astro-llms-txt\n```\n\n## Quick start\n\nIf you used `astro add`, your config is already set up. Otherwise, add the integration manually:\n\n```js\n// astro.config.mjs\nimport { defineConfig } from 'astro/config';\nimport llmsTxt from '@alexcarol/astro-llms-txt';\n\nexport default defineConfig({\n  site: 'https://example.com', // required\n  integrations: [llmsTxt()],\n});\n```\n\nThat's it. With no options the integration will:\n\n1. Use the homepage `<h1>` as the `# heading` (falls back to hostname)\n2. Use `<h1>` text as page titles (falls back to `<title>` if no `<h1>` is present)\n3. Exclude `/404` pages\n4. Extract content from `<main>`, descriptions from `<meta name=\"description\">`\n\n## Options\n\nAll options are optional.\n\n| Option | Type | Default | Description |\n|---|---|---|---|\n| `name` | `string` | homepage `<h1>`, then hostname | Site or brand name used as the `# heading` in generated files. |\n| `titleSource` | `'h1'` \\| `'title'` | `'h1'` | Which HTML element to read page titles from. `'h1'` uses the first `<h1>` (falls back to `<title>`). `'title'` uses the raw `<title>` tag text. |\n| `excludedPaths` | `string[]` | `['404']` | Path segments to exclude. Matched without leading/trailing slashes (e.g. `'admin'` excludes `/admin/`). |\n\n## Examples\n\n```js\n// Zero-config\nllmsTxt()\n\n// Explicit name (recommended for personal/brand sites)\nllmsTxt({ name: 'Alex Carol' })\n\n// Use raw <title> tags instead of <h1>\nllmsTxt({ name: 'My Site', titleSource: 'title' })\n\n// Custom exclusions\nllmsTxt({ name: 'My Site', excludedPaths: ['404', 'admin', 'drafts'] })\n```\n\n## Title source\n\nThe `titleSource` option controls where page titles come from:\n\n- **`'h1'` (default)** - reads the first `<h1>` on the page. This avoids the common\n  \"Page Title - Site Name\" suffix pattern in `<title>` tags, producing cleaner output.\n  Falls back to `<title>` if no `<h1>` is found.\n- **`'title'`** - reads the raw `<title>` tag, including any site name suffix.\n\nMost static sites use an `<h1>` that matches the clean page name, so the default works\nwithout configuration.\n\n## How it works\n\nThe integration hooks into two Astro lifecycle events:\n\n1. **`astro:config:done`** - validates that `site` is set in your Astro config (throws if\n   missing).\n\n2. **`astro:build:done`** - reads each built `index.html` in parallel, extracts page data,\n   infers the site name from the homepage `<h1>` if not provided, then writes both output\n   files.\n\nPages are sorted with the homepage first, then alphabetically by path.\n\n## Output format\n\nFollows the [llms.txt specification](https://llmstxt.org/):\n\n**`llms.txt`**\n```\n# Site Name\n\n> Homepage description from meta tag\n\n## Pages\n\n- [Home](https://example.com/): Homepage description\n- [About](https://example.com/about/): About page description\n```\n\n**`llms-full.txt`**\n```\n# Site Name\n\n> Homepage description from meta tag\n\n## [Home](https://example.com/)\n\nFull text content of the homepage...\n\n## [About](https://example.com/about/)\n\nFull text content of the about page...\n```\n\n## Requirements\n\n- `site` must be set in your Astro config (the integration throws a clear error if missing)\n- Pages should use `<main>` for primary content\n- Pages should have `<meta name=\"description\">` for summaries\n- For the default `titleSource: 'h1'`, pages should have an `<h1>` element\n\n## License\n\nMIT\n","readmeFilename":"README.md"}