feat(RecentNotes): add showDescription option to display note descriptions

This commit is contained in:
Alexey Chernyavskiy 2025-07-20 12:22:42 +05:00
parent 059848f8b0
commit 539b928a68
No known key found for this signature in database
GPG Key ID: 402AE34C2F14446E

View File

@ -13,6 +13,7 @@ interface Options {
limit: number limit: number
linkToMore: SimpleSlug | false linkToMore: SimpleSlug | false
showTags: boolean showTags: boolean
showDescription: boolean
filter: (f: QuartzPluginData) => boolean filter: (f: QuartzPluginData) => boolean
sort: (f1: QuartzPluginData, f2: QuartzPluginData) => number sort: (f1: QuartzPluginData, f2: QuartzPluginData) => number
} }
@ -21,6 +22,7 @@ const defaultOptions = (cfg: GlobalConfiguration): Options => ({
limit: 3, limit: 3,
linkToMore: false, linkToMore: false,
showTags: true, showTags: true,
showDescription: false,
filter: () => true, filter: () => true,
sort: byDateAndAlphabetical(cfg), sort: byDateAndAlphabetical(cfg),
}) })
@ -72,6 +74,12 @@ export default ((userOpts?: Partial<Options>) => {
))} ))}
</ul> </ul>
)} )}
{opts.showDescription && page.frontmatter?.description && (
<p class="description">
{page.frontmatter.description}
</p>
)}
</div> </div>
</li> </li>
) )