From db08f5c8a905188b67d98e1f197b467714bf7c2e Mon Sep 17 00:00:00 2001 From: Gunwant Jain Date: Wed, 6 Jan 2021 05:14:12 +0530 Subject: [PATCH] pretty.html: refactor Make actual use of the Tera templating, when youre intending to use it. Signed-off-by: Gunwant Jain --- templates/base.html.tera | 62 ++++++++++++++++++++ templates/pretty.html.tera | 112 +++++++++++-------------------------- 2 files changed, 96 insertions(+), 78 deletions(-) create mode 100644 templates/base.html.tera diff --git a/templates/base.html.tera b/templates/base.html.tera new file mode 100644 index 0000000..94911dd --- /dev/null +++ b/templates/base.html.tera @@ -0,0 +1,62 @@ + + + + + + + + {{ title }} + + + + {% block head %} + {% endblock head %} + + + + + + {% block body %}{% endblock body %} + + + diff --git a/templates/pretty.html.tera b/templates/pretty.html.tera index 88133af..55c6002 100644 --- a/templates/pretty.html.tera +++ b/templates/pretty.html.tera @@ -1,85 +1,43 @@ - - +{% extends "base" %} - - - - - {{ title }} +{% block styles %} - - - - - - {% if theme %} - - {% endif %} - - + text-align: centre; + /* Change color to that of your theme's comment color */ + color: #5c6773; + border-right: 20px solid transparent; + vertical-align: top; + } - + /* for block of code */ + .hljs-ln-code { + padding-left: 10px; + } +{% endblock styles %} + + +{% block head %} + {% if theme %} + + {% endif %} +{% endblock head %} + + +{% block body %}
{{ code }}
@@ -88,6 +46,4 @@ hljs.initHighlightingOnLoad(); hljs.initLineNumbersOnLoad(); - - - +{% endblock body %}