Add verbatim template and throw error on invalid front-matter
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
{{{ contents }}}
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
---
|
||||||
|
template: "example-verbatim.html"
|
||||||
|
---
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
---
|
||||||
|
template: "example-verbatim.html"
|
||||||
|
---
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ function main(callback) {
|
|||||||
file = files[f];
|
file = files[f];
|
||||||
match = f.match(fileRegEx);
|
match = f.match(fileRegEx);
|
||||||
if (match) {
|
if (match) {
|
||||||
if (file.title) {
|
if (file.template) {
|
||||||
if (file.docs) {
|
if (file.docs) {
|
||||||
file.docs = marked(file.docs);
|
file.docs = marked(file.docs);
|
||||||
}
|
}
|
||||||
@@ -56,6 +56,8 @@ function main(callback) {
|
|||||||
file.resources = resources.join('\n');
|
file.resources = resources.join('\n');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (f !== 'index.html'){
|
||||||
|
callback(new Error(f + ': Invalid YAML front-matter.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user