From c2bea8a4c4aeba440b8a7b043d7ece6343a9d263 Mon Sep 17 00:00:00 2001
From: derfalx <kschneider@falx.tech>
Date: Thu, 08 Jan 2026 01:30:42 +0000
Subject: [PATCH] fix(citation): Language parameter for non en-US settings (#2075)
---
docs/advanced/creating components.md | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/docs/advanced/creating components.md b/docs/advanced/creating components.md
index 628d5aa..84e0380 100644
--- a/docs/advanced/creating components.md
+++ b/docs/advanced/creating components.md
@@ -161,6 +161,18 @@
})
```
+You can also add the equivalent of a `beforeunload` event for [[SPA Routing]] via the `prenav` event.
+
+```ts
+document.addEventListener("prenav", () => {
+ // executed after an SPA navigation is triggered but
+ // before the page is replaced
+ // one usage pattern is to store things in sessionStorage
+ // in the prenav and then conditionally load then in the consequent
+ // nav
+})
+```
+
It is best practice to track any event handlers via `window.addCleanup` to prevent memory leaks.
This will get called on page navigation.
@@ -214,9 +226,11 @@
As Quartz components are just functions that return React components, you can compositionally use them in other Quartz components.
```tsx title="quartz/components/AnotherComponent.tsx"
-import YourComponent from "./YourComponent"
+import YourComponentConstructor from "./YourComponent"
export default (() => {
+ const YourComponent = YourComponentConstructor()
+
function AnotherComponent(props: QuartzComponentProps) {
return (
<div>
--
Gitblit v1.10.0