Skip to content

Commit a29aa34

Browse files
feat(site): templates are programs the search finds, and the home shelf lists artifacts
1 parent 3827d2e commit a29aa34

15 files changed

Lines changed: 78 additions & 42 deletions

File tree

‎site/src/components/footer.astro‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Mark from '../assets/mark.svg'
44
type Link = [label: string, href: string, blank?: boolean]
55
66
const columns: { title: string; links: Link[] }[] = [
7-
{ title: 'Registry', links: [['Packages', '/']] },
7+
{ title: 'Registry', links: [['Artifacts', '/']] },
88
{ title: 'Docs', links: [['Introduction', '/docs/getting-started/introduction'], ['Modules', '/docs/reference/modules'], ['Publishing', '/docs/registry/publishing'], ['HTTP API', '/docs/registry/api']] },
99
{ title: 'Edge Python', links: [['Twitter', 'https://x.com/chavezsutton', true], ['GitHub', 'https://github.com/dylan-sutton-chavez/edge-python', true], ['Standard library', 'https://github.com/dylan-sutton-chavez/edge-python-std', true]] }
1010
]

‎site/src/components/search-bar.astro‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const { class: className } = Astro.props
66
// What the product holds, shown before a query so somebody who does not know the words can still find the door.
77
const doors = [
88
{ label: 'Docs', detail: 'The language, the CLI, the ABI', href: '/docs' },
9-
{ label: 'Packages', detail: 'Everything published', href: '/' },
9+
{ label: 'Artifacts', detail: 'Everything published', href: '/' },
1010
{ label: 'Runs', detail: 'Executions, programs, snapshots', href: '/runs' },
1111
{ label: 'Plans', detail: 'What each one covers', href: '/plans' }
1212
]
@@ -185,6 +185,7 @@ const label = 'px-4 pb-1 pt-2 text-2xs text-fg-subtle'
185185
doors.hidden = true
186186

187187
draw('Packages', found.packages ?? [])
188+
draw('Programs', found.programs ?? [])
188189
draw('People', found.people ?? [])
189190
draw('Docs', found.docs ?? [])
190191

‎site/src/components/settings/storage.astro‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const ask = `mailto:c.sutton.dylan@gmail.com?subject=${encodeURIComponent(subjec
2626
<div class="flex flex-col gap-6">
2727
<div>
2828
<h2 class="text-md">Storage</h2>
29-
<p class="text-fg-hint mt-0.5">The room your packages and templates take, and what is left of it.</p>
29+
<p class="text-fg-hint mt-0.5">The room your packages and programs take, and what is left of it.</p>
3030
</div>
3131

3232
<section class="flex flex-col gap-2">
@@ -78,9 +78,9 @@ const ask = `mailto:c.sutton.dylan@gmail.com?subject=${encodeURIComponent(subjec
7878
)}
7979
</section>
8080

81-
{/* Stands in until a package can publish itself as a template. */}
81+
{/* Stands in until a package can publish itself as a program. */}
8282
<section class="flex flex-col gap-2">
83-
<h3 class="ml-4">Templates</h3>
83+
<h3 class="ml-4">Programs</h3>
8484
<p class="ml-4 text-fg-hint">Nothing published yet.</p>
8585
</section>
8686
</div>

‎site/src/components/settings/tokens.astro‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ edge publish app.edge</pre>
110110
<code data-secret class="min-w-0 flex-1 truncate font-mono text-xs"></code>
111111

112112
<button type="button" data-copy class="shrink-0 flex items-center gap-1.5 text-2xs text-fg-hint transition hover:text-fg-muted">
113-
<Icon name="file" size="2xs" /><span data-copy-label>Copy</span>
113+
<Icon name="file" size="2xs" class="stroke-2" /><span data-copy-label>Copy</span>
114114
</button>
115115
</div>
116116
</Dialog>

‎site/src/components/settings/upkeep.astro‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const note = 'ml-4 text-2xs text-fg-hint'
2727
<div class="flex flex-col gap-6">
2828
<div>
2929
<h2 class="text-md">Upkeep</h2>
30-
<p class="text-fg-hint mt-0.5">What a package or template earns while people use it and you maintain it. Publishing is not upkeep, and a bot is not a person.</p>
30+
<p class="text-fg-hint mt-0.5">What a package or program earns while people use it and you maintain it. Publishing is not upkeep, and a bot is not a person.</p>
3131
</div>
3232

3333
<section class="flex flex-col gap-2">
@@ -60,7 +60,7 @@ const note = 'ml-4 text-2xs text-fg-hint'
6060
</ul>
6161
</div>
6262

63-
<p class={note}>A package or template stops earning when it stops being used, or when it stops being maintained.</p>
63+
<p class={note}>A package or program stops earning when it stops being used, or when it stops being maintained.</p>
6464
</section>
6565

6666
<section class="flex flex-col gap-2">

‎site/src/components/ui/icon.astro‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ const ICONS = {
2727
round: true,
2828
body: `<path d="m21 21-4.34-4.34"/><circle cx="11" cy="11" r="8"/>`
2929
},
30+
fork: {
31+
width: 2,
32+
round: true,
33+
body: `<circle cx="12" cy="18" r="3"/><circle cx="6" cy="6" r="3"/><circle cx="18" cy="6" r="3"/><path d="M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9"/><path d="M12 12v3"/>`
34+
},
3035
close: {
3136
width: 1.5,
3237
round: true,

‎site/src/data/programs.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { OWNER } from '../lib/account/handle'
2+
3+
// Newest first, each one a page of its own under /programs.
4+
export type Program = { slug: string; name: string; description: string; author: string }
5+
6+
export const programs: Program[] = [
7+
{ slug: 'rails-cracker', name: 'Rails cracker', description: 'Paste any git repo and follow its code graph to every vulnerability it can reach.', author: OWNER }
8+
]

‎site/src/data/templates.ts‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

‎site/src/draft.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { MiddlewareNext } from 'astro'
22
import { env } from 'cloudflare:workers'
33

44
/* Everything still being built, named by the address that already reaches it. A path is a page of its own and a fragment is a surface inside one, which is the name a deep link already uses. */
5-
const DRAFT = ['/plans', '/runs', '/templates', '/#templates', '/settings#billing', '/settings#invoices', '/settings#upkeep']
5+
const DRAFT = ['/plans', '/runs', '/programs', '/#programs', '/settings#billing', '/settings#invoices', '/settings#upkeep']
66

77
// What a surface renders with, so a group, its tab, its icon and its panel all answer to one name.
88
const HOOKS = ['data-group', 'data-panel', 'data-view', 'data-bar-icon']
@@ -31,6 +31,9 @@ function stripped(response: Response) {
3131
return rewriter.transform(response)
3232
}
3333

34+
/* Whether this deploy answers a path as missing, so a json answer can leave it out as well. */
35+
export const hidden = (path: string) => !env.DRAFT && isPage(path)
36+
3437
/* Answers a draft page as a 404 and takes every draft surface out of the pages that stay. The binding is read per request, because bindings are not populated while a module is still loading. */
3538
export async function drafted(url: URL, next: MiddlewareNext) {
3639
if (env.DRAFT) return next()

0 commit comments

Comments
 (0)