feat: homepage categories

This commit is contained in:
Lewis Wynne 2026-01-23 01:59:08 +00:00
parent b0d8cb009e
commit 61ec65806b
3 changed files with 15 additions and 4 deletions

View file

@ -1,6 +1,6 @@
--- ---
title: Hello World title: Hello World
date: 2025-01-01 date: 2026-01-01
--- ---
This is my first blog post. :right[A sidenote appears here on wide screens.] This is my first blog post. :right[A sidenote appears here on wide screens.]

View file

@ -60,8 +60,15 @@ function extractDomain(url: string): string {
<html> <html>
<head><meta charset="UTF-8"><title>Blog</title></head> <head><meta charset="UTF-8"><title>Blog</title></head>
<body> <body>
<pre set:html={sorted.map(post => `${formatDate(post.data.date)} <a href="/${post.id}">${post.data.title}</a>`).join('\n')} /> <pre set:html={[
<pre set:html={bookmarks.map(b => `${formatBookmarkDate(b.date)} <a href="${b.url}">${b.title}</a> (${extractDomain(b.url)})`).join('\n')} /> 'blog',
<pre set:html={txtFiles.map(f => `${formatDate(f.mtime)} <a href="/txt/${f.name}">${f.name}</a>`).join('\n')} /> ...sorted.map(post => `<span class="muted">${formatDate(post.data.date)}</span> <a href="/${post.id}">${post.data.title}</a>`),
'',
'txt',
...txtFiles.map(f => `<span class="muted">${formatDate(f.mtime)}</span> <a href="/txt/${f.name}">${f.name}</a>`),
'',
'bookmarks',
...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')} />
</body> </body>
</html> </html>

View file

@ -4,6 +4,10 @@ body {
padding: 1rem; padding: 1rem;
} }
.muted {
color: #888;
}
.left, .right { .left, .right {
display: block; display: block;
font-size: 0.9rem; font-size: 0.9rem;