Skip to content

Commit 17f85ee

Browse files
committed
chore:
1 parent 1f78bb5 commit 17f85ee

12 files changed

Lines changed: 219 additions & 353 deletions

File tree

content/private

Submodule private updated from 0d47cab to 3906934
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: "Systems: Day 17"
3+
date: "2026-01-05T00:00:00.000Z"
4+
tags:
5+
- "seasons/systems"
6+
- "private"
7+
---
8+
9+
This note is part of my private vault, and isn't published publicly on the site or within the public GitHub.
10+
11+
If you are interested in what this note contains, please [[contact|reach out to me!]] If it's not anything terribly sensitive, I'm happy to chat about it!
12+
13+
14+
## Links
15+
16+
This note originally contained the following links:
17+
18+
- [2026-01-04](content/notes/periodic/daily/2026-01-04)
19+
- [deterministic testing for agent development.](content/notes/hostage-negotiations)
20+
- [agent evaluations of frontend via Chrome MCP](https://developer.chrome.com/blog/chrome-devtools-mcp)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: "Ratcheted Testing: Actual Test-Driven Development"
3+
date: "2026-01-05T00:00:00.000Z"
4+
tags:
5+
- "private"
6+
---
7+
8+
This note is part of my private vault, and isn't published publicly on the site or within the public GitHub.
9+
10+
If you are interested in what this note contains, please [[contact|reach out to me!]] If it's not anything terribly sensitive, I'm happy to chat about it!

content/public/templates/daily.template.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ title: "<% title %>"
4545
date: <% tp.date.now() %>
4646
tags:
4747
- <% seasonTag %>
48-
draft: false
4948
---
5049
[[private/content/notes/periodic/daily/<% previousLink %>|<% previousLink %>]]
5150

quartz/components/PostListing.tsx

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
2+
import { FullSlug, resolveRelative } from "../util/path"
3+
import { QuartzPluginData } from "../plugins/vfile"
4+
import { Date, getDate } from "./Date"
5+
import { byDateAndAlphabetical, SortFn } from "./PageList"
6+
7+
export interface PostListingOptions {
8+
/**
9+
* Maximum number of posts to display. If undefined, shows all posts.
10+
*/
11+
limit?: number
12+
13+
/**
14+
* Sorting function for posts. Defaults to byDateAndAlphabetical.
15+
*/
16+
sort?: SortFn
17+
18+
/**
19+
* Tags to exclude from the listing. Posts with any of these tags will be filtered out.
20+
* Default: ["private"]
21+
*/
22+
excludeTags?: string[]
23+
24+
/**
25+
* Filter function to determine which pages to include.
26+
* Takes precedence over excludeTags if both are specified.
27+
*/
28+
filter?: (file: QuartzPluginData) => boolean
29+
30+
/**
31+
* Whether to show a "No posts found" message when the list is empty.
32+
* Default: true
33+
*/
34+
showEmptyMessage?: boolean
35+
36+
/**
37+
* Custom empty message to display when no posts are found.
38+
*/
39+
emptyMessage?: string
40+
41+
/**
42+
* Whether to show tags on each post.
43+
* Default: true
44+
*/
45+
showTags?: boolean
46+
47+
/**
48+
* Whether to show dates on each post.
49+
* Default: true
50+
*/
51+
showDates?: boolean
52+
}
53+
54+
const defaultOptions: PostListingOptions = {
55+
excludeTags: ["private"],
56+
showEmptyMessage: true,
57+
emptyMessage: "No posts found.",
58+
showTags: true,
59+
showDates: true,
60+
}
61+
62+
export default ((userOpts?: Partial<PostListingOptions>) => {
63+
const opts: PostListingOptions = { ...defaultOptions, ...userOpts }
64+
65+
const PostListing: QuartzComponent = ({
66+
cfg,
67+
fileData,
68+
allFiles,
69+
}: QuartzComponentProps) => {
70+
const sorter = opts.sort ?? byDateAndAlphabetical(cfg)
71+
72+
// Apply filtering
73+
let filteredFiles = allFiles
74+
75+
if (opts.filter) {
76+
// Use custom filter if provided
77+
filteredFiles = filteredFiles.filter(opts.filter)
78+
} else if (opts.excludeTags && opts.excludeTags.length > 0) {
79+
// Use excludeTags filter
80+
filteredFiles = filteredFiles.filter((file) => {
81+
const tags = file.frontmatter?.tags ?? []
82+
return !tags.some((tag) => opts.excludeTags!.includes(tag))
83+
})
84+
}
85+
86+
// Apply sorting
87+
let list = filteredFiles.sort(sorter)
88+
89+
// Apply limit
90+
if (opts.limit) {
91+
list = list.slice(0, opts.limit)
92+
}
93+
94+
// Show empty message if no posts
95+
if (list.length === 0 && opts.showEmptyMessage) {
96+
return <p class="post-listing-empty">{opts.emptyMessage}</p>
97+
}
98+
99+
return (
100+
<ul class="section-ul">
101+
{list.map((page) => {
102+
const title = page.frontmatter?.title
103+
const tags = page.frontmatter?.tags ?? []
104+
105+
return (
106+
<li class="section-li">
107+
<div class="section">
108+
{opts.showDates && page.dates && (
109+
<p class="meta">
110+
<Date date={getDate(cfg, page)!} locale={cfg.locale} />
111+
</p>
112+
)}
113+
<div class="desc">
114+
<h3>
115+
<a href={resolveRelative(fileData.slug!, page.slug!)} class="internal">
116+
{title}
117+
</a>
118+
</h3>
119+
</div>
120+
{opts.showTags && tags.length > 0 && (
121+
<ul class="tags">
122+
{tags.map((tag) => (
123+
<li>
124+
<a
125+
class="internal tag-link"
126+
href={resolveRelative(fileData.slug!, `tags/${tag}` as FullSlug)}
127+
>
128+
{tag}
129+
</a>
130+
</li>
131+
))}
132+
</ul>
133+
)}
134+
</div>
135+
</li>
136+
)
137+
})}
138+
</ul>
139+
)
140+
}
141+
142+
PostListing.css = `
143+
.section h3 {
144+
margin: 0;
145+
}
146+
147+
.section > .tags {
148+
margin: 0;
149+
}
150+
151+
.post-listing-empty {
152+
color: var(--gray);
153+
font-style: italic;
154+
}
155+
`
156+
157+
return PostListing
158+
}) satisfies QuartzComponentConstructor<PostListingOptions>

quartz/components/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import Breadcrumbs from "./Breadcrumbs"
2727
import Comments from "./Comments"
2828
import Flex from "./Flex"
2929
import ConditionalRender from "./ConditionalRender"
30+
import PostListing from "./PostListing"
3031

3132
export {
3233
ArticleTitle,
@@ -58,4 +59,5 @@ export {
5859
Comments,
5960
Flex,
6061
ConditionalRender,
62+
PostListing,
6163
}
Lines changed: 7 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,19 @@
11
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "../types"
2-
32
import style from "../styles/listPage.scss"
4-
import { PageList, SortFn } from "../PageList"
53
import { Root } from "hast"
64
import { htmlToJsx } from "../../util/jsx"
7-
import { i18n } from "../../i18n"
8-
import { QuartzPluginData } from "../../plugins/vfile"
95
import { ComponentChildren } from "preact"
10-
import { concatenateResources } from "../../util/resources"
11-
import { trieFromAllFiles } from "../../util/ctx"
12-
13-
interface FolderContentOptions {
14-
/**
15-
* Whether to display number of folders
16-
*/
17-
showFolderCount: boolean
18-
showSubfolders: boolean
19-
sort?: SortFn
20-
}
21-
22-
const defaultOptions: FolderContentOptions = {
23-
showFolderCount: true,
24-
showSubfolders: true,
25-
}
26-
27-
export default ((opts?: Partial<FolderContentOptions>) => {
28-
const options: FolderContentOptions = { ...defaultOptions, ...opts }
296

7+
/**
8+
* FolderContent component - renders the article content for folder pages.
9+
* Post listings are now handled by the PostListing component in layout files.
10+
*/
11+
export default (() => {
3012
const FolderContent: QuartzComponent = (props: QuartzComponentProps) => {
31-
const { tree, fileData, allFiles, cfg } = props
32-
33-
const trie = (props.ctx.trie ??= trieFromAllFiles(allFiles))
34-
const folder = trie.findNode(fileData.slug!.split("/"))
35-
if (!folder) {
36-
return null
37-
}
38-
39-
const allPagesInFolder: QuartzPluginData[] =
40-
folder.children
41-
.map((node) => {
42-
// regular file, proceed
43-
if (node.data) {
44-
return node.data
45-
}
46-
47-
if (node.isFolder && options.showSubfolders) {
48-
// folders that dont have data need synthetic files
49-
const getMostRecentDates = (): QuartzPluginData["dates"] => {
50-
let maybeDates: QuartzPluginData["dates"] | undefined = undefined
51-
for (const child of node.children) {
52-
if (child.data?.dates) {
53-
// compare all dates and assign to maybeDates if its more recent or its not set
54-
if (!maybeDates) {
55-
maybeDates = { ...child.data.dates }
56-
} else {
57-
if (child.data.dates.created > maybeDates.created) {
58-
maybeDates.created = child.data.dates.created
59-
}
60-
61-
if (child.data.dates.modified > maybeDates.modified) {
62-
maybeDates.modified = child.data.dates.modified
63-
}
64-
65-
if (child.data.dates.published > maybeDates.published) {
66-
maybeDates.published = child.data.dates.published
67-
}
68-
}
69-
}
70-
}
71-
return (
72-
maybeDates ?? {
73-
created: new Date(),
74-
modified: new Date(),
75-
published: new Date(),
76-
}
77-
)
78-
}
13+
const { tree, fileData } = props
7914

80-
return {
81-
slug: node.slug,
82-
dates: getMostRecentDates(),
83-
frontmatter: {
84-
title: node.displayName,
85-
tags: [],
86-
},
87-
}
88-
}
89-
})
90-
.filter((page) => page !== undefined) ?? []
9115
const cssClasses: string[] = fileData.frontmatter?.cssclasses ?? []
9216
const classes = cssClasses.join(" ")
93-
const listProps = {
94-
...props,
95-
sort: options.sort,
96-
allFiles: allPagesInFolder,
97-
}
9817

9918
const content = (
10019
(tree as Root).children.length === 0
@@ -105,22 +24,10 @@ export default ((opts?: Partial<FolderContentOptions>) => {
10524
return (
10625
<div class="popover-hint">
10726
<article class={classes}>{content}</article>
108-
<div class="page-listing">
109-
{options.showFolderCount && (
110-
<p>
111-
{i18n(cfg.locale).pages.folderContent.itemsUnderFolder({
112-
count: allPagesInFolder.length,
113-
})}
114-
</p>
115-
)}
116-
<div>
117-
<PageList {...listProps} />
118-
</div>
119-
</div>
12027
</div>
12128
)
12229
}
12330

124-
FolderContent.css = concatenateResources(style, PageList.css)
31+
FolderContent.css = style
12532
return FolderContent
12633
}) satisfies QuartzComponentConstructor

0 commit comments

Comments
 (0)