Use templating

This commit is contained in:
Jon Michael Aanes 2023-09-17 18:19:58 +02:00
parent a8bf19350e
commit 2463d2e11f
2 changed files with 2 additions and 6 deletions

View File

@ -1,7 +1,7 @@
import argparse import argparse
import bottle import bottle
import templates TEMPLATE_INDEX = bottle.SimpleTemplate(name = "templates/index.html")
# #
@ -24,7 +24,7 @@ def render_calendar(events_map, today):
'already_past': day_of_month < today, 'already_past': day_of_month < today,
'events': events_map.get(day_of_month, []), 'events': events_map.get(day_of_month, []),
}) })
return bottle.template(templates.TEMPLATE_INDEX, days = days) return TEMPLATE_INDEX.render(days = days)
## Paths ## Paths

View File

@ -1,4 +1,3 @@
TEMPLATE_INDEX = '''
<!DOCTYPE HTML> <!DOCTYPE HTML>
<html> <html>
<head> <head>
@ -51,6 +50,3 @@ TEMPLATE_INDEX = '''
</table> </table>
</body> </body>
</html> </html>
'''