authorgravatar for git@paperclover.netclover caruso <git@paperclover.net> 2025-10-10 00:09:52-07:00
committergravatar for git@paperclover.netclover caruso <git@paperclover.net> 2025-10-14 02:40:48-07:00
log717f2e02ea1b9f3fe6f53c03100e0a883f688f0e
treeb98cdd69621864baa4e8224c009225b9d521e71c
parent761f4ae9ab036134de370f1c15c2f03f526fdecf
signature Commit is signed but in an unrecognized format.

chore: fix minor issuse

- https://paperclover.net/q+a/2510091718 - font on questions page wasn't loading - random questions page tweaks

5 files changed, 12 insertions(+), 17 deletions(-)

framework/font.ts+5-3
......@@ -24,12 +24,14 @@ export async function buildFonts(p: progress.Ref, fonts: sg.Font[]) {
2424 (x) => x[0],
2525 );
2626 function getArgs(vars: sg.FontVars) {
27 return Object.entries(vars).map((x) => {
27 return Object.entries(vars).sort((x) =>
28 x[0] === "wght" || x[0] === "slnt" ? 1 : 0
29 ).map((x) => {
2830 const lower = x[0].toLowerCase();
2931 const k = lower === "wght" || lower === "slnt" ? lower : x[0];
3032 const v = Array.isArray(x[1]) ? x[1].join(":") : x[1];
3133 return `${k}=${v}`;
32 }).sort();
34 });
3335 }
3436
3537 function getHash(input: string, args: string[]) {
......@@ -75,7 +77,7 @@ export async function buildFonts(p: progress.Ref, fonts: sg.Font[]) {
7577 .toLowerCase();
7678 const woff = path.join(temp, hash + ".woff2");
7779 if (!fs.existsSync(woff)) {
78 using _ = node.start(hash);
80 using _ = node.start(args.join(" "));
7981 let file = baseFile;
8082 if (subset.vars) {
8183 file = await makeInstance(baseFile, subset.vars);
src/pages/index.marko+1-1
......@@ -15,7 +15,7 @@ export const meta = {
1515 <div>
1616 <h2>posts</h2>
1717 <p>song: <a href="/in-the-summer">in the summer</a> (2025-01-01)</p>
18 <p>song: <a href="/waterfalls">waterfalls</a> (2025-01-01)</p>
18 <p>song: <a href="/waterfalls">waterfalls</a> (2025-08-01)</p>
1919 <h2>things</h2>
2020 <p><a href="/q+a">questions and answers</a></p>
2121 <p><a href="/file">file browser</a></p>
src/q+a/layout.tsx+1-1
......@@ -16,7 +16,7 @@ export default function QuestionLayout({ children }: { children: any }) {
1616
1717export const theme = {
1818 fg: "#f0f0f0",
19 bg: "#1a1a1a",
19 bg: "#1a1b1c",
2020 primary: "#f5a9b8",
2121};
2222
src/q+a/questions.css+4-6
......@@ -1,7 +1,7 @@
11@font-face {
22 font-family: "recu";
33 src: url("/recqa.woff2") format("woff2");
4 font-weight: 400 1000;
4 font-weight: 400 800;
55 font-style: normal;
66 font-display: swap;
77 font-variation-settings: "CASL" 0 1, "MONO" 0 1;
......@@ -10,7 +10,7 @@
1010}
1111@font-face {
1212 font-family: recu;
13 src: url("/recqaexotic.woff2") format("woff2");
13 src: url("/recexotic.woff2") format("woff2");
1414 font-weight: 400 800;
1515 font-style: normal;
1616 font-display: swap;
......@@ -32,8 +32,6 @@
3232}
3333
3434.qa {
35 /* --a: #faa719; */
36 /* --b: #ff3a32; */
3735 --a: #5bcefa;
3836 --b: #f5a9b8;
3937 --as: #278bb3;
......@@ -64,9 +62,9 @@
6462 }
6563
6664 q- {
67 color: white;
65 color: #fffff0;
6866 --fg: white;
69 font-weight: 600;
67 font-weight: 630;
7068 font-size: 1.15em;
7169 font-variation-settings: "CASL" 0, "MONO" 0;
7270 }
src/site.ts+1-6
......@@ -53,7 +53,7 @@ const recursiveVarsMono = { ...recursiveVars, MONO: 1 };
5353const recursiveVarsQuestion: sg.FontVars = {
5454 ...recursiveVars,
5555 MONO: [0, 1],
56 WGHT: [400, 1000],
56 WGHT: [400, 800],
5757};
5858const layoutFeatures = ["numr", "dnom", "frac"];
5959export const fonts: sg.Font[] = [
......@@ -107,12 +107,7 @@ export const fonts: sg.Font[] = [
107107 },
108108];
109109
110export async function main() {
111 await font.buildFonts(fonts);
112}
113
114110import * as path from "node:path";
115import * as font from "../framework/font.ts";
116111import type { Template as MetaTemplate } from "lib/render/meta.ts";
117112import type * as sg from "#sitegen";
118113import { nasRoot } from "./file-viewer/paths.ts";