diff --git a/quartz/components/ArticleTitle.tsx b/quartz/components/ArticleTitle.tsx index a286d363bde19..91d52f14fb624 100644 --- a/quartz/components/ArticleTitle.tsx +++ b/quartz/components/ArticleTitle.tsx @@ -5,7 +5,11 @@ import { QuartzComponentConstructor, QuartzComponentProps } from "./types"; export default ((opts?: Partial) => { function ArticleTitle(props: QuartzComponentProps) { const { displayClass, fileData } = props; - const title = fileData.frontmatter?.title; + let title = fileData.frontmatter?.title ?? fileData.slug; + if (title === "index") { + const path = fileData.slug?.split("/"); + title = path?.[path.length - 2].replaceAll("-", " ") ?? "index"; + } const iconType = (fileData.frontmatter?.icon as string) || opts?.default?.file; if (title) { if (!opts?.rootIconFolder || !iconType) { diff --git a/quartz/components/PageList.tsx b/quartz/components/PageList.tsx index b5e6de7e1a7ca..937ad752c6b10 100644 --- a/quartz/components/PageList.tsx +++ b/quartz/components/PageList.tsx @@ -41,10 +41,10 @@ export const PageList: QuartzComponent = ({ cfg, fileData, allFiles, limit }: Pr return (