smart-markdown-loader

- Extracts front-matter & metadata - Resolves images - Emits markdown file as a URL

Usage no npm install needed!

<script type="module">
  import smartMarkdownLoader from 'https://cdn.skypack.dev/smart-markdown-loader';
</script>

README

Smart Markdown Loader

  • Extracts front-matter & metadata
  • Resolves images
  • Emits markdown file as a URL

Defining Metadata

You can supply metadata by placing the following pattern at the top of your markdown file.

###### meta start

key: value
key: value
key: value
...

###### meta end

Loader Options

Property Type Required Description
publicPath string Public path of the root of the site.
outputPath string Directory to emit the files in the output path.

Emitted Interface

export interface MarkdownResolveData {
    /**
     * URL to the markdown file.
     */
    url: string;

    /**
     * Meta/Front-matter data from the markdown file.
     */
    meta: Record<string, string>;
}