mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-23 12:54:06 -06:00
feat(RecentNotes): add showDescription option to display note descriptions
This commit is contained in:
parent
059848f8b0
commit
539b928a68
@ -13,6 +13,7 @@ interface Options {
|
||||
limit: number
|
||||
linkToMore: SimpleSlug | false
|
||||
showTags: boolean
|
||||
showDescription: boolean
|
||||
filter: (f: QuartzPluginData) => boolean
|
||||
sort: (f1: QuartzPluginData, f2: QuartzPluginData) => number
|
||||
}
|
||||
@ -21,6 +22,7 @@ const defaultOptions = (cfg: GlobalConfiguration): Options => ({
|
||||
limit: 3,
|
||||
linkToMore: false,
|
||||
showTags: true,
|
||||
showDescription: false,
|
||||
filter: () => true,
|
||||
sort: byDateAndAlphabetical(cfg),
|
||||
})
|
||||
@ -72,6 +74,12 @@ export default ((userOpts?: Partial<Options>) => {
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
|
||||
{opts.showDescription && page.frontmatter?.description && (
|
||||
<p class="description">
|
||||
{page.frontmatter.description}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user