Add verbatim template and throw error on invalid front-matter

This commit is contained in:
Andreas Hocevar
2015-04-02 20:28:32 +02:00
parent 6a105f9bcf
commit cd266f35ab
4 changed files with 10 additions and 1 deletions

View File

@@ -0,0 +1 @@
{{{ contents }}}

View File

@@ -1,3 +1,6 @@
---
template: "example-verbatim.html"
---
<!doctype html>
<html lang="en">
<head>

View File

@@ -1,3 +1,6 @@
---
template: "example-verbatim.html"
---
<!doctype html>
<html lang="en">
<head>

View File

@@ -19,7 +19,7 @@ function main(callback) {
file = files[f];
match = f.match(fileRegEx);
if (match) {
if (file.title) {
if (file.template) {
if (file.docs) {
file.docs = marked(file.docs);
}
@@ -56,6 +56,8 @@ function main(callback) {
file.resources = resources.join('\n');
}
}
} else if (f !== 'index.html'){
callback(new Error(f + ': Invalid YAML front-matter.'));
}
}
}