diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2013-07-14 20:43:21 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2013-07-14 20:43:21 -0700 |
commit | cd399d1b9df197f25f7eee6bb2b5e7d5ec3a3f47 (patch) | |
tree | f7a4cc39cff299bb87e5529bdbe3a0acd96dfed3 | |
parent | 359ce379cc7f96c185275f7532914459edf72827 (diff) | |
download | pandoc-cd399d1b9df197f25f7eee6bb2b5e7d5ec3a3f47.tar.gz |
Updated sample.lua for new metadata.
-rw-r--r-- | data/sample.lua | 10 |
1 files 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) |