feat: summaries

This commit is contained in:
Lewis Wynne 2026-01-23 03:19:04 +00:00
parent f04b56a2f1
commit b5e9d33cdf
2 changed files with 36 additions and 12 deletions

View file

@ -60,17 +60,23 @@ function extractDomain(url: string): string {
<html> <html>
<head><meta charset="UTF-8"><title>lewis m.w.</title></head> <head><meta charset="UTF-8"><title>lewis m.w.</title></head>
<body> <body>
<pre set:html={[ <header>
'lewis m.w. <a href="mailto:lewis@wynne.rs">mail</a> <a href="https://github.com/llywelwyn">gh</a>', <pre>lewis m.w. <a href="mailto:lewis@wynne.rs">mail</a> <a href="https://github.com/llywelwyn">gh</a></pre>
'', </header>
'blog',
...sorted.map(post => `<span class="muted">${formatDate(post.data.date)}</span> <a href="/posts/${post.id}">${post.data.title}</a>`), <details open>
'', <summary>blog</summary>
'txt', <pre set:html={sorted.map(post => `<span class="muted">${formatDate(post.data.date)}</span> <a href="/posts/${post.id}">${post.data.title}</a>`).join('\n')} />
...txtFiles.map(f => `<span class="muted">${formatDate(f.mtime)}</span> <a href="/txt/${f.name}">${f.name}</a>`), </details>
'',
'bookmarks', <details open>
...bookmarks.map(b => `<span class="muted">${formatBookmarkDate(b.date)}</span> <a href="${b.url}">${b.title}</a> <span class="muted">(${extractDomain(b.url)})</span>`) <summary>txt</summary>
].join('\n')} /> <pre set:html={txtFiles.map(f => `<span class="muted">${formatDate(f.mtime)}</span> <a href="/txt/${f.name}">${f.name}</a>`).join('\n')} />
</details>
<details open>
<summary>bookmarks</summary>
<pre set:html={bookmarks.map(b => `<span class="muted">${formatBookmarkDate(b.date)}</span> <a href="${b.url}">${b.title}</a> <span class="muted">(${extractDomain(b.url)})</span>`).join('\n')} />
</details>
</body> </body>
</html> </html>

View file

@ -28,3 +28,21 @@ body {
margin-right: -12rem; margin-right: -12rem;
} }
} }
details {
margin: 1rem 0;
}
summary {
cursor: pointer;
font-family: monospace;
list-style: none;
}
summary::-webkit-details-marker {
display: none;
}
details pre {
margin: 0;
}