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 {
|
td {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
width: 33%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,9 +6,13 @@
|
||||||
<body class="footer">
|
<body class="footer">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td></td>
|
||||||
<td>
|
<td>
|
||||||
Page <span class="page"></span> of <span class="topage"></span>
|
Page <span class="page"></span> of <span class="topage"></span>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
Total Words: {{ word_count }}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<script type="text/javascript" src="../static/context.js"></script>
|
<script type="text/javascript" src="../static/context.js"></script>
|
||||||
|
|
|
@ -4,6 +4,13 @@
|
||||||
<link rel="stylesheet" href="../static/style.css" />
|
<link rel="stylesheet" href="../static/style.css" />
|
||||||
</head>
|
</head>
|
||||||
<body class="header">
|
<body class="header">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
<script type="text/javascript" src="../static/context.js"></script>
|
<script type="text/javascript" src="../static/context.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -11,6 +11,7 @@ EXTRA_CONTEXT = {
|
||||||
def get_context(config, content):
|
def get_context(config, content):
|
||||||
context = config['context'].copy()
|
context = config['context'].copy()
|
||||||
context['title'] = config['title']
|
context['title'] = config['title']
|
||||||
context = dict(context, **EXTRA_CONTEXT)
|
context = dict(context, **EXTRA_CONTEXT, **{
|
||||||
context['word_count'] = word_count(content)
|
'word_count': word_count(content)
|
||||||
|
})
|
||||||
return context
|
return context
|
||||||
|
|
Reference in a new issue