From c7ff451dfa7c20ba6d9b616eabf57d73eddf813e Mon Sep 17 00:00:00 2001
From: clover caruso
Date: Fri, 27 Mar 2026 01:18:43 -0700
Subject: [PATCH] fix: make homepage and file viewer work better on w3m
resolves #92
---
src/file-viewer/backend.tsx | 3 ++-
src/file-viewer/views/lofi.css | 1 -
src/file-viewer/views/lofi.marko | 31 ++++++++++++++---------------
src/pages/index.css | 17 ++++++++++++++++
src/pages/index.marko | 34 +++++++++++++++++++-------------
src/q+a/tags/question.marko | 2 +-
6 files changed, 55 insertions(+), 33 deletions(-)
diff --git a/src/file-viewer/backend.tsx b/src/file-viewer/backend.tsx
index 5a39a7ebe9f32845e099eb8799f648fdd707b840..cb84e7d1109156182990b797a24385fcb4d7ace6 100644
--- a/src/file-viewer/backend.tsx
+++ b/src/file-viewer/backend.tsx
@@ -11,7 +11,7 @@ app.post("/file/cotyledon", async (c) => {
app.get("/file/*", async (c, next) => {
const ua = c.req.header("User-Agent")?.toLowerCase() ?? "";
- const lofi = ua.includes("msie") || false;
+ const lofi = ua.includes("msie") || ua.startsWith('w3m/') || false;
let rawFilePath = c.req.path.slice(5) || "/";
@@ -19,6 +19,7 @@ app.get("/file/*", async (c, next) => {
if (
!rawFilePath.endsWith("thumbnail.jpeg") && (
(!ua.startsWith("mozilla/") &&
+ !ua.startsWith("w3m/") &&
// these two are for AirPlay
!ua.includes("airplay") &&
!ua.includes("applecoremedia")) ||
diff --git a/src/file-viewer/views/lofi.css b/src/file-viewer/views/lofi.css
index d82b27d10ad30cdd3485ffbc1853b4ed2ccde93c..3837ee0df30b8a1098623321516d35a44bfc94ff 100644
--- a/src/file-viewer/views/lofi.css
+++ b/src/file-viewer/views/lofi.css
@@ -38,6 +38,5 @@ li a:hover {
opacity: 0.5;
}
.meta {
- margin-left: 1em;
opacity: 0.75;
}
diff --git a/src/file-viewer/views/lofi.marko b/src/file-viewer/views/lofi.marko
index 98eb4afa3390f3a051c3194b83e16efe4a7e6dc2..7e33443fc8f19acfae6c013028eecdcf35af2755 100644
--- a/src/file-viewer/views/lofi.marko
+++ b/src/file-viewer/views/lofi.marko
@@ -22,9 +22,8 @@ export { meta, theme } from "./clofi.tsx";
)/>
- ${formatDate(file.date)}>${" "}
- ${file.basenameWithoutExt}${file.extension}>${dir ? '/' : ''}
- (${meta})>>
+ ${formatDate(file.date)}>${" "}${file.basenameWithoutExt}${file.extension}>>/>
+ (${meta})>>
@@ -43,19 +42,19 @@ export { meta, theme } from "./clofi.tsx";
>
>
-
-
-
- would you like to
- dive deeper?
-
- >
+ //
+ //
+ //
+ // would you like to
+ // dive deeper?
+ //
+ // >
>
- [up one...]
diff --git a/src/pages/index.css b/src/pages/index.css
index bd1994a8235c8cc4aa772fa4ad748c2c10339405..7335387e27b45704ed1d6824f5ae7545956ca302 100644
--- a/src/pages/index.css
+++ b/src/pages/index.css
@@ -23,6 +23,23 @@ h2 {
p, h2 {
margin: 0.75rem 0rem;
}
+.section-list {
+ margin: 0.75rem 0;
+ padding: 0;
+ list-style: none;
+}
+.section-list li + li {
+ margin-top: 0.75rem;
+}
+.link-list {
+ margin: 0.75rem 0;
+ padding: 0;
+ list-style: none;
+ display: flex;
+ gap: 1.5rem;
+ position: relative;
+ z-index: 2;
+}
hr {
width: 100%;
border: 1px solid #000b;
diff --git a/src/pages/index.marko b/src/pages/index.marko
index 5a94c0d7e97f8f13940f02cb83542f9226fb68d2..e4d226671de0cbfe6bbdf83baae8da4005166a24 100644
--- a/src/pages/index.marko
+++ b/src/pages/index.marko
@@ -21,22 +21,28 @@ export const meta = {
this site contains my art.
posts
- video collab: history of japan reanimated (2026-02-02)
- blog: One Year with Next.js App Router — why we're moving on (2025-10-21)
- song: in the summer (2025-08-08)
- song: waterfalls (2025-01-01)
+
things
- questions and answers
- recent activity
- file browser
- code forge
- mailing list
+
links
-
+
paper clover
diff --git a/src/q+a/tags/question.marko b/src/q+a/tags/question.marko
index f13103def87b300b801c9db9e5b26f2b313aa0ef..12bf3e22e0bcee7c8fb4fa7aac9545e6337251be 100644
--- a/src/q+a/tags/question.marko
+++ b/src/q+a/tags/question.marko
@@ -26,7 +26,7 @@ export const transitionDate = 1735639200000;
+ >${formatQuestionTimestamp(date)}
$!{markdown.renderMarkdown(question.text)}
--
2.54.0