From 1da467d2143a260af8e5b7d2d2f68f0fcaa0260c Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sat, 05 Aug 2023 23:43:50 +0000
Subject: [PATCH] non-admonition callout fix

---
 quartz/components/PageList.tsx |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/quartz/components/PageList.tsx b/quartz/components/PageList.tsx
index 8ef40c5..7183acb 100644
--- a/quartz/components/PageList.tsx
+++ b/quartz/components/PageList.tsx
@@ -20,11 +20,20 @@
   return f1Title.localeCompare(f2Title)
 }
 
-export function PageList({ fileData, allFiles }: QuartzComponentProps) {
+type Props = {
+  limit?: number
+} & QuartzComponentProps
+
+export function PageList({ fileData, allFiles, limit }: Props) {
   const slug = canonicalizeServer(fileData.slug!)
+  let list = allFiles.sort(byDateAndAlphabetical)
+  if (limit) {
+    list = list.slice(0, limit)
+  }
+
   return (
     <ul class="section-ul">
-      {allFiles.sort(byDateAndAlphabetical).map((page) => {
+      {list.map((page) => {
         const title = page.frontmatter?.title
         const pageSlug = canonicalizeServer(page.slug!)
         const tags = page.frontmatter?.tags ?? []

--
Gitblit v1.10.0