config.py (view raw)
1# config.py - Vite's configuration script
2
3title = "icyphox"
4author = ""
5header = """<a href="/"><- back</a>"""
6
7# gets the latest commit
8import subprocess
9
10def get_commit():
11 out = subprocess.run(
12 ["git", "rev-parse", "--short", "HEAD"],
13 stdout=subprocess.PIPE)
14 commit = out.stdout.decode("utf-8").strip()
15 return commit
16
17def get_big_commit():
18 out = subprocess.run(
19 ["git", "rev-parse", "HEAD"],
20 stdout=subprocess.PIPE
21 )
22 big_commit = out.stdout.decode("utf-8").strip()
23 return big_commit
24
25
26def get_commit_date(commit):
27 out = subprocess.run(
28 ["git", "show", "-s", "--format=%cd", "--date=short", commit],
29 stdout=subprocess.PIPE)
30 date = out.stdout.decode("utf-8").strip()
31 return date
32
33commit = get_commit()
34big_commit = get_big_commit()
35date = get_commit_date(commit)
36
37# actually the sidebar
38footer = f"""
39 <img class="logo" src="/static/icyphox.png" alt="icyphox's avatar" />
40 <p>
41 <span class="sidebar-link">email</span>
42 <br>
43 <a href="mailto:x@icyphox.sh">x@icyphox.sh</a>
44 </p>
45
46 <p>
47 <span class="sidebar-link">github</span>
48 <br>
49 <a href="https://github.com/icyphox">icyphox</a>
50 </p>
51
52 <p>
53 <span class="sidebar-link">mastodon</span>
54 <br>
55 <a rel="me" href="https://toot.icyphox.sh/@x">@x@icyphox.sh</a>
56 </p>
57
58 <p>
59 <span class="sidebar-link">pgp</span>
60 <br>
61 <a href="/static/gpg.txt">0x8A93F96F78C5D4C4</a>
62 </p>
63
64 <p>
65 <span class="sidebar-link">last updated</span>
66 <br>
67 <a href="https://github.com/icyphox/site/commit/{big_commit}">{commit}</a> on {date}
68 </p>
69
70 <h3>friends</h3>
71 <p>
72 Some of <a href="/friends">my friends</a> and internet bros.
73 </p>
74
75 <h3>about</h3>
76 <p>
77 More <a href="/about">about me</a> and my work.
78 </p>
79
80 <div class="icons">
81 <a href="https://creativecommons.org/licensjes/by-nc-sa/4.0/">
82 <img class="footimgs" src="/static/cc.svg">
83 </a>
84 <a href="https://webring.xxiivv.com/#random" target="_blank">
85 <img class="footimgs" alt="xxiivv webring" src="/static/webring.svg">
86 </a>
87 </div>
88
89 """
90template = 'text.html' # default is index.html
91pre_build = [['bin/openring.py', '-j'], 'bin/update_index.py']
92post_build = ['bin/rss.py', 'bin/plaintext.sh']