Index

joshstock.in / 4174fd2

Source for serving and static templating/compiling of https://joshstock.in.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
20405 Sep 2024 14:05b2bc5e5commit updatesJosh Stockin1015G

Blob @ joshstock.in / site / generators / topbar.py

application/x-python2343 bytesdownload raw
1import htmlgenerator as hg
2
3
4def run(data):
5 header = [hg.DIV(
6 _class="banner-image"
7 if not data.type == "article"
8 else "banner-image blog-banner",
9 style=f"background-image: url({data.banner_image or '/static/images/river.jpg'})",
10 ),
11 hg.DIV(
12 hg.UL(
13 hg.LI(hg.B(hg.A("JOSH STOCKIN", href="/")), _class="title"),
14 hg.DIV(
15 hg.LI(hg.A("Blog", href="/blog")),
16 hg.LI(hg.A("Git", href="https://git.joshstock.in")),
17 hg.LI(hg.A("Resume", href="/resume")),
18 _class="wrap-group",
19 ),
20 hg.LI(_class="hfill"),
21 hg.DIV(
22 hg.LI(
23 hg.A(
24 hg.IMG(src="/static/svg/github.svg", _class="inline svg icon"),
25 href="/u/github",
26 ),
27 title="GitHub",
28 ),
29 hg.LI(
30 hg.A(
31 hg.IMG(src="/static/svg/linkedin.svg", _class="inline svg icon"),
32 href="/u/linkedin",
33 ),
34 title="LinkedIn",
35 ),
36 hg.LI(
37 hg.A(
38 hg.IMG(src="/static/svg/youtube.svg", _class="inline svg icon"),
39 href="/u/youtube",
40 ),
41 title="YouTube",
42 ),
43 hg.LI(
44 hg.A(
45 hg.IMG(src="/static/svg/email.svg", _class="inline svg icon"),
46 href="mailto:josh@joshstock.in",
47 ),
48 title="Email",
49 ),
50 hg.LI(
51 hg.A(
52 hg.IMG(src="/static/svg/rss.svg", _class="inline svg icon"),
53 href="/atom",
54 ),
55 title="Atom Feed",
56 ),
57 hg.LI(
58 hg.IMG(src="", _class="inline svg icon darkmodetoggle"),
59 onclick="toggleDarkMode()",
60 title="Toggle dark mode",
61 ),
62 _class="wrap-group",
63 ),
64 _class="topbar",
65 ),
66 _class="topbar-container",
67 )]
68 return header
69