file-based-routing-for-static-sites

Generate multi-page static sites from Markdown files with file-based routing.

58|6|Updated Jan 27, 2026
One-click install
npx skills add https://github.com/rodydavis/skills --skill file-based-routing-for-static-sites
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: file-based-routing-for-static-sites
Source: https://github.com/rodydavis/skills/tree/main/skills/static-site-file-based-routing
Command: npx skills add https://github.com/rodydavis/skills --skill file-based-routing-for-static-sites

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @pkgjs/parseargs, @types/markdown-it, @types/node, @web/dev-server, chokidar, highlight.js, html-format, markdown-it, parse5, typescript, and includes scripts (resource) components.

What problem does it solve?

This Skill simplifies the creation of multi-page static websites by enabling file-based routing, making content management and updates more efficient.

Core Features & Use Cases

  • File-Based Routing: Automatically generates routes based on your file structure.
  • Markdown to HTML Conversion: Processes .md files into HTML pages.
  • Layout Inheritance: Supports layout.html for consistent page structure.
  • Static Asset Handling: Copies static files like CSS and images.
  • Use Case: Quickly build a documentation site or a small marketing website where each Markdown file becomes a navigable page.

Quick Start

Run npm run dev in the project directory to start the development server with live reloading.

Frequently Asked Questions about file-based-routing-for-static-sites

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Can I use a shared layout template across multiple HTML pages in a static site?

Markdown to HTML conversion processes `.md` files into fully rendered HTML pages during the static site build. The tool uses markdown-it to parse content and highlight.js for code syntax highlighting, outputting standard HTML files.

How do I build a static site with file-based routing from Markdown files?

Layout inheritance allows you to define a `layout.html` file to maintain consistent page structure across your static site. The build process applies this wrapper template to individual Markdown-generated HTML pages automatically.

Can I use a shared layout template across multiple HTML pages in a static site?

The development environment supports live reloading via the `@web/dev-server` dependency and `chokidar` file watcher. Running `npm run dev` starts a local server that automatically refreshes pages when Markdown or TypeScript files change.

Does this static site build tool support live reloading during development?

File-based routing for static sites automatically maps your directory structure to URLs, converting Markdown files to HTML pages. You organize content in folders, and the build tool processes the input directory to generate a navigable static output build.

What is the best way to manage static assets like CSS and images in a TypeScript static site generator?

Static asset handling copies static files like CSS and images directly to the output build directory. This ensures your static site generator properly bundles stylesheets and media alongside the compiled HTML pages.

What are the limitations of file-based routing for multi-page static sites?

File-based routing requires strict directory naming for URL generation and relies on TypeScript compilation. Complex dynamic routing or server-side rendering is not supported, as it focuses solely on generating static output builds from Markdown and HTML files.