# renderMarkdownWithTemplate Renders markdown with frontmatter into a Handlebars template and writes HTML output. ## actionConfig options - `filePath` (string, required): Input markdown file path (computed from `jobConfig`). - `fileOutputPath` (string, required): Output HTML file path (computed from `jobConfig`). - `templateDirs` (string[], required): Directories to search for Handlebars templates. - `partialDirs` (string[], optional): Directories to search for Handlebars partials. - `defaultTemplate` (string, required unless frontmatter sets `template`): Template name fallback. ## Usage ```javascript action: renderMarkdownWithTemplate, jobConfig: { inputFiles: [{ pattern: "markdown/**/*.md" }], outputFileExtension: ".html" }, actionConfig: { templateDirs: ["templates/"], partialDirs: ["partials/"], defaultTemplate: "page" } ``` ## Notes - Uses frontmatter `template` when present, otherwise `defaultTemplate`. - Writes minified HTML to `fileOutputPath` and records the template as a dependency. - Respects `opts.markdown.allowHtml` to enable or strip raw HTML in markdown. - Mermaid code fences render as `.mermaid` blocks, and Mermaid runtime scripts are auto-injected only on pages that use them. - Set `opts.markdown.mermaid.scriptSrc` to self-host or pin a Mermaid bundle; `opts.markdown.mermaid.initialize` is passed to `mermaid.initialize(...)`. - Supports custom route blocks in markdown using `::route ` (for example: `::route mountain-loop`). - Route blocks render an image preview + GPX download link from `resources.routes`. - Route blocks include OpenStreetMap attribution when provided by route assets. - Route blocks render with stable `.route-block*` classes but without injected CSS or inline styling; the consuming app is responsible for presentation. - When rendering with template `article`, it auto-injects `BlogPosting` JSON-LD. - JSON-LD frontmatter sources: `title`, `description`, `date`/`published`, `modified`/`updated`, `author`, `image`/`images`/`heroImage`/`coverImage`. - Set frontmatter `includeArticleJsonLd: false` to disable auto-injection for a page. - Template context includes `structuredData.article` (object) and `structuredData.articleJsonLd` (JSON string).