add all of config to context
This commit is contained in:
parent
b242657df7
commit
a8a228cb23
1 changed files with 10 additions and 3 deletions
|
@ -12,10 +12,17 @@ EXTRA_CONTEXT = {
|
||||||
|
|
||||||
|
|
||||||
def get_context(config, content):
|
def get_context(config, content):
|
||||||
|
config = config.copy()
|
||||||
context = config['context'].copy()
|
context = config['context'].copy()
|
||||||
context['title'] = config['title']
|
del config['context']
|
||||||
context = dict(context, **EXTRA_CONTEXT, **{
|
context = dict(
|
||||||
})
|
config,
|
||||||
|
**context,
|
||||||
|
**EXTRA_CONTEXT,
|
||||||
|
**{
|
||||||
|
|
||||||
|
}
|
||||||
|
)
|
||||||
if config.get('show_word_count'):
|
if config.get('show_word_count'):
|
||||||
context['word_count'] = word_count(get_plain_text(content))
|
context['word_count'] = word_count(get_plain_text(content))
|
||||||
return context
|
return context
|
||||||
|
|
Reference in a new issue