17 description?: string | null;
18 readme?: string;
19 imageUrl?: string | null;
20 links: {
21 self: string;
19 date: string;
20 doc: string;
21 image: string;
22 tags: string;
23 title: string;
81 sequences: item.sequences,
82 date: item.date,
83 image: item.image,
84 backlinks: item.backlinks,
85 category: extractPostCategory(item),
130 (page.sequences?.length > 0 ? `- sequences: ${page.sequences.map(seq => `[Sequence ${seq.id} on ${seq.topic}](${SITE_URL}/sequences#${seq.id})`).join(", ")}` : null),
131 (page.book ? `- book_id: ${page.book}` : null),
132 (page.image ? `- image: ${page.image}` : null),
133 (page.score ? `- relevance: ${page.score.toFixed(3)}` : null),
134 ].filter((a) => a !== null).join("\n");
101## Val Town Platform Specifics
102- **Redirects:** Use `return new Response(null, { status: 302, headers: { Location: "/place/to/redirect" }})` instead of `Response.redirect` which is broken
103- **Images:** Avoid external images or base64 images. Use emojis, unicode symbols, or icon fonts/libraries instead
104- For AI-generated images, use: `https://maxm-imggenurl.web.val.run/the-description-of-your-image`
105- **Storage:** DO NOT use the Deno KV module for storage
106- **Browser APIs:** DO NOT use the `alert()`, `prompt()`, or `confirm()` methods
169
170- **Redirects:** Use `return new Response(null, { status: 302, headers: { Location: "/place/to/redirect" }})` instead of `Response.redirect` which is broken
171- **Images:** Avoid external images or base64 images. Use emojis, unicode symbols, or icon fonts/libraries instead
172- **AI Image:** To inline generate an AI image use: `<img src="https://maxm-imggenurl.web.val.run/the-description-of-your-image" />`
173- **Storage:** DO NOT use the Deno KV module for storage
174- **Browser APIs:** DO NOT use the `alert()`, `prompt()`, or `confirm()` methods
18 * Response.redirect is broken. Use `return new Response(null, { status: 302, headers: { Location: "/place/to/redirect" }})`
19
20 * Avoid external images or base64 images, use emojis, unicode symtols, or icon fonts/libraries instead, unless that's not practical for the user's request (e.g. if they ask for a particular animated gif).
21
22 * If you want an AI generated image, use https://maxm-imggenurl.web.val.run/the-description-of-your-image to dynamically generate one.
23
24 * DO NOT use the Deno KV module for storage.
33// These are critical requirements for Val Town
34* Response.redirect is broken. Use return new Response(null, { status: 302, headers: { Location: "/place/to/redirect" }})
35* Avoid external images or base64 images when possible
36* For AI-generated images, use: https://maxm-imggenurl.web.val.run/[description]
37* DO NOT use Deno KV module, alert(), prompt(), or confirm() methods
38* For weather data, use open-meteo (no API key required)
124 description: z.string().max(64).optional()
125 .describe("Description for the project (optional, max 64 characters)"),
126 imageUrl: z.string().optional().describe("URL to an image for the project (optional)"),
127 },
128 async ({name, privacy, description, imageUrl}: {
129 name: string
130 privacy: "public" | "unlisted" | "private"
131 description?: string
132 imageUrl?: string
133 }) => {
134 try {
159 privacy,
160 ...(description ? {description} : {}),
161 ...(imageUrl ? {imageUrl} : {}),
162 }
163
178
179- **Redirects:** Use `return new Response(null, { status: 302, headers: { Location: "/place/to/redirect" }})` instead of `Response.redirect` which is broken
180- **Images:** Avoid external images or base64 images. Use emojis, unicode symbols, or icon fonts/libraries instead
181- **AI Image:** To inline generate an AI image use: `<img src="https://maxm-imggenurl.web.val.run/the-description-of-your-image" />`
182- **Storage:** DO NOT use the Deno KV module for storage
183- **Browser APIs:** DO NOT use the `alert()`, `prompt()`, or `confirm()` methods
178
179- **Redirects:** Use `return new Response(null, { status: 302, headers: { Location: "/place/to/redirect" }})` instead of `Response.redirect` which is broken
180- **Images:** Avoid external images or base64 images. Use emojis, unicode symbols, or icon fonts/libraries instead
181- **AI Image:** To inline generate an AI image use: `<img src="https://maxm-imggenurl.web.val.run/the-description-of-your-image" />`
182- **Storage:** DO NOT use the Deno KV module for storage
183- **Browser APIs:** DO NOT use the `alert()`, `prompt()`, or `confirm()` methods
6 <title>React Hono Val Town Starter</title>
7 <link rel="stylesheet" href="/frontend/style.css">
8 <link rel="icon" href="/frontend/favicon.svg" type="image/svg+xml">
9 </head>
10 <body>