Usage:
import { markdown } from "markexpress";
app.use("/", markdown("./{markdown_folder_to_be_served}"));
app.use("/", markdown("./{markdown_folder_to_be_served}", {
strip: true, // Strip .md from url (default {true})
fallback: true // Fallback to other middleware in case of error (default {true})
}));
The title of the page will be autogenerated by the first header level 1 fount in the page, but you can add a front matter in yaml to your markdown files to specify some extra attributes to the generated page.
---
title: Title of the page
css: /path/to/file.css
favicon: /path/to/image
---
Lorem ipsum dolor sit amet.
Type definitions are available.