Description
The current buildScripts/generateSeoFiles.mjs script generates a sitemap and llms.txt that cover the main application routes and the "learn" section. However, it omits the numerous examples available in the repository, which are a critical resource for users and for providing context to LLMs.
This epic is to enhance the script to automatically discover and include all relevant examples by scanning the apps/ and examples/ directories.
Acceptance Criteria
- File-based Discovery: The script must recursively scan the
apps/ and examples/ directories to find all index.html files, treating each as a discoverable example.
- URL Generation: The path to each discovered
index.html should be converted into a relative URL.
- Sitemap Integration: All discovered example URLs must be included in the generated
dist/sitemap.xml.
- llms.txt Integration: All discovered example URLs must be included in the generated
apps/portal/llms.txt. A descriptive name should be generated from the file path for each example.
- Exclusions: The file-based discovery should not include examples from
node_modules or other irrelevant directories.
Implementation Suggestions
- Create
collectExampleRoutes(): Create a new function within buildScripts/generateSeoFiles.mjs named collectExampleRoutes. This function will encapsulate the logic for finding all example routes.
- Integrate into
collectAllRoutes(): Modify the existing collectAllRoutes function to call collectExampleRoutes and merge its results with the top-level and content routes.
- File Scanning: Use a glob pattern like
{apps,examples}/**/index.html to find all example entry points. For each file found, create a route object.
- Update
getLlmsTxt: The getLlmsTxt function will need to be updated to handle the new example routes, possibly creating a new "Examples" section in the output.
Description
The current
buildScripts/generateSeoFiles.mjsscript generates a sitemap andllms.txtthat cover the main application routes and the "learn" section. However, it omits the numerous examples available in the repository, which are a critical resource for users and for providing context to LLMs.This epic is to enhance the script to automatically discover and include all relevant examples by scanning the
apps/andexamples/directories.Acceptance Criteria
apps/andexamples/directories to find allindex.htmlfiles, treating each as a discoverable example.index.htmlshould be converted into a relative URL.dist/sitemap.xml.apps/portal/llms.txt. A descriptive name should be generated from the file path for each example.node_modulesor other irrelevant directories.Implementation Suggestions
collectExampleRoutes(): Create a new function withinbuildScripts/generateSeoFiles.mjsnamedcollectExampleRoutes. This function will encapsulate the logic for finding all example routes.collectAllRoutes(): Modify the existingcollectAllRoutesfunction to callcollectExampleRoutesand merge its results with the top-level and content routes.{apps,examples}/**/index.htmlto find all example entry points. For each file found, create a route object.getLlmsTxt: ThegetLlmsTxtfunction will need to be updated to handle the new example routes, possibly creating a new "Examples" section in the output.