From fa6c02d3213dfd4e6da8e78bd3a2e7004555fd01 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Wed, 24 Jan 2024 01:08:56 +0000
Subject: [PATCH] fix: make search result card block

---
 quartz/plugins/emitters/404.tsx |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/quartz/plugins/emitters/404.tsx b/quartz/plugins/emitters/404.tsx
index 785c873..58ae59a 100644
--- a/quartz/plugins/emitters/404.tsx
+++ b/quartz/plugins/emitters/404.tsx
@@ -7,6 +7,7 @@
 import { sharedPageComponents } from "../../../quartz.layout"
 import { NotFound } from "../../components"
 import { defaultProcessedContent } from "../vfile"
+import { write } from "./helpers"
 
 export const NotFoundPage: QuartzEmitterPlugin = () => {
   const opts: FullPageLayout = {
@@ -25,10 +26,13 @@
     getQuartzComponents() {
       return [Head, Body, pageBody, Footer]
     },
-    async emit(ctx, _content, resources, emit): Promise<FilePath[]> {
+    async emit(ctx, _content, resources): Promise<FilePath[]> {
       const cfg = ctx.cfg.configuration
       const slug = "404" as FullSlug
-      const externalResources = pageResources(slug, resources)
+
+      const url = new URL(`https://${cfg.baseUrl ?? "example.com"}`)
+      const path = url.pathname as FullSlug
+      const externalResources = pageResources(path, resources)
       const [tree, vfile] = defaultProcessedContent({
         slug,
         text: "Not Found",
@@ -45,7 +49,8 @@
       }
 
       return [
-        await emit({
+        await write({
+          ctx,
           content: renderPage(slug, componentData, opts, externalResources),
           slug,
           ext: ".html",

--
Gitblit v1.10.0