]> xn--ix-yja.es Git - alex.git/commitdiff
Make body narrow
authoralex <alex@pdp7.net>
Sat, 11 Nov 2023 12:14:08 +0000 (13:14 +0100)
committeralex <alex@pdp7.net>
Sat, 11 Nov 2023 12:14:08 +0000 (13:14 +0100)
blog/blog/html.py

index ca3e8e0448e665ebbbadfac56de088e01173e0e2..f9b9d88c3486ad02d9245059b6ce5c5a38f8feee 100644 (file)
@@ -1,4 +1,5 @@
 import itertools
+import textwrap
 
 import htmlgenerator as h
 
@@ -28,6 +29,15 @@ def html_template(*content, page_title=None, full):
             h.HEAD(
                 h.TITLE(meta.TITLE + (f" - {page_title}" if page_title else "")),
                 h.LINK(rel="alternate", type="application/rss+xml", title=meta.TITLE, href=f"{meta.SCHEMA}://{meta.HOST}/feed/"),
+                h.STYLE(textwrap.dedent("""
+                    body {
+                        max-width: 60em;
+                        margin-left: auto;
+                        margin-right: auto;
+                        padding-left: 2em;
+                        padding-right: 2em;
+                    }
+                """).lstrip())
             ),
             h.BODY(
                 h.H1(title),