mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-20 23:02:13 +00:00
nested tag support and tag index page
This commit is contained in:
parent
c0278a8c65
commit
cee2883c08
13 changed files with 125 additions and 37 deletions
quartz/components
|
@ -20,11 +20,20 @@ function byDateAndAlphabetical(f1: QuartzPluginData, f2: QuartzPluginData): numb
|
|||
return f1Title.localeCompare(f2Title)
|
||||
}
|
||||
|
||||
export function PageList({ fileData, allFiles }: QuartzComponentProps) {
|
||||
type Props = {
|
||||
limit?: number
|
||||
} & QuartzComponentProps
|
||||
|
||||
export function PageList({ fileData, allFiles, limit }: Props) {
|
||||
const slug = canonicalizeServer(fileData.slug!)
|
||||
let list = allFiles.sort(byDateAndAlphabetical)
|
||||
if (limit) {
|
||||
list = list.slice(0, limit)
|
||||
}
|
||||
|
||||
return (
|
||||
<ul class="section-ul">
|
||||
{allFiles.sort(byDateAndAlphabetical).map((page) => {
|
||||
{list.map((page) => {
|
||||
const title = page.frontmatter?.title
|
||||
const pageSlug = canonicalizeServer(page.slug!)
|
||||
const tags = page.frontmatter?.tags ?? []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue