mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-23 21:04:07 -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
|
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>
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user