Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 1.82 KB

markdown.md

File metadata and controls

49 lines (34 loc) · 1.82 KB

Markdown

Eleventy Short Name File Extension NPM Package
md .md markdown-it

Markdown files can be optionally pre-processed with an additional template engine. This can be configured on a per-template basis or globally. Read more at Changing a Template’s Rendering Engine.

Library Options

Defaults

  • html: true (default is false)

The above options are different than the default markdown-it options. See all markdown-it options.

Use your own options

New in Eleventy v0.3.0: Pass in your own instance of the Markdown library using the Configuration API. See all markdown-it options.

module.exports = function(eleventyConfig) {
  let markdownIt = require("markdown-it");
  let options = {
    html: true,
    breaks: true,
    linkify: true
  };

  eleventyConfig.setLibrary("md", markdownIt(options));
};

Add your own plugins

New in Eleventy v0.3.0: Pass in your own markdown-it plugins using the setLibrary Configuration API method (building on the method described in “Using your own options”).

  1. Find your own markdown-it plugin on NPM
  2. npm install the plugin.
module.exports = function(eleventyConfig) {
  let markdownIt = require("markdown-it");
  let markdownItEmoji = require("markdown-it-emoji");
  let options = {};

  eleventyConfig.setLibrary("md", markdownIt(options).use(markdownItEmoji));
};