1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import { api } from "https://esm.town/v/pomdtr/api";
import { parseExample } from "https://esm.town/v/pomdtr/val_town_by_example_parse";
import { blob } from "https://esm.town/v/std/blob";
import { ValTownBlobNotFoundError } from "https://esm.town/v/std/ValTownBlobNotFoundError";
type Dataset = {
title: string;
items: DatasetItem[];
}[];
type DatasetItem = string | {
title: string;
description?: string;
href?: string;
};
function todo(title: string) {
return {
title: `${title}`,
};
}
// edit this if you want to add new items to the home page
const dataset: Dataset = [
{
title: "Basics",
items: [
todo("Sharing Code Between Vals"),
"pomdtr/reading_and_writing_blobs",
todo("Storing Secrets in Env Variables"),
todo("Sending Emails"),
],
},
{
title: "SQLite",
items: [
todo("Creating and Deleting Tables"),
todo("Inserting and Querying Data"),
todo("Running Migrations"),
todo("SQLite as a KV Database"),
todo("Drizzle in Val Town"),
],
},
{
title: "Middlewares",
items: [
"pomdtr/password_auth_example",
todo("Email Authentication"),
todo("Code on Val Town Banner"),
],
},
{
title: "HTTP",
items: [
todo("Routing request with Hono"),
todo("Saving HTML Form Data"),
"iamseeley/multirouteHTML",
todo("Rendering JSX"),
todo("Rendering Markdown"),
todo("Creating a Discord Webhook"),
todo("Scrapping Website Data"),
],
},
{
title: "Client-Side",
items: [
"pomdtr/react_example",
todo("Val Town Islands"),
todo("Creating Web Component"),
todo("Embedding Vals in Other Sites"),
],
},
{
title: "Tooling",
items: [
todo("Running Tests on Val.Town"),
todo("Installing Apps on Val Town"),
todo("Querying all Public Vals"),
],
},
];
export type TocItem = {
title: string;
description: string;
href?: string;
};
export type TocGroup = {
title: string;
items: TocItem[];
};
export type Toc = TocGroup[];
const blobKey = "val_town_by_example_toc.json";
export default async function refreshToc() {
const toc: Toc = [];
for (const item of dataset) {
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
June 24, 2024