Skip to main content
Glama
GenericUrlGenerator.ts1.18 kB
/** * Generic URL Generator for sources without specialized logic * Handles ui5-tooling, ui5-webcomponents, cloud-mta-build-tool, etc. */ import { BaseUrlGenerator, UrlGenerationContext } from './BaseUrlGenerator.js'; import { FrontmatterData } from './utils.js'; /** * Generic URL Generator * Uses configuration-based URL generation for sources without special requirements */ export class GenericUrlGenerator extends BaseUrlGenerator { protected generateSourceSpecificUrl(context: UrlGenerationContext & { frontmatter: FrontmatterData; section: string; anchor: string | null; }): string | null { const identifier = this.getIdentifierFromFrontmatter(context.frontmatter); // Use frontmatter ID if available if (identifier) { // Use the pathPattern to construct the URL properly let url = this.config.pathPattern.replace('{file}', identifier); url = this.config.baseUrl + url; // Add anchor if available if (context.anchor) { url += this.getSeparator() + context.anchor; } return url; } return null; // Let fallback handle filename-based generation } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/marianfoo/mcp-sap-docs'

If you have feedback or need assistance with the MCP directory API, please join our Discord server