| | |
| | | import { CanonicalSlug, canonicalizeServer, resolveRelative } from "../util/path" |
| | | import { FullSlug, resolveRelative } from "../util/path" |
| | | import { QuartzPluginData } from "../plugins/vfile" |
| | | import { Date } from "./Date" |
| | | import { QuartzComponentProps } from "./types" |
| | |
| | | } & 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) |
| | |
| | | <ul class="section-ul"> |
| | | {list.map((page) => { |
| | | const title = page.frontmatter?.title |
| | | const pageSlug = canonicalizeServer(page.slug!) |
| | | const tags = page.frontmatter?.tags ?? [] |
| | | |
| | | return ( |
| | |
| | | )} |
| | | <div class="desc"> |
| | | <h3> |
| | | <a href={resolveRelative(slug, pageSlug)} class="internal"> |
| | | <a href={resolveRelative(fileData.slug!, page.slug!)} class="internal"> |
| | | {title} |
| | | </a> |
| | | </h3> |
| | |
| | | <li> |
| | | <a |
| | | class="internal tag-link" |
| | | href={resolveRelative(slug, `tags/${tag}` as CanonicalSlug)} |
| | | href={resolveRelative(fileData.slug!, `tags/${tag}/index` as FullSlug)} |
| | | > |
| | | #{tag} |
| | | </a> |