Skip to content

Commit

Permalink
Embed Pico CSS
Browse files Browse the repository at this point in the history
Fix #61
  • Loading branch information
dahlia committed Nov 7, 2024
1 parent 2438993 commit 7806ca4
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 23 deletions.
3 changes: 2 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"docs/.astro/",
"docs/dist/",
"docs/node_modules/",
"drizzle/"
"drizzle/",
"src/public/"
]
},
"formatter": {
Expand Down
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"es-toolkit": "^1.25.2",
"fluent-ffmpeg": "^2.1.3",
"flydrive": "^1.1.0",
"hono": "^4.3.4",
"hono": "^4.6.9",
"iso-639-1": "^3.1.2",
"markdown-it": "^14.1.0",
"markdown-it-replace-link": "^1.2.1",
Expand Down
2 changes: 1 addition & 1 deletion src/components/AccountForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import iso6391 from "iso-639-1";
import type { PostVisibility } from "../schema";

export interface AccountFormProps {
method?: string;
method?: "get" | "post" | "dialog";
action: string;
readOnly?: {
username?: boolean;
Expand Down
13 changes: 6 additions & 7 deletions src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@ export function Layout(props: PropsWithChildren<LayoutProps>) {
type={link.type}
/>
))}
<link rel="stylesheet" href="/public/pico.min.css" />
<link rel="stylesheet" href="/public/pico.colors.min.css" />
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css"
rel="icon"
type="image/png"
sizes="500x500"
href="/public/favicon.png"
/>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.colors.min.css"
/>
<link rel="icon" type="image/png" sizes="500x500" href="/favicon.png" />
</head>
<body>
<main className="container">{props.children}</main>
Expand Down
2 changes: 1 addition & 1 deletion src/components/LoginForm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface LoginFormProps {
method?: string;
method?: "get" | "post" | "dialog";
action: string;
next?: string;
values?: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/OtpForm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface OtpFormProps {
method?: string;
method?: "get" | "post" | "dialog";
action: string;
next?: string;
errors?: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/SetupForm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface SetupFormProps {
method?: string;
method?: "get" | "post" | "dialog";
action: string;
values?: {
email?: string;
Expand Down
19 changes: 9 additions & 10 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ if (DRIVE_DISK === "fs") {
);
}

app.use(
"/public/*",
serveStatic({
root: join(import.meta.dirname, "public"),
rewriteRequestPath: (path) => path.substring("/public".length),
onNotFound: (path) => console.debug({ path }),
}),
);

app.use(federation(fedi, (_) => undefined));
app.route("/", pages);
app.route("/oauth", oauth);
Expand All @@ -31,16 +40,6 @@ app.route("/api", api);
app.route("/image", image);
app.get("/nodeinfo/2.0", (c) => c.redirect("/nodeinfo/2.1"));

app.get("/favicon.png", async (c) => {
const file = Bun.file(join(import.meta.dirname, "public", "favicon.png"));
return c.body(await file.arrayBuffer(), {
headers: {
"Content-Type": "image/png",
"Cache-Control": "public, max-age=31536000",
},
});
});

// biome-ignore lint/complexity/useLiteralKeys: tsc complains about this (TS4111)
const BEHIND_PROXY = process.env["BEHIND_PROXY"] === "true";

Expand Down
4 changes: 4 additions & 0 deletions src/public/pico.colors.min.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/public/pico.min.css

Large diffs are not rendered by default.

0 comments on commit 7806ca4

Please sign in to comment.