| author | |
| committer | |
| log | 717f2e02ea1b9f3fe6f53c03100e0a883f688f0e |
| tree | b98cdd69621864baa4e8224c009225b9d521e71c |
| parent | 761f4ae9ab036134de370f1c15c2f03f526fdecf |
| signature | Commit is signed but in an unrecognized format. |
- https://paperclover.net/q+a/2510091718
- font on questions page wasn't loading
- random questions page tweaks5 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[]) { |
| 24 | 24 | (x) => x[0], |
| 25 | 25 | ); |
| 26 | 26 | 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) => { | |
| 28 | 30 | const lower = x[0].toLowerCase(); |
| 29 | 31 | const k = lower === "wght" || lower === "slnt" ? lower : x[0]; |
| 30 | 32 | const v = Array.isArray(x[1]) ? x[1].join(":") : x[1]; |
| 31 | 33 | return `${k}=${v}`; |
| 32 | }).sort(); | |
| 34 | }); | |
| 33 | 35 | } |
| 34 | 36 | |
| 35 | 37 | function getHash(input: string, args: string[]) { |
| ... | ... | @@ -75,7 +77,7 @@ export async function buildFonts(p: progress.Ref, fonts: sg.Font[]) { |
| 75 | 77 | .toLowerCase(); |
| 76 | 78 | const woff = path.join(temp, hash + ".woff2"); |
| 77 | 79 | if (!fs.existsSync(woff)) { |
| 78 | using _ = node.start(hash); | |
| 80 | using _ = node.start(args.join(" ")); | |
| 79 | 81 | let file = baseFile; |
| 80 | 82 | if (subset.vars) { |
| 81 | 83 | file = await makeInstance(baseFile, subset.vars); |
src/pages/index.marko+1-1| ... | ... | @@ -15,7 +15,7 @@ export const meta = { |
| 15 | 15 | <div> |
| 16 | 16 | <h2>posts</h2> |
| 17 | 17 | <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> | |
| 19 | 19 | <h2>things</h2> |
| 20 | 20 | <p><a href="/q+a">questions and answers</a></p> |
| 21 | 21 | <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 }) { |
| 16 | 16 | |
| 17 | 17 | export const theme = { |
| 18 | 18 | fg: "#f0f0f0", |
| 19 | bg: "#1a1a1a", | |
| 19 | bg: "#1a1b1c", | |
| 20 | 20 | primary: "#f5a9b8", |
| 21 | 21 | }; |
| 22 | 22 |
src/q+a/questions.css+4-6| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | @font-face { |
| 2 | 2 | font-family: "recu"; |
| 3 | 3 | src: url("/recqa.woff2") format("woff2"); |
| 4 | font-weight: 400 1000; | |
| 4 | font-weight: 400 800; | |
| 5 | 5 | font-style: normal; |
| 6 | 6 | font-display: swap; |
| 7 | 7 | font-variation-settings: "CASL" 0 1, "MONO" 0 1; |
| ... | ... | @@ -10,7 +10,7 @@ |
| 10 | 10 | } |
| 11 | 11 | @font-face { |
| 12 | 12 | font-family: recu; |
| 13 | src: url("/recqaexotic.woff2") format("woff2"); | |
| 13 | src: url("/recexotic.woff2") format("woff2"); | |
| 14 | 14 | font-weight: 400 800; |
| 15 | 15 | font-style: normal; |
| 16 | 16 | font-display: swap; |
| ... | ... | @@ -32,8 +32,6 @@ |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | .qa { |
| 35 | /* --a: #faa719; */ | |
| 36 | /* --b: #ff3a32; */ | |
| 37 | 35 | --a: #5bcefa; |
| 38 | 36 | --b: #f5a9b8; |
| 39 | 37 | --as: #278bb3; |
| ... | ... | @@ -64,9 +62,9 @@ |
| 64 | 62 | } |
| 65 | 63 | |
| 66 | 64 | q- { |
| 67 | color: white; | |
| 65 | color: #fffff0; | |
| 68 | 66 | --fg: white; |
| 69 | font-weight: 600; | |
| 67 | font-weight: 630; | |
| 70 | 68 | font-size: 1.15em; |
| 71 | 69 | font-variation-settings: "CASL" 0, "MONO" 0; |
| 72 | 70 | } |
src/site.ts+1-6| ... | ... | @@ -53,7 +53,7 @@ const recursiveVarsMono = { ...recursiveVars, MONO: 1 }; |
| 53 | 53 | const recursiveVarsQuestion: sg.FontVars = { |
| 54 | 54 | ...recursiveVars, |
| 55 | 55 | MONO: [0, 1], |
| 56 | WGHT: [400, 1000], | |
| 56 | WGHT: [400, 800], | |
| 57 | 57 | }; |
| 58 | 58 | const layoutFeatures = ["numr", "dnom", "frac"]; |
| 59 | 59 | export const fonts: sg.Font[] = [ |
| ... | ... | @@ -107,12 +107,7 @@ export const fonts: sg.Font[] = [ |
| 107 | 107 | }, |
| 108 | 108 | ]; |
| 109 | 109 | |
| 110 | export async function main() { | |
| 111 | await font.buildFonts(fonts); | |
| 112 | } | |
| 113 | ||
| 114 | 110 | import * as path from "node:path"; |
| 115 | import * as font from "../framework/font.ts"; | |
| 116 | 111 | import type { Template as MetaTemplate } from "lib/render/meta.ts"; |
| 117 | 112 | import type * as sg from "#sitegen"; |
| 118 | 113 | import { nasRoot } from "./file-viewer/paths.ts"; |