The Trans Directory
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix description not being used in folder and tag listings

+12 -4
+6 -2
quartz/components/pages/FolderContent.tsx
··· 6 6 import style from "../styles/listPage.scss" 7 7 import { PageList } from "../PageList" 8 8 import { _stripSlashes, simplifySlug } from "../../util/path" 9 + import { Root } from "hast" 9 10 10 11 function FolderContent(props: QuartzComponentProps) { 11 12 const { tree, fileData, allFiles } = props ··· 24 25 allFiles: allPagesInFolder, 25 26 } 26 27 27 - // @ts-ignore 28 - const content = toJsxRuntime(tree, { Fragment, jsx, jsxs, elementAttributeNameCase: "html" }) 28 + const content = (tree as Root).children.length === 0 ? 29 + fileData.description : 30 + // @ts-ignore 31 + toJsxRuntime(tree, { Fragment, jsx, jsxs, elementAttributeNameCase: "html" }) 32 + 29 33 return ( 30 34 <div class="popover-hint"> 31 35 <article>{content}</article>
+6 -2
quartz/components/pages/TagContent.tsx
··· 5 5 import { PageList } from "../PageList" 6 6 import { FullSlug, getAllSegmentPrefixes, simplifySlug } from "../../util/path" 7 7 import { QuartzPluginData } from "../../plugins/vfile" 8 + import { Root } from "hast" 8 9 9 10 const numPages = 10 10 11 function TagContent(props: QuartzComponentProps) { ··· 21 22 (file.frontmatter?.tags ?? []).flatMap(getAllSegmentPrefixes).includes(tag), 22 23 ) 23 24 24 - // @ts-ignore 25 - const content = toJsxRuntime(tree, { Fragment, jsx, jsxs, elementAttributeNameCase: "html" }) 25 + const content = (tree as Root).children.length === 0 ? 26 + fileData.description : 27 + // @ts-ignore 28 + toJsxRuntime(tree, { Fragment, jsx, jsxs, elementAttributeNameCase: "html" }) 29 + 26 30 if (tag === "") { 27 31 const tags = [...new Set(allFiles.flatMap((data) => data.frontmatter?.tags ?? []))] 28 32 const tagItemMap: Map<string, QuartzPluginData[]> = new Map()