# @astrojs/discovery Documentation [![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build) Comprehensive documentation for the @astrojs/discovery integration - a complete solution for generating discovery files (robots.txt, llms.txt, humans.txt, security.txt, canary.txt, webfinger, and sitemap) in your Astro projects. ## Documentation Structure This documentation follows the **DiΓ‘taxis framework**, organizing content into four distinct categories: ### πŸ“š Tutorials (Learning-oriented) Step-by-step lessons to get started: - Basic Setup - Configure robots.txt - Setup llms.txt - Create humans.txt - Security & Canary Files - WebFinger Discovery ### πŸ› οΈ How-to Guides (Task-oriented) Practical guides for specific tasks: - Block Specific Bots - Customize LLM Instructions - Add Team Members - Filter Sitemap Pages - Set Cache Headers - Environment-specific Config - Use with Content Collections - Custom Templates - ActivityPub Integration ### πŸ“– Reference (Information-oriented) Technical specifications and API documentation: - Configuration Options - API Reference - File-specific Options (robots, llms, humans, security, canary, webfinger, sitemap) - Cache Options - TypeScript Types ### πŸ’‘ Explanation (Understanding-oriented) Background and conceptual information: - Why Use Discovery Files? - Understanding each file type - SEO & Discoverability - AI Assistant Integration - Architecture & Design ## Project Structure ``` docs/ β”œβ”€β”€ public/ # Static assets β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ assets/ # Images and logos β”‚ β”‚ β”œβ”€β”€ logo.svg β”‚ β”‚ └── houston.webp β”‚ β”œβ”€β”€ content/ β”‚ β”‚ └── docs/ # Documentation content (Markdown/MDX) β”‚ β”‚ β”œβ”€β”€ getting-started/ β”‚ β”‚ β”œβ”€β”€ tutorials/ β”‚ β”‚ β”œβ”€β”€ how-to/ β”‚ β”‚ β”œβ”€β”€ reference/ β”‚ β”‚ β”œβ”€β”€ explanation/ β”‚ β”‚ β”œβ”€β”€ examples/ β”‚ β”‚ β”œβ”€β”€ community/ β”‚ β”‚ └── index.mdx β”‚ └── styles/ β”‚ └── custom.css # Custom styling β”œβ”€β”€ astro.config.mjs # Astro + Starlight config β”œβ”€β”€ package.json └── tsconfig.json ``` ## Commands All commands are run from the docs directory: | Command | Action | | :------------------- | :-------------------------------------------- | | `npm install` | Install dependencies | | `npm run dev` | Start dev server at `localhost:4321` | | `npm run build` | Build production site to `./dist/` | | `npm run preview` | Preview build locally | | `npm run check` | Run Astro type checking | ## Development 1. **Install dependencies:** ```bash npm install ``` 2. **Start development server:** ```bash npm run dev ``` 3. **Visit http://localhost:4321** to see your changes live ## Adding Documentation ### Create a new page Add a new `.md` or `.mdx` file in the appropriate category: ```bash # For a tutorial touch src/content/docs/tutorials/my-new-tutorial.md # For a how-to guide touch src/content/docs/how-to/my-new-guide.md ``` ### Add frontmatter Every documentation page should have frontmatter: ```markdown --- title: Page Title description: Brief description for SEO and page previews --- Your content here... ``` ### Update sidebar Add your page to the sidebar in `astro.config.mjs`: ```javascript sidebar: [ { label: 'Tutorials', items: [ { label: 'My New Tutorial', slug: 'tutorials/my-new-tutorial' }, ], }, ] ``` ## Features - **DiΓ‘taxis Framework**: Well-organized documentation structure - **Search**: Full-text search powered by Pagefind - **Dark Mode**: Automatic dark/light theme switching - **Mobile Responsive**: Optimized for all screen sizes - **Edit on GitHub**: Direct links to edit pages - **Type-safe**: TypeScript throughout - **Fast**: Static site generation with Astro - **Accessible**: WCAG 2.1 AA compliant ## Deployment The documentation can be deployed to any static hosting platform: - **Vercel**: `vercel deploy` - **Netlify**: `netlify deploy` - **GitHub Pages**: Configure in repository settings - **Cloudflare Pages**: Connect to GitHub repository ## Contributing To contribute to the documentation: 1. Fork the repository 2. Create a feature branch 3. Make your changes 4. Ensure the build succeeds (`npm run build`) 5. Submit a pull request ## Resources - [Starlight Documentation](https://starlight.astro.build/) - [Astro Documentation](https://docs.astro.build) - [DiΓ‘taxis Framework](https://diataxis.fr/) - [@astrojs/discovery Repository](https://github.com/withastro/astro-discovery) ## License MIT