Branchwell

Jobley / website · jobley.ai / tools / build-board.py

Raw 9.8 KB on d14acf64f300a98264b525561351a794d6aca308
1#!/usr/bin/env python3
2"""Build Jobley, our recruiting board. Every open role on every team, linked to that team's careers page.
3Data: tools/jobs.json. Run from the repository root; writes index.html, privacy/, 404.html, robots.txt
4and puts the same header and footer on research/."""
5import json, os, re
6from html import escape as e
7
8ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
9JOBS = json.load(open(os.path.join(ROOT, "tools", "jobs.json")))
10SOURCE = "https://branchwell.ai/jobley/website"
11V = "20261203"
12ARROW = '<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8h10M9 4l4 4-4 4"/></svg>'
13TOTAL = sum(len(o["roles"]) for o in JOBS)
14DESC = "We're hiring builders, and people who want to become one. Every open role on every one of our teams, in one place."
15
16
17def head(title, desc, extra=""):
18 return f'''<!doctype html>
19<html lang="en">
20<head>
21 <meta charset="utf-8">
22 <meta name="viewport" content="width=device-width, initial-scale=1">
23 <meta name="description" content="{e(desc)}">
24 <meta name="theme-color" content="#faf6ee" media="(prefers-color-scheme: light)">
25 <meta name="theme-color" content="#0d1511" media="(prefers-color-scheme: dark)">
26 <meta property="og:type" content="website">
27 <meta property="og:title" content="{e(title)}">
28 <meta property="og:description" content="{e(desc)}">
29 <meta property="og:image" content="https://jobley.ai/social-card.png?v=20261127">
30 <meta name="twitter:card" content="summary_large_image">
31 <link rel="icon" href="/favicon.png?v=20261127" type="image/png">
32 <link rel="apple-touch-icon" href="/assets/apple-touch-icon.png?v=20261127">
33 <link rel="stylesheet" href="/assets/site.css?v=20261129-touch">
34 <link rel="stylesheet" href="/assets/board.css?v={V}">
35 <link rel="stylesheet" href="/assets/visitor-odometer.v1.css">
36 <script defer src="/assets/visitor-odometer.v1.js"></script>{extra}
37 <title>{e(title)}</title>
38 <!-- no-orphans --><link rel="stylesheet" href="/no-orphans.css"><script src="/no-orphans.js" defer></script><!-- /no-orphans -->
39</head>'''
40
41
42HEADER = '''<header class="site-header">
43 <div class="shell nav">
44 <a class="wordmark" href="/" aria-label="Jobley home"><img src="/assets/icon.png?v=20261127" alt="" width="30" height="30">Jobley</a>
45 <nav aria-label="Main">
46 <a class="nav-hide-sm" href="/#how">How to apply</a>
47 <a class="nav-cta" href="/#jobs">Find a job</a>
48 </nav>
49 </div>
50 </header>'''
51
52FOOTER = f'''<footer>
53 <div class="shell footer board-footer">
54 <nav aria-label="Footer"><a href="/research/">Research</a><span aria-hidden="true">·</span><a href="{SOURCE}">Source</a></nav>
55 </div>
56 </footer>'''
57
58
59def write(rel, text):
60 path = os.path.join(ROOT, rel)
61 os.makedirs(os.path.dirname(path) or ROOT, exist_ok=True)
62 with open(path, "w") as f:
63 f.write(text)
64
65
66def org_card(o):
67 careers = f"https://{o['domain']}/careers/"
68 tech = set(o.get("tech", []))
69 where = f'<span class="org-where">{e(o["where"])}</span>' if o["where"] else ""
70 tag = ' <span class="tag">Tech</span>'
71 roles = "\n".join(
72 f' <li><a href="{careers}">{e(r)}</a>{tag if r in tech else ""}</li>'
73 for r in o["roles"])
74 words = " ".join([o["name"], o["what"], o["where"], *o["roles"]]).lower()
75 return f''' <article class="org" data-where="{e(o["where"])}" data-words="{e(words)}">
76 <div class="org-head">
77 <h3><a href="https://{o['domain']}/">{e(o["name"])}</a></h3>
78 {where}
79 </div>
80 <p class="org-what">{e(o["what"])}</p>
81 <ul class="roles" role="list">
82{roles}
83 </ul>
84 <a class="button org-apply" href="{careers}">Apply on {e(o["domain"])} {ARROW}</a>
85 </article>'''
86
87
88def index():
89 places = sorted({o["where"] for o in JOBS if o["where"]})
90 opts = "".join(f'<option value="{e(p)}">{e(p)}</option>' for p in places)
91 cards = "\n".join(org_card(o) for o in JOBS)
92 h = head("Jobley · We're hiring builders", DESC, '\n <script defer src="/assets/board.js?v=' + V + '"></script>') + f'''
93<body>
94 <a class="skip" href="#main">Skip to content</a>
95 {HEADER}
96 <main id="main">
97 <section class="hero" aria-labelledby="hero-title">
98 <div class="shell">
99 <p class="pill"><i></i>{TOTAL} roles on {len(JOBS)} teams</p>
100 <div class="visitor-welcome" data-visitor-odometer data-visitor-site="jobley"></div>
101 <h1 id="hero-title">We're hiring <em>builders.</em></h1>
102 <p class="lead">A builder takes action. Builders don't ask questions and don't ask permission. They see what needs doing and do it. If that's you, or who you want to become, we want you on the team.</p>
103 <p class="lead">Every open role on every one of our teams is here. Pick one and apply on that team's own site. <strong>A real person reads every message. No AI screens, scores or ranks anyone.</strong></p>
104 <ul class="perks" role="list">
105 <li>Part-time and paid by the hour</li>
106 <li>Work as much or as little as you want</li>
107 <li>Days off whenever you want</li>
108 <li>A Bitcoin bonus every day</li>
109 <li>Health care, free groceries and free meals</li>
110 </ul>
111 <div class="actions">
112 <a class="button" href="#jobs">Find your job {ARROW}</a>
113 <a class="button secondary" href="#how">How to apply</a>
114 </div>
115 </div>
116 </section>
117
118 <section id="jobs" class="section" aria-labelledby="jobs-title">
119 <div class="shell">
120 <div class="section-head">
121 <span class="mark">open roles</span>
122 <h2 id="jobs-title">Find your place <em>on the team.</em></h2>
123 </div>
124 <div class="board-filters" hidden>
125 <div><label for="q">Search jobs</label><input type="search" id="q" placeholder="Try plumber, nurse, builder or driver" autocomplete="off"></div>
126 <div><label for="where">Where</label><select id="where"><option value="">Everywhere</option>{opts}</select></div>
127 </div>
128 <p id="board-status" class="board-status" role="status" aria-live="polite"></p>
129 <div class="orgs">
130{cards}
131 </div>
132 <p class="board-empty" id="board-empty" hidden>No roles match that yet. Try another word, or apply through <a href="https://freeshift.ai/careers/">Freeshift</a> and tell us what you do. We hire every qualified person.</p>
133 </div>
134 </section>
135
136 <section id="how" class="section band" aria-labelledby="how-title">
137 <div class="shell">
138 <div class="section-head">
139 <span class="mark">how to apply</span>
140 <h2 id="how-title">Tell us everything <em>you know.</em></h2>
141 <p class="lead">No résumé needed. On the team's careers page, write a message that tells us everything you know how to do and what you've worked on recently.</p>
142 </div>
143 <div class="connect">
144 <article><h3>Everything you know</h3><p>A plumber might list the systems they install and repair, their licenses and tools. A technician might list the equipment they know inside and out.</p></article>
145 <article><h3>What you worked on recently</h3><p>Describe your last few jobs or projects: what you did, what went wrong and how you fixed it.</p></article>
146 <article><h3>What you want to do</h3><p>Tell us the work you'd like to do with us, even if it isn't listed here.</p></article>
147 <article><h3>Tech roles</h3><p>Software, hardware and design builders also need a Branchwell profile and their own website. We don't hire for tech roles without both.</p></article>
148 </div>
149 </div>
150 </section>
151
152 <section class="section" aria-labelledby="anywhere-title">
153 <div class="shell">
154 <h2 id="anywhere-title">Want to build, not sure where?</h2>
155 <p class="lead">Apply through Freeshift. You're hired once, and you can pick up work on any of our teams, in any city we serve.</p>
156 <div class="actions">
157 <a class="button" href="https://freeshift.ai/careers/">Apply through Freeshift {ARROW}</a>
158 </div>
159 </div>
160 </section>
161 </main>
162 {FOOTER}
163</body>
164</html>
165'''
166 write("index.html", h)
167
168
169def privacy():
170 h = head("Privacy · Jobley", "What Jobley keeps.") + f'''
171<body>
172 <a class="skip" href="#main">Skip to content</a>
173 {HEADER}
174 <main id="main" class="shell page-head">
175 <h1>Privacy</h1>
176 <div class="prose">
177 <p>Jobley is a list of jobs. It has no accounts and no forms, and it doesn't collect anything about you.</p>
178 <p>When you apply, you apply on that team's own careers page, and that site's privacy page explains what it keeps.</p>
179 <p>A small visitor counter counts visits. It stores no names, emails or addresses.</p>
180 </div>
181 </main>
182 {FOOTER}
183</body>
184</html>
185'''
186 write("privacy/index.html", h)
187
188
189def notfound():
190 h = head("Not found · Jobley", "That page isn't here.") + f'''
191<body>
192 <a class="skip" href="#main">Skip to content</a>
193 {HEADER}
194 <main id="main" class="shell page-head">
195 <h1>That page isn't here.</h1>
196 <p class="lead">Every open job is on the <a href="/#jobs">home page</a>.</p>
197 </main>
198 {FOOTER}
199</body>
200</html>
201'''
202 write("404.html", h)
203
204
205def reshell(rel):
206 path = os.path.join(ROOT, rel)
207 if not os.path.exists(path):
208 return
209 t = open(path).read()
210 t = re.sub(r'<header class="site-header">.*?</header>', HEADER, t, count=1, flags=re.S)
211 t = re.sub(r'<footer>.*?</footer>', FOOTER, t, count=1, flags=re.S)
212 if "board.css" not in t:
213 t = t.replace('</head>', f' <link rel="stylesheet" href="/assets/board.css?v={V}">\n</head>', 1)
214 write(rel, t)
215
216
217index(); privacy(); notfound(); reshell("research/index.html")
218write("robots.txt", "User-agent: *\nAllow: /\n")
219print("ok jobley board:", TOTAL, "roles on", len(JOBS), "teams")