-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDocument.py
More file actions
38 lines (29 loc) · 875 Bytes
/
Document.py
File metadata and controls
38 lines (29 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from luxon.html.tags import *
class Document(Html):
def __init__(self, title: str):
super().__init__()
# head
self.head = Head()
self.add(self.head)
# head > title
self.head.add(Title(title))
# head > link
self.head.add(Style("/assets/styles/base.css"))
# body
self.body = Body()
self.add(self.body)
# body > header
self.header = Header()
self.body.add(self.header)
# body > nav
self.nav = Nav().add(
A("Home", "/").set("data-page", "home"),
A("About", "/about").set("data-page", "about")
)
self.body.add(self.nav)
# body > main
self.main = Main()
self.body.add(self.main)
# body > footer
self.footer = Footer()
self.body.add(self.footer)