summaryrefslogtreecommitdiff
path: root/repo/www/helpers.py
diff options
context:
space:
mode:
Diffstat (limited to 'repo/www/helpers.py')
-rw-r--r--repo/www/helpers.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/repo/www/helpers.py b/repo/www/helpers.py
index 80b8857..3d412b4 100644
--- a/repo/www/helpers.py
+++ b/repo/www/helpers.py
@@ -56,8 +56,8 @@ def deserialize_directories(directories):
}
-def pandoc(page, output, template, filters, stylesheets, title=None,
- site_title=None, include_after=(), variables=None):
+def pandoc(page, output, template, filters, stylesheets, site_title=None,
+ include_after=(), variables=None, metadata=None):
cmd = (
'pandoc', '-s', page, '-o', output, '--template', template,
*chain(*(('--lua-filter', f) for f in filters)),
@@ -65,14 +65,16 @@ def pandoc(page, output, template, filters, stylesheets, title=None,
*chain(*(('--include-after-body', f) for f in include_after))
)
- if title is not None:
- cmd += ('-M', f'title={title}')
if site_title is not None:
cmd += ('-T', site_title)
if variables is not None:
cmd += tuple(chain(
*(('-V', f'{k}={v}') for k, v in variables.items())
))
+ if metadata is not None:
+ cmd += tuple(chain(
+ *(('-M', f'{k}={v}') for k, v in metadata.items())
+ ))
environ['LUA_PATH'] = '.cache/?.lua;;'
run(cmd, check=True)