From cd266f35abbef75b938f934cda246fed92a223b8 Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Thu, 2 Apr 2015 20:28:32 +0200 Subject: [PATCH] Add verbatim template and throw error on invalid front-matter --- config/examples/example-verbatim.html | 1 + examples_src/geolocation-orientation.html | 3 +++ examples_src/mobile-full-screen.html | 3 +++ tasks/build-examples.js | 4 +++- 4 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 config/examples/example-verbatim.html diff --git a/config/examples/example-verbatim.html b/config/examples/example-verbatim.html new file mode 100644 index 0000000000..649a88cea0 --- /dev/null +++ b/config/examples/example-verbatim.html @@ -0,0 +1 @@ +{{{ contents }}} diff --git a/examples_src/geolocation-orientation.html b/examples_src/geolocation-orientation.html index 5dd4fe3f61..a65ee833bd 100644 --- a/examples_src/geolocation-orientation.html +++ b/examples_src/geolocation-orientation.html @@ -1,3 +1,6 @@ +--- +template: "example-verbatim.html" +--- diff --git a/examples_src/mobile-full-screen.html b/examples_src/mobile-full-screen.html index 1afd9087f0..65c51ce89e 100644 --- a/examples_src/mobile-full-screen.html +++ b/examples_src/mobile-full-screen.html @@ -1,3 +1,6 @@ +--- +template: "example-verbatim.html" +--- diff --git a/tasks/build-examples.js b/tasks/build-examples.js index f53f2dc99e..412324a0e3 100644 --- a/tasks/build-examples.js +++ b/tasks/build-examples.js @@ -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.')); } } }