website-xp-phone 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/blogDirsPlugin.ts +100 -0
- package/package.json +9 -6
- package/public/blog/archive/eighth-post-lost-in-the-sauce.json +36 -0
- package/public/blog/archive/noise/eleventh-post-discussion-java-gist.md +5 -0
- package/public/blog/archive/noise/fifteenth-post-very-rare-windows-funny.md +8 -0
- package/public/blog/archive/noise/fourth-post-meta-blog.md +3 -0
- package/public/blog/archive/noise/sixteenth-post-meta-fantasy-blog.md +4 -0
- package/public/blog/archive/noise/tenth-post-meta-funny-redacted-and-timetravelled.md +3 -0
- package/public/blog/archive/noise/twelfth-post-mixing-phase-technique-audio-music.md +48 -0
- package/public/blog/archive/noise/welcome-back-ramble-meta.md +6 -0
- package/public/blog/archive/noise/welcome-to-my-blog-meta-blog-welcome-to-my-website.md +7 -0
- package/public/blog/archive/seventh-post-lie-theory-na2000.json +22 -0
- package/public/blog/archive/sophus-lie.json +36 -0
- package/public/blog/hlwm_and_herbstutil.md +11 -0
- package/public/blog/writing/hot-action-under-a-cold-moon.json +9 -0
- package/public/checksums.txt +90 -66
- package/public/documents/drift-report.json +13 -1
- package/scripts/refresh-soundcloud.mjs +54 -8
- package/src/content/blog.json +16 -363
- package/src/content/blogDirs.ts +196 -0
- package/src/content/configs.json +1 -1
- package/src/content/contacts.json +2 -2
- package/src/content/includes/make-recipes.md +18 -0
- package/src/content/index.ts +156 -57
- package/src/content/music-ext.json +1 -1
- package/src/content/projects/doftiles.json +88 -4
- package/src/content/projects/herbctl.json +58 -0
- package/src/content/projects/herbstutil.json +50 -20
- package/src/content/projects/on-deploy.json +57 -0
- package/src/content/projects/polyframes.json +83 -0
- package/src/content/schema.ts +7 -4
- package/src/content/sections.json +11 -10
- package/src/content/soundcloud.json +61 -13
- package/src/lib/clippy.ts +29 -8
- package/src/lib/history.ts +152 -0
- package/src/lib/markdown.tsx +11 -1
- package/src/lib/scrollTo.ts +45 -0
- package/src/lib/signals.tsx +271 -0
- package/src/main.tsx +20 -4
- package/src/pages/BlogDirPage.tsx +36 -0
- package/src/pages/BlogPostPage.tsx +76 -3
- package/src/pages/ProjectPage.tsx +9 -3
- package/src/pages/WowPage.tsx +8 -3
- package/src/pages/index.ts +2 -0
- package/src/shell/App.tsx +14 -8
- package/src/shell/Clippy.tsx +13 -3
- package/src/shell/MenuBar.tsx +7 -4
- package/src/shell/resolveRoute.ts +41 -2
- package/src/shell/routerSignals.ts +34 -0
- package/src/styles/extras.css +20 -0
- package/src/styles/layout.css +2 -2
- package/src/styles/menu.css +1 -1
- package/src/styles/window.css +9 -2
- package/src/themes/pageSlide/index.ts +120 -42
- package/src/themes/pageSlide/pageSlide.css +20 -9
- package/src/virtual.d.ts +14 -0
- package/src/window/MaximizedWindow.tsx +97 -64
- package/src/window/OkButton.tsx +42 -25
- package/src/window/PageWindows.tsx +7 -0
- package/src/window/TitleBar.tsx +3 -1
- package/src/window/Window.tsx +132 -87
- package/src/window/closeSounds.ts +27 -0
- package/src/window/model.ts +11 -0
- package/src/window/state.tsx +290 -50
- package/src/window/themes.ts +23 -2
- package/test/content.test.js +15 -10
- package/test/deploy-pipeline.test.js +11 -11
- package/test/markdown-tables.test.js +96 -0
- package/test/soundcloud-refresh.test.js +68 -0
- package/tsconfig.node.tsbuildinfo +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/vite.config.ts +7 -1
- package/public/blog/4th.md +0 -28
- package/public/blog/wsl.1.md +0 -40
- package/src/window/hidden.ts +0 -22
- /package/public/blog/{ → archive/noise/}/321/200/321/203/320/275/320/270/321/201/321/207-/320/263/320/273/320/276/321/201/321/201/320/260/321/200/320/270/320/271.md" +0 -0
- /package/src/content/{characters.json → includes/characters.json} +0 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import generated from "virtual:blog-dirs";
|
|
2
|
+
import type { Section } from "./schema";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Directory listings for the static directories under /blog/ — driven by
|
|
6
|
+
* a BLACKLIST, not a maintained file list.
|
|
7
|
+
*
|
|
8
|
+
* The blog's posts are static files served straight from public/blog/ —
|
|
9
|
+
* markdown (`.md`, fetched and rendered as markdown) or authored Section
|
|
10
|
+
* trees (`.json`, the exact shape the content files use, fetched and
|
|
11
|
+
* mounted as native windows). The router addresses any extension-less
|
|
12
|
+
* /blog/** URL as a post page and resolves the file behind it. That is
|
|
13
|
+
* right for FILES and wrong for DIRECTORIES:
|
|
14
|
+
* /blog/random is a folder on disk, its ".md" fetch resolves to nothing,
|
|
15
|
+
* and the embed renders whatever the server's SPA fallback hands back.
|
|
16
|
+
*
|
|
17
|
+
* Two pieces cooperate:
|
|
18
|
+
*
|
|
19
|
+
* - src/content/blogDirs.json — GENERATED by scripts/refresh-content.mjs
|
|
20
|
+
* (a deterministic walk of public/blog/ on every refresh cycle). It
|
|
21
|
+
* lists every subdirectory and the files each holds. You never edit it;
|
|
22
|
+
* run `npm run refresh:content` after touching public/blog/ and commit
|
|
23
|
+
* the refreshed snapshot.
|
|
24
|
+
*
|
|
25
|
+
* - THIS FILE — the authored policy: which file-name patterns are HIDDEN
|
|
26
|
+
* from every listing (the blacklist), and per-directory overrides. A
|
|
27
|
+
* directory needs no entry at all: it lists automatically, minus the
|
|
28
|
+
* blacklisted files. Add an override only to bend the defaults.
|
|
29
|
+
*/
|
|
30
|
+
export type BlogDirOverride = {
|
|
31
|
+
/** Replaces the default blacklist for this directory. Patterns are
|
|
32
|
+
* globs over the file NAME ("*.png", "draft-*", "notes?.md"); an
|
|
33
|
+
* empty array hides nothing. */
|
|
34
|
+
hide?: string[];
|
|
35
|
+
/** Extensions whose files are POSTS: their listing link drops the
|
|
36
|
+
* extension, so the URL resolves to the post page that embeds the
|
|
37
|
+
* file. Every other shown file links its raw asset. Markdown and
|
|
38
|
+
* .json Section posts both address extension-less — one page per
|
|
39
|
+
* file, whichever form it is authored in. */
|
|
40
|
+
posts?: string[];
|
|
41
|
+
/** The listing window's heading; defaults to the directory's name. */
|
|
42
|
+
heading?: string;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** The default blacklist, applied to EVERY directory listing: binary
|
|
46
|
+
* assets and working files never list. Extend freely — patterns are
|
|
47
|
+
* case-insensitive globs over the file name. */
|
|
48
|
+
export const blogDirDefaults: { hide: string[]; posts: string[] } = {
|
|
49
|
+
hide: [
|
|
50
|
+
"*.png",
|
|
51
|
+
"*.gif",
|
|
52
|
+
"*.jpg",
|
|
53
|
+
"*.jpeg",
|
|
54
|
+
"*.webp",
|
|
55
|
+
"*.svg",
|
|
56
|
+
"*.avif",
|
|
57
|
+
"*.ico",
|
|
58
|
+
"*.mp3",
|
|
59
|
+
"*.mp4",
|
|
60
|
+
"*.ogg",
|
|
61
|
+
"*.wav",
|
|
62
|
+
"*.woff2",
|
|
63
|
+
],
|
|
64
|
+
posts: ["md", "json"],
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/** Per-directory policy. Keyed by the directory's URL path exactly as
|
|
68
|
+
* served (/blog/random). A directory absent here simply takes the
|
|
69
|
+
* defaults; an override of exactly `false` opts the directory OUT of
|
|
70
|
+
* listing entirely — the address stays a plain asset folder (its bare
|
|
71
|
+
* URL answers 404, its files keep their direct URLs). */
|
|
72
|
+
export const blogDirOverrides: Record<string, BlogDirOverride | false> = {
|
|
73
|
+
// The references folder is an asset shelf, not a post collection —
|
|
74
|
+
// its PDF is linked from the blog post that cites it, and the folder
|
|
75
|
+
// itself has no listing page.
|
|
76
|
+
"/blog/references": false,
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/** The generated snapshot: [{ path, files }, ...]. */
|
|
80
|
+
const directories = (
|
|
81
|
+
generated as {
|
|
82
|
+
directories: Array<{ path: string; files: string[]; dirs: string[] }>;
|
|
83
|
+
}
|
|
84
|
+
).directories;
|
|
85
|
+
|
|
86
|
+
/** A glob pattern over a file name to a matcher: * runs over any run of
|
|
87
|
+
* characters (no separators — names only), ? is a single character, and
|
|
88
|
+
* everything else is literal. Case-insensitive: "*.PNG" hides ".png". */
|
|
89
|
+
const globMatcher = (pattern: string): ((name: string) => boolean) => {
|
|
90
|
+
const source = pattern
|
|
91
|
+
.replace(/[.+^${}()|[\]\\]/g, "\\$&")
|
|
92
|
+
.replace(/\*/g, ".*")
|
|
93
|
+
.replace(/\?/g, ".");
|
|
94
|
+
const re = new RegExp(`^${source}$`, "i");
|
|
95
|
+
return (name) => re.test(name);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/** Whether a directory serves a listing page: every generated directory
|
|
99
|
+
* does, unless its override is exactly false. */
|
|
100
|
+
export const blogDirListed = (path: string): boolean =>
|
|
101
|
+
blogDirOverrides[path] !== false;
|
|
102
|
+
|
|
103
|
+
const policyFor = (path: string) => {
|
|
104
|
+
const override =
|
|
105
|
+
blogDirOverrides[path] === false ? {} : (blogDirOverrides[path] ?? {});
|
|
106
|
+
const hide = override.hide ?? blogDirDefaults.hide;
|
|
107
|
+
return {
|
|
108
|
+
hide: hide.map(globMatcher),
|
|
109
|
+
posts: (override.posts ?? blogDirDefaults.posts).map((e) =>
|
|
110
|
+
e.toLowerCase().replace(/^\./, ""),
|
|
111
|
+
),
|
|
112
|
+
heading: override.heading,
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/** The configured directory addressed by a pathname, or undefined.
|
|
117
|
+
* Comparison is decoded, slash-normalized and case-insensitive; a
|
|
118
|
+
* malformed escape decodes to the raw path (same policy as the router's
|
|
119
|
+
* normalizePath). */
|
|
120
|
+
/** The files a /blog directory holds, by its served path — including
|
|
121
|
+
* the blog ROOT ("/blog"), whose files this exposes even though the
|
|
122
|
+
* root itself never lists (the curated blog.json page lives there).
|
|
123
|
+
* Answers undefined when the path names no directory in the walk —
|
|
124
|
+
* which, for anything under /blog/, means some ancestor of the address
|
|
125
|
+
* does not exist on the filesystem. */
|
|
126
|
+
export function blogDirFiles(path: string): string[] | undefined {
|
|
127
|
+
let p = path;
|
|
128
|
+
try {
|
|
129
|
+
p = decodeURIComponent(path);
|
|
130
|
+
} catch {
|
|
131
|
+
/* keep the raw path */
|
|
132
|
+
}
|
|
133
|
+
p = p.replace(/\/+$/, "").toLowerCase();
|
|
134
|
+
return directories.find((dir) => dir.path.toLowerCase() === p)?.files;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** The directory a pathname lists, or undefined. The blog ROOT is
|
|
138
|
+
* excluded from listing lookups: /blog is the curated blog.json page,
|
|
139
|
+
* never a directory listing. */
|
|
140
|
+
export function findBlogDir(pathname: string) {
|
|
141
|
+
let path = pathname;
|
|
142
|
+
try {
|
|
143
|
+
path = decodeURIComponent(pathname);
|
|
144
|
+
} catch {
|
|
145
|
+
/* keep the raw path */
|
|
146
|
+
}
|
|
147
|
+
path = path.replace(/\/+$/, "").toLowerCase();
|
|
148
|
+
if (path === "/blog") return undefined;
|
|
149
|
+
return directories.find((dir) => dir.path.toLowerCase() === path);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const extensionOf = (file: string): string => {
|
|
153
|
+
const dot = file.lastIndexOf(".");
|
|
154
|
+
return dot <= 0 ? "" : file.slice(dot + 1).toLowerCase();
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
/** The listing window for the directory a pathname addresses: one root
|
|
158
|
+
* window (the directory's name, expanded) whose content is a markdown
|
|
159
|
+
* list of the files that survive the blacklist. Post-extension files
|
|
160
|
+
* link extension-less (the router's post page embeds their file); the
|
|
161
|
+
* rest link the raw file directly. Returns undefined when the pathname
|
|
162
|
+
* addresses no directory on disk — the caller decides what an
|
|
163
|
+
* unconfigured address means. */
|
|
164
|
+
export function blogDirListing(pathname: string): Section | undefined {
|
|
165
|
+
const dir = findBlogDir(pathname);
|
|
166
|
+
if (!dir || !blogDirListed(dir.path)) return undefined;
|
|
167
|
+
const policy = policyFor(dir.path);
|
|
168
|
+
// Child directories first — the way deeper into the tree — each a
|
|
169
|
+
// plain link to that directory's own listing page. Opted-out children
|
|
170
|
+
// (override false) answer 404, so they never link.
|
|
171
|
+
const dirs = dir.dirs
|
|
172
|
+
.filter((child) => blogDirListed(child))
|
|
173
|
+
.map((child) => {
|
|
174
|
+
const name = child.split("/").filter(Boolean).pop() ?? child;
|
|
175
|
+
return `- [${name}/](${child})`;
|
|
176
|
+
});
|
|
177
|
+
const shown = dir.files.filter(
|
|
178
|
+
(file) =>
|
|
179
|
+
!file.startsWith(".") && !policy.hide.some((matches) => matches(file)),
|
|
180
|
+
);
|
|
181
|
+
const lines = shown.map((file) => {
|
|
182
|
+
const dot = file.lastIndexOf(".");
|
|
183
|
+
const label = dot > 0 ? file.slice(0, dot) : file;
|
|
184
|
+
const href = policy.posts.includes(extensionOf(file))
|
|
185
|
+
? `${dir.path}/${label}`
|
|
186
|
+
: `${dir.path}/${file}`;
|
|
187
|
+
return `- [${label}](${href})`;
|
|
188
|
+
});
|
|
189
|
+
return {
|
|
190
|
+
heading:
|
|
191
|
+
policy.heading ?? dir.path.split("/").filter(Boolean).pop() ?? dir.path,
|
|
192
|
+
theme: "open",
|
|
193
|
+
className: "blog-dir-listing",
|
|
194
|
+
content: [...dirs, ...lines].join("\n"),
|
|
195
|
+
};
|
|
196
|
+
}
|
package/src/content/configs.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"content": [
|
|
26
26
|
"My World of Warcraft configuration files — the window layout of Rueg's UI, the Simple WoW UI Pack, running wow classic.",
|
|
27
27
|
"[everything world of warcraft](/wow)",
|
|
28
|
-
{ "include": "characters" }
|
|
28
|
+
{ "include": "characters.json" }
|
|
29
29
|
],
|
|
30
30
|
"link": "/wow"
|
|
31
31
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"heading": "Contacts",
|
|
3
3
|
"theme": "open",
|
|
4
4
|
"content": [
|
|
5
|
-
"[akinevz.com/resume](
|
|
6
|
-
"[pagerts](
|
|
5
|
+
"[akinevz.com/resume](/resume)",
|
|
6
|
+
"[pagerts](/pagerts) - my CLI project",
|
|
7
7
|
"",
|
|
8
8
|
"[github.com/akinevz2](https://github.com/akinevz2)",
|
|
9
9
|
"[github.com/akinevz (archive)](https://github.com/akinevz)",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
| Recipe | Effect |
|
|
2
|
+
| ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
3
|
+
| `install` | full host setup: `stow`, then `system` |
|
|
4
|
+
| `stow` | `bash` + `wm` |
|
|
5
|
+
| `bash` | stows `shell` (bashrc hook), `git` (`load-credentials`), `llms`, `task` |
|
|
6
|
+
| `wm` -> `herbst` | stows `herbst` + `herbstclient reload`, then `alacritty`, `dunst`, `compton` |
|
|
7
|
+
| `stow-wm` | `status`, then stows every package in `wm.packages` |
|
|
8
|
+
| `services` | stows the `services` package (units land in the systemd user config) |
|
|
9
|
+
| `system` | `status`, `add-packages-system`, `add-packages` |
|
|
10
|
+
| `add-packages` | stows `shell`, `on.deploy` preflight, verifies every `wm.requires` binary |
|
|
11
|
+
| `add-packages-system` | starts the service units, previews + confirms `sudo stow -t /` for `system-*` packages (skips when none) |
|
|
12
|
+
| `status` | read-only: prints repo `*.service` states, flags missing `service.order` units |
|
|
13
|
+
| `reload-systemd` | stows `services`, `daemon-reload`, enables + starts every `service.order` unit |
|
|
14
|
+
| `start-services`, `stop-services`, `restart-services` | `reload-systemd`, a y/N prompt, then the requested action per unit |
|
|
15
|
+
| `update` | safe pull: fast-forward, merge, `$EDITOR` on conflicts or a dirty tree |
|
|
16
|
+
| `push` | `update`; commits staged/untracked work (via `$EDITOR`) and pushes |
|
|
17
|
+
| `sync` | `update` + `push` |
|
|
18
|
+
| `depends` | deploys `wm`, checks the manifests exist, then `sync` |
|
package/src/content/index.ts
CHANGED
|
@@ -4,13 +4,159 @@ import sectionsJson from "./sections.json";
|
|
|
4
4
|
import contactsJson from "./contacts.json";
|
|
5
5
|
import addonsJson from "./addons.json";
|
|
6
6
|
import configsJson from "./configs.json";
|
|
7
|
-
import charactersJson from "./characters.json";
|
|
7
|
+
import charactersJson from "./includes/characters.json";
|
|
8
8
|
import blogJson from "./blog.json";
|
|
9
9
|
import soundcloudJson from "./soundcloud.json";
|
|
10
10
|
import musicExtJson from "./music-ext.json";
|
|
11
11
|
|
|
12
12
|
export * from "./schema";
|
|
13
13
|
|
|
14
|
+
/* ------------------------------------------------------------------ includes
|
|
15
|
+
* A content file can embed another content file's window tree with an
|
|
16
|
+
* include directive instead of duplicating it:
|
|
17
|
+
*
|
|
18
|
+
* { "include": "make-recipes.md" } → the markdown file, wrapped as a Section
|
|
19
|
+
* { "include": "characters.json" } → the Section of includes/characters.json
|
|
20
|
+
*
|
|
21
|
+
* ANY file under src/content/includes/ is includable — no registration,
|
|
22
|
+
* and the directive carries the FULL FILE NAME (extension included):
|
|
23
|
+
* - `.json`: must hold a Section (the window-tree shape of a content file).
|
|
24
|
+
* - `.md`: author-written markdown (literal newlines), imported raw and
|
|
25
|
+
* wrapped as `{ heading, anchor: <stem>, theme: "open", content: <md> }`.
|
|
26
|
+
* An optional leading `# Heading` line names the window; otherwise the
|
|
27
|
+
* humanized file stem does ("make-recipes" → "Make recipes").
|
|
28
|
+
* Directives are expanded at load time, recursively (an included tree may
|
|
29
|
+
* itself contain directives). Unknown or circular directives throw during
|
|
30
|
+
* module load, failing the build loudly instead of rendering an opaque
|
|
31
|
+
* object. Each file may be included multiple times across sibling items;
|
|
32
|
+
* cycles are broken by the seen-set, which tracks one inclusion chain.
|
|
33
|
+
* Target lookup goes through the vite glob maps — a directive never joins
|
|
34
|
+
* paths itself, so a hostile name cannot escape the includes/ directory.
|
|
35
|
+
*
|
|
36
|
+
* Everything here precedes its first use: exports below expand their
|
|
37
|
+
* trees at module evaluation, so this scaffolding must be initialized
|
|
38
|
+
* by then (const declarations do not hoist).
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
/** Every includable .json Section, keyed by file name ("characters.json"). */
|
|
42
|
+
const sectionModules = import.meta.glob<Section>("./includes/*.json", {
|
|
43
|
+
eager: true,
|
|
44
|
+
import: "default",
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
/** Every includable .md document, keyed by file name — imported raw. */
|
|
48
|
+
const mdModules = import.meta.glob<string>("./includes/*.md", {
|
|
49
|
+
eager: true,
|
|
50
|
+
import: "default",
|
|
51
|
+
query: "?raw",
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const stemOf = (path: string): string =>
|
|
55
|
+
path
|
|
56
|
+
.split("/")
|
|
57
|
+
.pop()!
|
|
58
|
+
.replace(/\.json$|\.md$/, "");
|
|
59
|
+
|
|
60
|
+
/** "make-recipes" → "Make recipes". */
|
|
61
|
+
const humanize = (stem: string): string =>
|
|
62
|
+
stem.replace(/-/g, " ").replace(/^./, (c) => c.toUpperCase());
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Wrap an include/ markdown file as a Section: `# Heading` first line
|
|
66
|
+
* names the window (default: humanized stem); the rest is the content.
|
|
67
|
+
*/
|
|
68
|
+
const mdSection = (stem: string, md: string): Section => {
|
|
69
|
+
const lines = md.replace(/\r\n/g, "\n").split("\n");
|
|
70
|
+
let heading: string | undefined;
|
|
71
|
+
while (heading === undefined && lines.length > 0) {
|
|
72
|
+
const line = lines[0] ?? "";
|
|
73
|
+
if (line.trim() === "") lines.shift();
|
|
74
|
+
else if (line.startsWith("# ")) {
|
|
75
|
+
heading = line.slice(2).trim();
|
|
76
|
+
lines.shift();
|
|
77
|
+
} else break;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
heading: heading ?? humanize(stem),
|
|
81
|
+
anchor: stem,
|
|
82
|
+
theme: "open",
|
|
83
|
+
content: lines.join("\n"),
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/** Includable Sections, keyed by FULL file name ("make-recipes.md"). */
|
|
88
|
+
const includes: Record<string, Section> = {
|
|
89
|
+
...Object.fromEntries(
|
|
90
|
+
Object.entries(sectionModules).map(([path, section]) => [
|
|
91
|
+
path.split("/").pop()!,
|
|
92
|
+
section,
|
|
93
|
+
]),
|
|
94
|
+
),
|
|
95
|
+
...Object.fromEntries(
|
|
96
|
+
Object.entries(mdModules).map(([path, md]) => {
|
|
97
|
+
const stem = stemOf(path);
|
|
98
|
+
return [path.split("/").pop()!, mdSection(stem, md)];
|
|
99
|
+
}),
|
|
100
|
+
),
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/** The include target a directive file name resolves to. The name must
|
|
104
|
+
* be a bare file name (no directories) with an includable extension;
|
|
105
|
+
* unknown names throw — the same loud failure the renderer would
|
|
106
|
+
* otherwise paper over. */
|
|
107
|
+
const includeTarget = (name: string): Section => {
|
|
108
|
+
if (!/^[a-z0-9][a-z0-9._-]*\.(json|md)$/i.test(name) || name.includes("/")) {
|
|
109
|
+
throw new Error(
|
|
110
|
+
`Unknown include directive: ${name} ` +
|
|
111
|
+
"(targets are bare .json/.md file names under src/content/includes/)",
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
const target = includes[name];
|
|
115
|
+
if (!target) {
|
|
116
|
+
throw new Error(
|
|
117
|
+
`Unknown include directive: ${name} (targets live in src/content/includes/)`,
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
return target;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
function expandContent(
|
|
124
|
+
content: NonNullable<Section["content"]>,
|
|
125
|
+
ancestors: Set<string>,
|
|
126
|
+
): NonNullable<Section["content"]> {
|
|
127
|
+
if (typeof content === "string") return content;
|
|
128
|
+
const items = Array.isArray(content) ? content : [content];
|
|
129
|
+
return items.map((item) => {
|
|
130
|
+
if (typeof item !== "object" || item === null) return item;
|
|
131
|
+
if ("include" in item) {
|
|
132
|
+
const name = item.include;
|
|
133
|
+
if (typeof name !== "string") {
|
|
134
|
+
throw new Error(`Unknown include directive: ${String(name)}`);
|
|
135
|
+
}
|
|
136
|
+
if (ancestors.has(name)) {
|
|
137
|
+
throw new Error(`Circular include directive: ${name}`);
|
|
138
|
+
}
|
|
139
|
+
const chain = new Set(ancestors);
|
|
140
|
+
chain.add(name);
|
|
141
|
+
return expandSection(includeTarget(name), chain);
|
|
142
|
+
}
|
|
143
|
+
if ("banner" in item || "url" in item) return item;
|
|
144
|
+
return expandSection(item as Section, ancestors);
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** Expands a nested section, preserving the absence of content exactly. */
|
|
149
|
+
function expandSection(section: Section, ancestors: Set<string>): Section {
|
|
150
|
+
if (!section.content) return section;
|
|
151
|
+
return { ...section, content: expandContent(section.content, ancestors) };
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** Expands every include directive in the tree rooted at `section`. */
|
|
155
|
+
function resolveIncludes(section: Section): Section {
|
|
156
|
+
if (!section.content) return section;
|
|
157
|
+
return { ...section, content: expandContent(section.content, new Set()) };
|
|
158
|
+
}
|
|
159
|
+
|
|
14
160
|
const projectModules = import.meta.glob<Project>("./projects/*.json", {
|
|
15
161
|
eager: true,
|
|
16
162
|
import: "default",
|
|
@@ -19,9 +165,14 @@ const projectModules = import.meta.glob<Project>("./projects/*.json", {
|
|
|
19
165
|
export const projectPath = (project: Project) =>
|
|
20
166
|
project.path ?? `/projects/${project.slug}`;
|
|
21
167
|
|
|
22
|
-
export const projects = Object.values(projectModules)
|
|
23
|
-
|
|
24
|
-
)
|
|
168
|
+
export const projects = Object.values(projectModules)
|
|
169
|
+
// Project pages can embed shared content the same way page trees can:
|
|
170
|
+
// expand include directives (e.g. the make-recipes table) at load time.
|
|
171
|
+
.map((project): Project => ({
|
|
172
|
+
...project,
|
|
173
|
+
content: resolveIncludes(project.content),
|
|
174
|
+
}))
|
|
175
|
+
.sort((a, b) => a.title.localeCompare(b.title));
|
|
25
176
|
|
|
26
177
|
/**
|
|
27
178
|
* Short-hand URL for a project: /<slug>. Redirects to the canonical
|
|
@@ -73,59 +224,6 @@ const projectRoutes: Route[] = projects.flatMap((project): Route[] => {
|
|
|
73
224
|
});
|
|
74
225
|
|
|
75
226
|
export const routes: Route[] = [...pageRoutes, ...projectRoutes];
|
|
76
|
-
/* ------------------------------------------------------------------ includes
|
|
77
|
-
* A content file can embed another content file's window tree with an
|
|
78
|
-
* include directive instead of duplicating it:
|
|
79
|
-
*
|
|
80
|
-
* { "include": "characters" } → the top-level Section of characters.json
|
|
81
|
-
*
|
|
82
|
-
* Directives are expanded at load time, recursively (an included tree may
|
|
83
|
-
* itself contain directives). Unknown or circular directives throw during
|
|
84
|
-
* module load, failing the build loudly instead of rendering an opaque
|
|
85
|
-
* object. Each file may be included multiple times across sibling items;
|
|
86
|
-
* cycles are broken by the seen-set, which tracks one inclusion chain.
|
|
87
|
-
*/
|
|
88
|
-
const includeRegistry: Record<string, Section> = {
|
|
89
|
-
characters: charactersJson as Section,
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
function expandContent(
|
|
93
|
-
content: NonNullable<Section["content"]>,
|
|
94
|
-
ancestors: Set<string>,
|
|
95
|
-
): NonNullable<Section["content"]> {
|
|
96
|
-
if (typeof content === "string") return content;
|
|
97
|
-
const items = Array.isArray(content) ? content : [content];
|
|
98
|
-
return items.map((item) => {
|
|
99
|
-
if (typeof item !== "object" || item === null) return item;
|
|
100
|
-
if ("include" in item) {
|
|
101
|
-
const name = item.include;
|
|
102
|
-
if (typeof name !== "string" || !includeRegistry[name]) {
|
|
103
|
-
throw new Error(`Unknown include directive: ${String(name)}`);
|
|
104
|
-
}
|
|
105
|
-
if (ancestors.has(name)) {
|
|
106
|
-
throw new Error(`Circular include directive: ${name}`);
|
|
107
|
-
}
|
|
108
|
-
const target = includeRegistry[name];
|
|
109
|
-
const chain = new Set(ancestors);
|
|
110
|
-
chain.add(name);
|
|
111
|
-
return expandSection(target, chain);
|
|
112
|
-
}
|
|
113
|
-
if ("banner" in item || "url" in item) return item;
|
|
114
|
-
return expandSection(item as Section, ancestors);
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/** Expands a nested section, preserving the absence of content exactly. */
|
|
119
|
-
function expandSection(section: Section, ancestors: Set<string>): Section {
|
|
120
|
-
if (!section.content) return section;
|
|
121
|
-
return { ...section, content: expandContent(section.content, ancestors) };
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/** Expands every include directive in the tree rooted at `section`. */
|
|
125
|
-
const resolveIncludes = (section: Section): Section => {
|
|
126
|
-
if (!section.content) return section;
|
|
127
|
-
return { ...section, content: expandContent(section.content, new Set()) };
|
|
128
|
-
};
|
|
129
227
|
|
|
130
228
|
export const sections = resolveIncludes(sectionsJson as Section);
|
|
131
229
|
export const contacts = resolveIncludes(contactsJson as Section);
|
|
@@ -135,3 +233,4 @@ export const characters = resolveIncludes(charactersJson as Section);
|
|
|
135
233
|
export const blog = resolveIncludes(blogJson as Section);
|
|
136
234
|
export const soundcloud = soundcloudJson as SoundCloudData;
|
|
137
235
|
export const musicExt = musicExtJson;
|
|
236
|
+
export * from "./blogDirs";
|
|
@@ -1,19 +1,103 @@
|
|
|
1
1
|
{
|
|
2
2
|
"slug": "doftiles",
|
|
3
3
|
"title": "doftiles",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "Personal dotfiles: GNU Stow packages, Makefile deployment with hooks, herbstluftwm on WSL2.",
|
|
5
5
|
"github": "https://github.com/akinevz2/doftiles",
|
|
6
6
|
"content": {
|
|
7
7
|
"heading": "doftiles",
|
|
8
8
|
"content": [
|
|
9
|
-
"
|
|
9
|
+
"dots - herbstluftwm on WSL2, deployed with GNU Stow and Make.",
|
|
10
10
|
"[https://github.com/akinevz2/doftiles](https://github.com/akinevz2/doftiles)",
|
|
11
11
|
{
|
|
12
12
|
"heading": "From the README",
|
|
13
13
|
"theme": "open",
|
|
14
14
|
"content": [
|
|
15
|
-
"
|
|
16
|
-
"
|
|
15
|
+
"Every top-level directory is a stow package whose contents mirror `$HOME`; recipes link them with `stow -R -t $HOME <package>`. Deploy through make, never bare stow.",
|
|
16
|
+
"```sh\ncd ~/dots\ngit submodule update --init --recursive",
|
|
17
|
+
"WSL2 needs VcXsrv on the Windows side",
|
|
18
|
+
"use `DISPLAY=localhost:0.0`."
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"heading": "Packages provided",
|
|
23
|
+
"theme": "open",
|
|
24
|
+
"content": [
|
|
25
|
+
"14 stow packages:",
|
|
26
|
+
{
|
|
27
|
+
"heading": "Shell and tooling",
|
|
28
|
+
"theme": "open",
|
|
29
|
+
"content": [
|
|
30
|
+
"shell - `.bashrcx`, `.profile`, aliases, exports; firefox -> Windows Firefox; `check-wsl`",
|
|
31
|
+
"git - `~/.my-credentials`, `load-credentials` hook, `dekineify`, home `~/Makefile`",
|
|
32
|
+
"llms - OpenCode + poolside config, SonarQube/MCP tooling",
|
|
33
|
+
"task - Taskwarrior config",
|
|
34
|
+
"vim - Vim config",
|
|
35
|
+
"zshell - Oh My Zsh config"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"heading": "Window manager stack",
|
|
40
|
+
"theme": "open",
|
|
41
|
+
"content": [
|
|
42
|
+
"herbst - autostart, keybinds, ~40 scripts (`hc_*`, `rofi_*`, `polyctl`, `winbarctl`)",
|
|
43
|
+
"polybar - `config.ini`, `polywins` (submodule), [polyframes](/projects/polyframes) (the renderer binary, now its own project), `ewmh_labels`",
|
|
44
|
+
"compton - compositor config, rofi context-menu helpers",
|
|
45
|
+
"rofi - themes, applets, ~40 `bin/` helpers",
|
|
46
|
+
"dunst - notification config, mail scripts",
|
|
47
|
+
"alacritty - terminal config"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"heading": "Services and maintenance",
|
|
52
|
+
"theme": "open",
|
|
53
|
+
"content": [
|
|
54
|
+
"services - systemd units: `herbst`, `compton`, `dunst` (+ disabled `xvfb`/`x11vnc`/`novnc`)",
|
|
55
|
+
"maintenance - `check-msi-dirs` oneshot (dunst alert)"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"Caveat: `wm.packages` is stale - pre-rename `opencode`, omits `vim`/`zshell`/`maintenance`; stow those individually."
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"heading": "The polyframes renderer",
|
|
63
|
+
"theme": "open",
|
|
64
|
+
"content": [
|
|
65
|
+
"The bar's window-list renderer is a standalone native binary: [polyframes](/projects/polyframes) — a bunli/Bun TypeScript CLI compiled with `bun build --compile` (its own repo; the dots tree carries none of it).",
|
|
66
|
+
"It renders the center module (one label per frame+class group, state-decorated, click/scroll actions) and hosts the helpers that used to live here: the rofi menus (`tags`, `hidden`, `windows`, `launch`), `hc_tile`/`hc_center`/`hc_resize` equivalents, `hc_fit_to`-style constraint passes, one-shot `rule once` spawns, and `hc_unmaximize`'s janitor daemon trigger.",
|
|
67
|
+
"Why a binary: polybar's spawn environment has no nvm PATH — the compiled executable embeds its runtime and re-executes ITSELF in the bar's click-action strings, so no shim and no node setup is needed.",
|
|
68
|
+
"`hc_center`/`hc_resize` remain here as two-line exec-shims delegating to the binary (dots-side callers keep their names). All WM reads go through [herbstutil](https://github.com/akinevz2/herbstutil) (typed JSON). Install: `make install` in the polyframes repo; bar wiring: `[module/polyframes]` in `config.ini`.",
|
|
69
|
+
{
|
|
70
|
+
"heading": "Links",
|
|
71
|
+
"content": [
|
|
72
|
+
{
|
|
73
|
+
"heading": "polyframes project page",
|
|
74
|
+
"link": "/projects/polyframes"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"heading": "polyframes on GitHub",
|
|
78
|
+
"link": "https://github.com/akinevz2/polyframes"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"heading": "Float registers: mod-f / mod-x / mod-ctrl-f",
|
|
86
|
+
"theme": "open",
|
|
87
|
+
"content": [
|
|
88
|
+
"The float registers are hlwm configuration wired to the [polyframes](/projects/polyframes) binary. The state machines live in `herbst/.local/bin` (`hc_focus`, `hc_floatx`, `hc_zoom`).",
|
|
89
|
+
"mod-f toggles the WINDOW's floating state: tiled to float (size preserved, decoration-aware center, fit pass, focus follows) and back. A single-float policy: when a visible float exists, the press focuses the floating layer instead of stacking a second float.",
|
|
90
|
+
"mod-x toggles the LAYER focus: float focused hands focus to the tiling layer (the float stays); tiling focus + visible float slurps the float into the frame (via hc_tile when the frame is populated and non-max); tiling focus + no floats yanks the focused window out (float + center in the monitor), and closes the vacated frame when the yanked window was its only client.",
|
|
91
|
+
"mod-ctrl-f zooms: the fresh float is stretched to the frame with its decoration outline flush to the frame's content rect (content = frame minus the theme's floating margins), then a fit pass keeps the full outline on-screen.",
|
|
92
|
+
"Geometry writes reconcile against hlwm's real content rect afterwards: float size hints can snap sizes, and the placement re-runs once from the read-back truth - verified against decoration_geometry reads, not the values we wrote."
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"heading": "Deployment via Make",
|
|
97
|
+
"theme": "open",
|
|
98
|
+
"content": [
|
|
99
|
+
"Each recipe's effect includes its prerequisite recipes (run first, in listed order).",
|
|
100
|
+
{ "include": "make-recipes.md" }
|
|
17
101
|
]
|
|
18
102
|
}
|
|
19
103
|
]
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "herbctl",
|
|
3
|
+
"title": "herbctl",
|
|
4
|
+
"description": "The herbstluftwm keybind imperatives: every composite mod- binding as a get-* verb - the float-layer state machines, the zoom register, the navigation chains - compiled to a standalone bunli binary.",
|
|
5
|
+
"github": "https://github.com/akinevz2/herbctl",
|
|
6
|
+
"content": {
|
|
7
|
+
"heading": "herbctl - the keybind imperatives, as a native binary",
|
|
8
|
+
"content": [
|
|
9
|
+
"herbctl owns what the keybinds used to express as inline herbstluftwm chains: one verb per mod-key binding, each a faithful port of the tuned chain (or state machine) it replaces - compiled to a standalone executable with Bun and bunli, so the keybinds spawn binaries, not scripts.",
|
|
10
|
+
"[https://github.com/akinevz2/herbctl](https://github.com/akinevz2/herbctl)",
|
|
11
|
+
{
|
|
12
|
+
"heading": "The verbs",
|
|
13
|
+
"theme": "open",
|
|
14
|
+
"content": [
|
|
15
|
+
"Named for what they fetch, not for the key that triggers them:",
|
|
16
|
+
"get-south (mod-s) - the zoom/peek grid: urgent first (gated on the tag's urgent count), frame-down focus, the floating-layer branch (focus the layer and un-float via the tag's focused_client - the alias resolves stale mid-chain), cycle and pseudotile fallbacks.",
|
|
17
|
+
"get-forward (mod-w), get-shuffle (mod-shift-w) - leave-float and cycle-up; the shift ladder ends in a frame-tree rotate.",
|
|
18
|
+
"get-deck (mod-d), get-dedeck (mod-shift-d) - layout cyclers gated on frame occupancy; dedeck collapses to remove.",
|
|
19
|
+
"get-explore (mod-e), get-advice (mod-a) - explode/cycle and frame-focus-or-split pairs.",
|
|
20
|
+
"get-below (mod-shift-b), get-dive (mod-ctrl-a), get-toss (mod-ctrl-e) - split+shift directions.",
|
|
21
|
+
"get-quiet (mod-q), get-hold (mod-shift-q), get-wrench (mod-ctrl-q) - the close/quit family: floats only un-float, empty frames collapse, xkill for the stubborn.",
|
|
22
|
+
"get-tuck (mod-shift-t) - the frame half of split-auto: the dots keybind chains it with the terminal spawn so the split only happens for a window that actually arrives.",
|
|
23
|
+
"get-vex/get-bend (mod-v/mod-b) and get-vexi/get-bendi (mod-ctrl-v/mod-ctrl-b) - the split-into-direction family.",
|
|
24
|
+
"get-hush (mod-shift-f) - fullscreen toggle; get-nap (mod-shift-z) - minimize toggle."
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"heading": "The state machines",
|
|
29
|
+
"theme": "open",
|
|
30
|
+
"content": [
|
|
31
|
+
"Three bindings carry whole register machines, ported branch for branch with the dots scripts as the contract:",
|
|
32
|
+
"get-zoom (mod-ctrl-f, the hc_zoom port) - press-count register: tile the float, maximize onto a dedicated <tag>-max tag (state recorded in hlwm env, a per-tag janitor daemon tidies up), restore.",
|
|
33
|
+
"get-extracted (mod-x, the hc_floatx port) - the layer-yank machine: focus a float and un-float it, yank the focused window into the float session (the vacated frame is never closed), defer to the tiling layer, drop a float back into an empty frame, and the no-floats tidying branch.",
|
|
34
|
+
"get-focus (mod-f, the hc_focus port) - the quick float toggle: no focus chasing, the register handled by hlwm itself.",
|
|
35
|
+
"Every branch is pinned by tests that mock the herbstclient binary and assert the exact command argv - no live WM is ever touched by the suite."
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"heading": "Links",
|
|
40
|
+
"theme": "open",
|
|
41
|
+
"content": [
|
|
42
|
+
{
|
|
43
|
+
"heading": "GitHub repository",
|
|
44
|
+
"link": "https://github.com/akinevz2/herbctl"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"heading": "herbstutil (the primitives underneath)",
|
|
48
|
+
"link": "https://github.com/akinevz2/herbstutil"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"heading": "doftiles (the keybinds that spawn it)",
|
|
52
|
+
"link": "https://github.com/akinevz2/doftiles"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
}
|