404
{i18n(cfg.locale).pages.error.notFound}
+ {i18n(cfg.locale).pages.error.home}{segments.join(", ")}
+ const segmentsElements = segments.map((segment) => {segment}) + + return ( ++ {segmentsElements} +
+ ) } else { return null } } - ContentMetadata.css = ` - .content-meta { - margin-top: 0; - color: var(--gray); - } - ` + ContentMetadata.css = style + return ContentMetadata }) satisfies QuartzComponentConstructor diff --git a/quartz/components/Darkmode.tsx b/quartz/components/Darkmode.tsx index 62d3c23..8ed7c99 100644 --- a/quartz/components/Darkmode.tsx +++ b/quartz/components/Darkmode.tsx @@ -3,11 +3,11 @@ // see: https://v8.dev/features/modules#defer import darkmodeScript from "./scripts/darkmode.inline" import styles from "./styles/darkmode.scss" -import { QuartzComponentConstructor, QuartzComponentProps } from "./types" +import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types" import { i18n } from "../i18n" import { classNames } from "../util/lang" -function Darkmode({ displayClass, cfg }: QuartzComponentProps) { +const Darkmode: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => { return ({i18n(cfg.locale).pages.error.notFound}
+ {i18n(cfg.locale).pages.error.home}{content}
-
diff --git a/quartz/components/pages/TagContent.tsx b/quartz/components/pages/TagContent.tsx
index 19452ec..e41ab46 100644
--- a/quartz/components/pages/TagContent.tsx
+++ b/quartz/components/pages/TagContent.tsx
@@ -1,104 +1,127 @@
-import { QuartzComponentConstructor, QuartzComponentProps } from "../types"
+import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "../types"
import style from "../styles/listPage.scss"
-import { PageList } from "../PageList"
+import { PageList, SortFn } from "../PageList"
import { FullSlug, getAllSegmentPrefixes, simplifySlug } from "../../util/path"
import { QuartzPluginData } from "../../plugins/vfile"
import { Root } from "hast"
import { htmlToJsx } from "../../util/jsx"
import { i18n } from "../../i18n"
-const numPages = 10
-function TagContent(props: QuartzComponentProps) {
- const { tree, fileData, allFiles, cfg } = props
- const slug = fileData.slug
-
- if (!(slug?.startsWith("tags/") || slug === "tags")) {
- throw new Error(`Component "TagContent" tried to render a non-tag page: ${slug}`)
- }
-
- const tag = simplifySlug(slug.slice("tags/".length) as FullSlug)
- const allPagesWithTag = (tag: string) =>
- allFiles.filter((file) =>
- (file.frontmatter?.tags ?? []).flatMap(getAllSegmentPrefixes).includes(tag),
- )
-
- const content =
- (tree as Root).children.length === 0
- ? fileData.description
- : htmlToJsx(fileData.filePath!, tree)
- const cssClasses: string[] = fileData.frontmatter?.cssclasses ?? []
- const classes = ["popover-hint", ...cssClasses].join(" ")
- if (tag === "/") {
- const tags = [
- ...new Set(
- allFiles.flatMap((data) => data.frontmatter?.tags ?? []).flatMap(getAllSegmentPrefixes),
- ),
- ].sort((a, b) => a.localeCompare(b))
- const tagItemMap: Map {content} {i18n(cfg.locale).pages.tagContent.totalTags({ count: tags.length })} {content}
- {i18n(cfg.locale).pages.tagContent.itemsUnderTag({ count: pages.length })}
- {pages.length > numPages && (
-
- {i18n(cfg.locale).pages.tagContent.showingFirst({ count: numPages })}
-
- )}
- {i18n(cfg.locale).pages.tagContent.itemsUnderTag({ count: pages.length })} {content} {i18n(cfg.locale).pages.tagContent.totalTags({ count: tags.length })} {content}
+ {i18n(cfg.locale).pages.tagContent.itemsUnderTag({ count: pages.length })}
+ {pages.length > options.numPages && (
+ <>
+ {" "}
+
+ {i18n(cfg.locale).pages.tagContent.showingFirst({
+ count: options.numPages,
+ })}
+
+ >
+ )}
+ {i18n(cfg.locale).pages.tagContent.itemsUnderTag({ count: pages.length })}
-
- #{tag}
-
-
- {content &&
+
+ {tag}
+
+
+ {content &&
Transclude of ${url}${block}`, } @@ -328,7 +348,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin