UNPKG

@signalwire/docusaurus-plugin-llms-txt

Version:

Generate Markdown versions of Docusaurus HTML pages and an llms.txt index file

25 lines (24 loc) 715 B
/** * Exclusion pattern matching * Pattern matching for exclude paths */ import { createMatcher } from '@docusaurus/utils'; import { ensureLeadingSlash } from '../utils'; /** * Create exclusion matcher function from exclude patterns * @internal */ export function createExclusionMatcher(excludeRoutes) { return excludeRoutes?.length ? createMatcher([...excludeRoutes]) : () => false; } /** * Checks if a route path should be excluded based on exclude patterns * @internal */ export function isRouteExcluded(routePath, isExcluded) { // Normalize route path to ensure it starts with / const normalizedPath = ensureLeadingSlash(routePath); return isExcluded(normalizedPath); }