mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Wrap doc site in raw tags.
This commit is contained in:
@@ -11,9 +11,10 @@ var basePath = path.join(__dirname, '..', '..'),
|
|||||||
readmePath = path.join(docPath, 'README.md');
|
readmePath = path.join(docPath, 'README.md');
|
||||||
|
|
||||||
function build(type) {
|
function build(type) {
|
||||||
// Load markdown and uncomment docdown HTML hints.
|
|
||||||
var markdown = fs
|
var markdown = fs
|
||||||
|
// Load markdown.
|
||||||
.readFileSync(readmePath, 'utf8')
|
.readFileSync(readmePath, 'utf8')
|
||||||
|
// Uncomment docdown HTML hints.
|
||||||
.replace(/(<)!--\s*|\s*--(>)/g, '$1$2');
|
.replace(/(<)!--\s*|\s*--(>)/g, '$1$2');
|
||||||
|
|
||||||
var $ = marky(markdown, { 'sanitize': false }),
|
var $ = marky(markdown, { 'sanitize': false }),
|
||||||
@@ -45,8 +46,8 @@ function build(type) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Append YAML front matter.
|
|
||||||
var html = [
|
var html = [
|
||||||
|
// Append YAML front matter.
|
||||||
'---',
|
'---',
|
||||||
'id: docs',
|
'id: docs',
|
||||||
'layout: docs',
|
'layout: docs',
|
||||||
@@ -54,7 +55,10 @@ function build(type) {
|
|||||||
'version: ' + (version || null),
|
'version: ' + (version || null),
|
||||||
'---',
|
'---',
|
||||||
'',
|
'',
|
||||||
|
// Wrap in raw tags to avoid Liquid template tag processing.
|
||||||
|
'{% raw %}',
|
||||||
_.trim($.html()),
|
_.trim($.html()),
|
||||||
|
'{% endraw %}'
|
||||||
].join('\n');
|
].join('\n');
|
||||||
|
|
||||||
fs.writeFile(path.join(docPath, version + '.html'), html, util.pitch);
|
fs.writeFile(path.join(docPath, version + '.html'), html, util.pitch);
|
||||||
|
|||||||
Reference in New Issue
Block a user