Adam Brangenberg
2023-07-31 cbae88fc4e9b98764cfccca2e85f265c4b894573
quartz/components/PageList.tsx
@@ -20,11 +20,20 @@
  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 ?? []
@@ -48,7 +57,7 @@
                {tags.map((tag) => (
                  <li>
                    <a
                      class="internal"
                      class="internal tag-link"
                      href={resolveRelative(slug, `tags/${tag}` as CanonicalSlug)}
                    >
                      #{tag}
@@ -68,4 +77,8 @@
.section h3 {
  margin: 0;
}
.section > .tags {
  margin: 0;
}
`