1const join = (...paths: string[]) => path.join(import.meta.dirname, ...paths);
2
3// Different sections of the website are split into their own folders. Acting as
4// as separate codebases, they are hosted as one. This allows me to have
5// sub-projects like the file viewer in 'file/', and the question answer system
6// in 'q+a', but maintain clear boundaries. Each section can define
7// configuration, pages, backend routes, and contain other files.
8export const siteSections: sg.Section[] = [
9 { root: join(".") },
10 { root: join("q+a/") },
11 { root: join("file-viewer/") },
12 { root: join("friends/"), base: "/friends" },
13 { root: join("blog/"), base: "/blog" },
14 // { root: join("fiction/"), pageBase: "/fiction" },
15];
16
17export const meta = {
18 base: "https://paperclover.net",
19 generator: "clover sitegen 3; https://git.paperclover.net/clo/sitegen",
20};
21
22// Font subsets reduce bandwidth and protect against proprietary font theft.
23const fontRoot = path.join(nasRoot, "Documents/Font");
24const ascii = { start: 0x20, end: 0x7E };
25const nonAscii: sg.FontRange[] = [
26 { start: 0xC0, end: 0xFF },
27 { start: 0x2190, end: 0x2193 },
28 { start: 0xA0, end: 0xA8 },
29 { start: 0xAA, end: 0xBF },
30 { start: 0x2194, end: 0x2199 },
31 { start: 0x100, end: 0x17F },
32 0xA9,
33 0x2018,
34 0x2019,
35 0x201C,
36 0x201D,
37 0x2022,
38];
39const recursiveVars: sg.FontVars = {
40 WGHT: [400, 750],
41 SLNT: [-15, 0],
42 CASL: 0.25,
43 CRSV: 0.5,
44 MONO: 0,
45};
46const recursiveVarsMono = { ...recursiveVars, MONO: 1 };
47const recursiveVarsQuestion: sg.FontVars = {
48 ...recursiveVars,
49 MONO: [0, 1],
50 WGHT: [400, 800],
51};
52const recursiveVarsThin: sg.FontVars = {
53 ...recursiveVars,
54 MONO: [0, 1],
55 WGHT: 350,
56};
57const layoutFeatures = ["numr", "dnom", "frac"];
58export const fonts: sg.Font[] = [
59 {
60 name: "Recursive",
61 sources: [
62 "Recursive_VF_1.085.ttf",
63 path.join(fontRoot, "/ArrowType/Recursive/Recursive_VF_1.085.ttf"),
64 "https://paperclover.net/file/_unlisted/Recursive_VF_1.085.ttf",
65 ],
66 subsets: [
67 {
68 asset: "/recultramin.[ext]",
69 layoutFeatures,
70 vars: recursiveVars,
71 unicodes: ascii,
72 },
73 {
74 asset: "/recmono.[ext]",
75 vars: recursiveVarsMono,
76 unicodes: ascii,
77 },
78 {
79 asset: "/recqa.[ext]",
80 vars: recursiveVarsQuestion,
81 unicodes: ascii,
82 },
83 {
84 asset: "/recexotic.[ext]",
85 vars: recursiveVarsQuestion,
86 unicodes: nonAscii,
87 },
88 {
89 asset: "/recthin.[ext]",
90 vars: recursiveVarsThin,
91 unicodes: ascii,
92 },
93 {
94 asset: "/recthin2.[ext]",
95 vars: recursiveVarsThin,
96 unicodes: nonAscii,
97 },
98 ],
99 },
100 {
101 name: "AT Name Sans Display Hairline",
102 sources: [
103 "ATNameSansDisplay-Hairline.woff2",
104 path.join(
105 fontRoot,
106 "/ArrowType/AT Name Sans Display/ATNameSansDisplay-Hairline.woff2",
107 ),
108 ],
109 subsets: [
110 {
111 asset: "/cydn_header.[ext]",
112 layoutFeatures,
113 unicodes: "cotlyedon",
114 },
115 ],
116 },
117];
118
119import type * as sg from "#sitegen";
120import type { Template as MetaTemplate } from "@clo/lib/meta";
121import * as path from "node:path";
122import { nasRoot } from "./file-viewer/paths.ts";