My personal website!
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Appending uri to struct

Koehn 0a19cc84 c733d264

+9 -3
+6 -1
src/components.ts
··· 38 38 `; 39 39 } 40 40 41 - export function createHead(options?: { title?: string; stylesheet?: string }) { 41 + export function createHead(options?: { 42 + title?: string; 43 + stylesheet?: string; 44 + extras: string[]; 45 + }) { 42 46 const stylesheet = options?.stylesheet || "index"; 43 47 const title = options?.title || "From, Koehn."; 44 48 ··· 53 57 <link rel="alternate" type="application/atom+xml" title="From, Koehn" href="/feed.xml"> 54 58 <link rel="human-json" href="/.well-known/human.json"> 55 59 <link rel="icon" type="image/x-icon" href="/public/favicon.ico"> 60 + ${options?.extras ? options.extras.join("\n") : ""} 56 61 </head> 57 62 `; 58 63 }
+1 -1
src/routes/post.ts
··· 47 47 const body = ` 48 48 <!DOCTYPE html> 49 49 <html lang="en-US"> 50 - ${createHead()} 50 + ${createHead({ extras: [`<link rel="site.standard.document" href="${post.uri}">`] })} 51 51 <body> 52 52 <div class="labels"><div class="label">koehn</div><div class="label">blog</div></div> 53 53 <article>
+1 -1
src/utils/posts.ts
··· 29 29 const data = protocolResponse.parse(await records.json()); 30 30 31 31 const posts = data.records.map((r) => { 32 - return standardDocument.parse(r.value); 32 + return standardDocument.parse({ uri: r.uri, ...(r.value as object) }); 33 33 }); 34 34 35 35 cache.data = posts;
+1
src/utils/structs.ts
··· 18 18 19 19 export const standardDocument = z.object({ 20 20 $type: z.literal("site.standard.document"), 21 + uri: z.string(), 21 22 site: z.string().min(1), 22 23 title: z.string(), 23 24 description: z.string().optional(),