mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-19 14:19:16 +00:00
feat: ability to hide tags in the recent notes component (#1147)
* feat: ability to hide tags in the recent notes component * docs: recent notes custom parameters in a table * docs: revert recent notes doc to bullet points * fix: linter issues * Update docs/features/recent notes.md --------- Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>
This commit is contained in:
parent
cf1b3f270b
commit
81a4e20236
2 changed files with 17 additions and 12 deletions
quartz/components
|
@ -12,6 +12,7 @@ interface Options {
|
|||
title?: string
|
||||
limit: number
|
||||
linkToMore: SimpleSlug | false
|
||||
showTags: boolean
|
||||
filter: (f: QuartzPluginData) => boolean
|
||||
sort: (f1: QuartzPluginData, f2: QuartzPluginData) => number
|
||||
}
|
||||
|
@ -19,6 +20,7 @@ interface Options {
|
|||
const defaultOptions = (cfg: GlobalConfiguration): Options => ({
|
||||
limit: 3,
|
||||
linkToMore: false,
|
||||
showTags: true,
|
||||
filter: () => true,
|
||||
sort: byDateAndAlphabetical(cfg),
|
||||
})
|
||||
|
@ -56,18 +58,20 @@ export default ((userOpts?: Partial<Options>) => {
|
|||
<Date date={getDate(cfg, page)!} locale={cfg.locale} />
|
||||
</p>
|
||||
)}
|
||||
<ul class="tags">
|
||||
{tags.map((tag) => (
|
||||
<li>
|
||||
<a
|
||||
class="internal tag-link"
|
||||
href={resolveRelative(fileData.slug!, `tags/${tag}` as FullSlug)}
|
||||
>
|
||||
{tag}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
{opts.showTags && (
|
||||
<ul class="tags">
|
||||
{tags.map((tag) => (
|
||||
<li>
|
||||
<a
|
||||
class="internal tag-link"
|
||||
href={resolveRelative(fileData.slug!, `tags/${tag}` as FullSlug)}
|
||||
>
|
||||
{tag}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue