Skip to content

Instantly share code, notes, and snippets.

@nikolaswise
Last active August 29, 2015 14:24
Show Gist options
  • Save nikolaswise/8649ca27f40b22027c8b to your computer and use it in GitHub Desktop.
Save nikolaswise/8649ca27f40b22027c8b to your computer and use it in GitHub Desktop.
static-site markdown helper
var md = require('markdown-it')({
html: true,
linkify: true,
typographer: true,
quotes: '“”‘’'
})
.use(require('markdown-it-highlightjs'))
.use(require('markdown-it-footnote'))
.use(require('markdown-it-emoji'))
.use(require('markdown-it-container'), 'figure')
var typogr = require('typogr');
module.exports = function (site, cb) {
site = site.map(function (page) {
console.log(page.isMarkdown)
if (page.isMarkdown) {
page.content = md.render(page.content)
page.content = typogr.typogrify(page.content)
}
return page
})
cb(null, site)
}
@nikolaswise
Copy link
Author

tons of markdown goodies like footnotes, tables, and custom div classes, emoji, and all the proper typography options you could ever need.

@paulcpederson
Copy link

@nikolaswise so this is no template engine, then use this helper?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment