From cd399d1b9df197f25f7eee6bb2b5e7d5ec3a3f47 Mon Sep 17 00:00:00 2001
From: John MacFarlane <fiddlosopher@gmail.com>
Date: Sun, 14 Jul 2013 20:43:21 -0700
Subject: [PATCH] Updated sample.lua for new metadata.

---
 data/sample.lua | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/data/sample.lua b/data/sample.lua
index 36eb9f6ef..1c82ebe2e 100644
--- a/data/sample.lua
+++ b/data/sample.lua
@@ -77,16 +77,16 @@ function Doc(body, metadata, variables)
   add('<!DOCTYPE html>')
   add('<html>')
   add('<head>')
-  add('<title>' .. metadata.title .. '</title>')
+  add('<title>' .. (metadata['title'] or '') .. '</title>')
   add('</head>')
   add('<body>')
-  if title ~= "" then
-    add('<h1 class="title">' .. metadata.title .. '</h1>')
+  if metadata['title'] and metadata['title'] ~= "" then
+    add('<h1 class="title">' .. metadata['title'] .. '</h1>')
   end
-  for _, author in pairs(metadata.author) do
+  for _, author in pairs(metadata['author'] or {}) do
     add('<h2 class="author">' .. author .. '</h2>')
   end
-  if date ~= "" then
+  if metadata['date'] and metadata['date'] ~= "" then
     add('<h3 class="date">' .. metadata.date .. '</h3>')
   end
   add(body)