Index

joshstock.in / 58ecc9e

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

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
18317 Mar 2023 11:037722378Update targets script for automatic string templatingJosh Stockin1830G

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

application/x-python2919 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("Projects", href="/projects")),
18 hg.LI(hg.A("Resume", href="/resume")),
19 _class="wrap-group",
20 ),
21 hg.LI(_class="hfill"),
22 hg.DIV(
23 hg.LI(
24 hg.A(
25 hg.IMG(src="/static/svg/github.svg", _class="inline svg icon"),
26 href="/u/github",
27 ),
28 title="GitHub",
29 ),
30 hg.LI(
31 hg.A(
32 hg.IMG(src="/static/svg/gitlab.svg", _class="inline svg icon"),
33 href="/u/gitlab",
34 ),
35 title="GitLab",
36 ),
37 hg.LI(
38 hg.A(
39 hg.IMG(src="/static/svg/linkedin.svg", _class="inline svg icon"),
40 href="/u/linkedin",
41 ),
42 title="LinkedIn",
43 ),
44 hg.LI(
45 hg.A(
46 hg.IMG(src="/static/svg/youtube.svg", _class="inline svg icon"),
47 href="/u/youtube",
48 ),
49 title="YouTube",
50 ),
51 hg.LI(
52 hg.A(
53 hg.IMG(src="/static/svg/twitter.svg", _class="inline svg icon"),
54 href="/u/twitter",
55 ),
56 title="Twitter",
57 ),
58 hg.LI(
59 hg.A(
60 hg.IMG(src="/static/svg/email.svg", _class="inline svg icon"),
61 href="mailto:josh@joshstock.in",
62 ),
63 title="Email",
64 ),
65 hg.LI(
66 hg.A(
67 hg.IMG(src="/static/svg/rss.svg", _class="inline svg icon"),
68 href="/atom",
69 ),
70 title="Atom Feed",
71 ),
72 hg.LI(
73 hg.IMG(src="", _class="inline svg icon darkmodetoggle"),
74 onclick="toggleDarkMode()",
75 title="Toggle dark mode",
76 ),
77 _class="wrap-group",
78 ),
79 _class="topbar",
80 ),
81 _class="topbar-container",
82 )]
83 return header
84