| 1 | # Custom Plugin Replacement Plan |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | This document outlines how to replace custom Docusaurus plugins and functionality with Mintlify Pro equivalents. |
| 6 | |
| 7 | ## Custom Plugins Analysis |
| 8 | |
| 9 | ### 1. Custom LLMs.txt Plugin ✅ BUILT-IN (Mintlify Pro) |
| 10 | |
| 11 | **Current functionality:** |
| 12 | |
| 13 | - Scans HTML files post-build |
| 14 | - Extracts titles, descriptions, URLs from all pages |
| 15 | - Organizes content by sections (Getting Started, Features, Guides, etc.) |
| 16 | - Generates structured `/llms.txt` file for AI model consumption |
| 17 | |
| 18 | **Mintlify Pro replacement:** |
| 19 | |
| 20 | - **Automatic `/llms.txt`** - Lists all available pages automatically |
| 21 | - **Automatic `/llms-full.txt`** - Combines entire documentation into single file |
| 22 | - **AI-optimized** - Specifically designed for LLM consumption |
| 23 | - **No custom code required** - Built-in feature |
| 24 | |
| 25 | **Status:** ✅ Complete - No migration needed |
| 26 | |
| 27 | ### 2. Analytics Configuration ✅ BUILT-IN |
| 28 | |
| 29 | **Current:** |
| 30 | |
| 31 | - Google Analytics: `G-M3JWW8N2XQ` |
| 32 | - Custom Reo.dev script |
| 33 | |
| 34 | **Mintlify replacement:** |
| 35 | |
| 36 | - Native Google Analytics support in mint.json |
| 37 | - Custom scripts can be added via mint.json |
| 38 | |
| 39 | ### 3. Search Configuration ✅ BUILT-IN |
| 40 | |
| 41 | **Current:** |
| 42 | |
| 43 | - Algolia search (App ID: `0OMUMCQZVV`, Index: `continue`) |
| 44 | |
| 45 | **Mintlify replacement:** |
| 46 | |
| 47 | - Native search functionality built-in |
| 48 | - Can configure Algolia if needed |
| 49 | |
| 50 | ### 4. URL Redirects ✅ COMPLETE |
| 51 | |
| 52 | **Status:** Already migrated (145 redirects) in mint.json |
| 53 | |
| 54 | ## Implementation Plan |
| 55 | |
| 56 | ### Phase 4A: Replace LLMs.txt Plugin |
| 57 | |
| 58 | 1. Create `generate-llms-txt.js` script |
| 59 | 2. Adapt to work with Mintlify's build structure |
| 60 | 3. Test with current docs2 content |
| 61 | 4. Add to build process |
| 62 | |
| 63 | ### Phase 4B: Add Analytics |
| 64 | |
| 65 | 1. Add Google Analytics to mint.json |
| 66 | 2. Migrate custom Reo.dev script if needed |
| 67 | |
| 68 | ### Phase 4C: Configure Search |
| 69 | |
| 70 | 1. Verify Mintlify search works |
| 71 | 2. Configure Algolia if required |
| 72 | |
| 73 | ## Custom LLMs.txt Script for Mintlify |
| 74 | |
| 75 | ```javascript |
| 76 | // generate-llms-txt.js - Adapted for Mintlify |
| 77 | const fs = require("fs"); |
| 78 | const path = require("path"); |
| 79 | |
| 80 | function generateLLMsTxt(buildDir) { |
| 81 | const sections = { |
| 82 | "Getting Started": [], |
| 83 | Features: [], |
| 84 | Guides: [], |
| 85 | Customization: [], |
| 86 | Customize: [], |
| 87 | Hub: [], |
| 88 | Reference: [], |
| 89 | }; |
| 90 | |
| 91 | // Read mint.json to get page structure |
| 92 | const mintJson = JSON.parse(fs.readFileSync("mint.json", "utf8")); |
| 93 | |
| 94 | // Extract page info from navigation |
| 95 | function extractPages(navItems, sectionName = "") { |
| 96 | navItems.forEach((item) => { |
| 97 | if (typeof item === "string") { |
| 98 | // Direct page reference |
| 99 | const pageInfo = getPageInfo(item); |
| 100 | if (pageInfo) { |
| 101 | categorizeContent(pageInfo, sections); |
| 102 | } |
| 103 | } else if (item.group && item.pages) { |
| 104 | // Group with pages |
| 105 | extractPages(item.pages, item.group); |
| 106 | } |
| 107 | }); |
| 108 | } |
| 109 | |
| 110 | extractPages(mintJson.navigation); |
| 111 | |
| 112 | // Generate llms.txt content |
| 113 | generateContent(sections); |
| 114 | } |
| 115 | ``` |
| 116 | |
| 117 | ## Files to Create |
| 118 | |
| 119 | 1. **`/docs2/scripts/generate-llms-txt.js`** - LLMs.txt generator |
| 120 | 2. **`/docs2/scripts/build-hooks.js`** - Post-build automation |
| 121 | 3. **Update mint.json** - Add analytics and search config |
| 122 | |
| 123 | ## Success Criteria |
| 124 | |
| 125 | - [ ] LLMs.txt generated correctly from Mintlify build |
| 126 | - [ ] Analytics tracking matches current setup |
| 127 | - [ ] Search functionality works as expected |
| 128 | - [ ] All redirects function properly |
| 129 | - [ ] No loss of functionality compared to Docusaurus |
| 130 | |
| 131 | ## Risk Assessment |
| 132 | |
| 133 | **Low Risk:** |
| 134 | |
| 135 | - Analytics migration (built-in support) |
| 136 | - Search configuration (native functionality) |
| 137 | |
| 138 | **Medium Risk:** |
| 139 | |
| 140 | - LLMs.txt generation (requires custom script) |
| 141 | - Custom JavaScript integration |
| 142 | |
| 143 | **Mitigation:** |
| 144 | |
| 145 | - Test scripts thoroughly before deployment |
| 146 | - Keep Docusaurus version running during transition |
| 147 | - Monitor analytics and search metrics post-migration |