macos-defaults/build/production/handlebars-helpers.js
Cameron Little 32cf426956 Add support for spaces (and other specials) in keys
Currently, page url generation (slugification) is just toLowerCase. In https://github.com/yannbertrand/macos-defaults/pull/146 I add some defaults that contain keys with spaces, which currently breaks.

This pulls in `slugify` to add support, and shell escapes keys in examples.
2021-04-06 20:53:41 +02:00

8 lines
No EOL
233 B
JavaScript

const Handlebars = require('handlebars')
const slugify = require('slugify')
Handlebars.registerHelper('metaTag', (string) => {
return JSON.stringify(string.replace(/"/g, '"'))
})
Handlebars.registerHelper('slugify', slugify)