Skip to main content
Home

Markdown to html static site generator. Yet another.

This package works with DenoIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
76%
Published
a week ago (1.0.7)

@marianmeres/emde

Simple, directory based, markdown to html static site generator. Yet another.

Works out-of-the box with no configuration, while still being fully extensible if needed.

Example

See example source files and/or the output here or on the web.

Usage

deno run -A jsr:@marianmeres/emde/cli --indir src --outdir dist --verbose

This example source indir folder structure:

+-- src
|   +-- some
|   |   +-- index.md
|   +--  index.md

will generate these html pages in the outdir:

+-- dist
|   +-- some
|   |   +-- index.html
|   +--  index.html

Customization

Metadata

For pages metadata both markdown's "front matter" as well as meta.yaml files are supported. The meta.yaml files are supported to be located anywhere in the page hierarchy path (lower level is merged with the upper).

Rendering

Pages are rendered via lodash's template function with optional layout.ejs anywhere in the page hierarchy path (lower level overrides). If no custom layout.ejs is found, the very basic default one will be used.

The compiled template is called with the props argument:

interface Props {
    page: Page; // currently rendered page
    root: Page | null; // the root page
    parent: Page | null; // the parent page
    _pages: Record<string, Page>; // path based map of all pages
    _helpers: Helpers; // view helpers
}

interface Page {
    path: string; // "/some/path/to/page" (without the trailing slash)
    root: Page | null; // the root Page (at "/")
    parent: Page | null;
    meta: Record<string, any>; // the frontmatter merged with meta.yaml
    html: string; // the parsed markdown file output
    depth: number; // hierarchy tree level
}

View helpers

View helpers exported from helpers.js are supported anywhere in the page hierarchy path (lower level is merged with the upper). The merged exported members will be passed to compiled layout under _helpers props key.

There are some out-of-the-box available helpers.

Batteries are not included

If you need full featured production grade (with themes, plugins, deploy helpers, ...) static site generator, you should probably look elsewhere. I guess you know that already.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@marianmeres/emde

Import symbol

import * as emde from "@marianmeres/emde";
or

Import directly with a jsr specifier

import * as emde from "jsr:@marianmeres/emde";

Add Package

pnpm i jsr:@marianmeres/emde
or (using pnpm 10.8 or older)
pnpm dlx jsr add @marianmeres/emde

Import symbol

import * as emde from "@marianmeres/emde";

Add Package

yarn add jsr:@marianmeres/emde
or (using Yarn 4.8 or older)
yarn dlx jsr add @marianmeres/emde

Import symbol

import * as emde from "@marianmeres/emde";

Add Package

vlt install jsr:@marianmeres/emde

Import symbol

import * as emde from "@marianmeres/emde";

Add Package

npx jsr add @marianmeres/emde

Import symbol

import * as emde from "@marianmeres/emde";

Add Package

bunx jsr add @marianmeres/emde

Import symbol

import * as emde from "@marianmeres/emde";