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