archive
/
md-pdf
Archived
1
Fork 0

add all of config to context

This commit is contained in:
Jake Howard 2017-05-25 20:39:24 +01:00
parent b242657df7
commit a8a228cb23
1 changed files with 10 additions and 3 deletions

View File

@ -12,10 +12,17 @@ EXTRA_CONTEXT = {
def get_context(config, content):
config = config.copy()
context = config['context'].copy()
context['title'] = config['title']
context = dict(context, **EXTRA_CONTEXT, **{
})
del config['context']
context = dict(
config,
**context,
**EXTRA_CONTEXT,
**{
}
)
if config.get('show_word_count'):
context['word_count'] = word_count(get_plain_text(content))
return context