From 0a57d032a76dc4d924f9e4927237830a42d2511c Mon Sep 17 00:00:00 2001
From: Lumen Yang <45258158+LumenYoung@users.noreply.github.com>
Date: Thu, 21 Aug 2025 16:37:59 +0000
Subject: [PATCH] feat(typst): invert the math equation for typst rendered equation in darkmode (#2095)
---
quartz/components/pages/FolderContent.tsx | 27 ++++-----------------------
1 files changed, 4 insertions(+), 23 deletions(-)
diff --git a/quartz/components/pages/FolderContent.tsx b/quartz/components/pages/FolderContent.tsx
index e775653..afd4f5d 100644
--- a/quartz/components/pages/FolderContent.tsx
+++ b/quartz/components/pages/FolderContent.tsx
@@ -8,7 +8,8 @@
import { QuartzPluginData } from "../../plugins/vfile"
import { ComponentChildren } from "preact"
import { concatenateResources } from "../../util/resources"
-import { FileTrieNode } from "../../util/fileTrie"
+import { trieFromAllFiles } from "../../util/ctx"
+
interface FolderContentOptions {
/**
* Whether to display number of folders
@@ -25,31 +26,11 @@
export default ((opts?: Partial<FolderContentOptions>) => {
const options: FolderContentOptions = { ...defaultOptions, ...opts }
- let trie: FileTrieNode<
- QuartzPluginData & {
- slug: string
- title: string
- filePath: string
- }
- >
const FolderContent: QuartzComponent = (props: QuartzComponentProps) => {
const { tree, fileData, allFiles, cfg } = props
- if (!trie) {
- trie = new FileTrieNode([])
- allFiles.forEach((file) => {
- if (file.frontmatter) {
- trie.add({
- ...file,
- slug: file.slug!,
- title: file.frontmatter.title,
- filePath: file.filePath!,
- })
- }
- })
- }
-
+ const trie = (props.ctx.trie ??= trieFromAllFiles(allFiles))
const folder = trie.findNode(fileData.slug!.split("/"))
if (!folder) {
return null
@@ -71,7 +52,7 @@
if (child.data?.dates) {
// compare all dates and assign to maybeDates if its more recent or its not set
if (!maybeDates) {
- maybeDates = child.data.dates
+ maybeDates = { ...child.data.dates }
} else {
if (child.data.dates.created > maybeDates.created) {
maybeDates.created = child.data.dates.created
--
Gitblit v1.10.0