From 1bb00e72bb4ab8fcac186ef6961e400c60fb07de Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sun, 20 Aug 2023 13:00:33 -0700 Subject: [PATCH] add docs for recent notes --- content/features/recent notes.md | 16 ++++++++++++++++ content/features/upcoming features.md | 1 - 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 content/features/recent notes.md diff --git a/content/features/recent notes.md b/content/features/recent notes.md new file mode 100644 index 0000000..439d6d0 --- /dev/null +++ b/content/features/recent notes.md @@ -0,0 +1,16 @@ +--- +title: Recent Notes +tags: component +--- + +Quartz can generate a list of recent notes for based on some filtering and sorting criteria. Though this component isn't included in any [[layout]] by default, you can add it by using `Component.RecentNotes`. + +## Customization + +- Changing the title from "Recent notes": pass in an additional parameter to `Component.RecentNotes({ title: "Recent writing" })` +- Changing the number of recent notes: pass in an additional parameter to `Component.RecentNotes({ limit: 5 })` +- Show a 'see more' link: pass in an additional parameter to `Component.RecentNotes({ linkToMore: "tags/components" })`. This field should be a full slug to a page that exists. +- Customize filtering: pass in an additional parameter to `Component.RecentNotes({ filter: someFilterFunction })`. The filter function should be a function that has the signature `(f: QuartzPluginData) => boolean`. +- Customize sorting: pass in an additional parameter to `Component.RecentNotes({ sort: someSortFunction })`. By default, Quartz will sort by date and then tie break lexographically. The sort function should be a function that has the signature `(f1: QuartzPluginData, f2: QuartzPluginData) => number`. See `byDateAndAlphabetical` in `quartz/components/PageList.tsx` for an example. +- Component: `quartz/components/RecentNotes.tsx` +- Style: `quartz/components/styles/recentNotes.scss` diff --git a/content/features/upcoming features.md b/content/features/upcoming features.md index a3f44be..fbfdbc9 100644 --- a/content/features/upcoming features.md +++ b/content/features/upcoming features.md @@ -13,7 +13,6 @@ draft: true - breadcrumbs component - filetree component -- recent notes component - cursor chat extension - https://giscus.app/ extension - sidenotes? https://github.com/capnfabs/paperesque