Add wordcount to footer
This commit is contained in:
parent
805ddbcadb
commit
243ccc4641
4 changed files with 15 additions and 2 deletions
|
@ -55,6 +55,7 @@ body.footer, body.header {
|
|||
|
||||
td {
|
||||
text-align: center;
|
||||
width: 33%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,13 @@
|
|||
<body class="footer">
|
||||
<table>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
Page <span class="page"></span> of <span class="topage"></span>
|
||||
</td>
|
||||
<td>
|
||||
Total Words: {{ word_count }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script type="text/javascript" src="../static/context.js"></script>
|
||||
|
|
|
@ -4,6 +4,13 @@
|
|||
<link rel="stylesheet" href="../static/style.css" />
|
||||
</head>
|
||||
<body class="header">
|
||||
<table>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
<script type="text/javascript" src="../static/context.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -11,6 +11,7 @@ EXTRA_CONTEXT = {
|
|||
def get_context(config, content):
|
||||
context = config['context'].copy()
|
||||
context['title'] = config['title']
|
||||
context = dict(context, **EXTRA_CONTEXT)
|
||||
context['word_count'] = word_count(content)
|
||||
context = dict(context, **EXTRA_CONTEXT, **{
|
||||
'word_count': word_count(content)
|
||||
})
|
||||
return context
|
||||
|
|
Reference in a new issue