From 4a6a44950fbfb8cf0e60b62254fc38404c35a1b8 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sun, 11 Feb 2024 19:26:24 +0000
Subject: [PATCH] fix(breadcrumbs): folder index by full path rather than folder name (closes #676)
---
quartz/components/RecentNotes.tsx | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/quartz/components/RecentNotes.tsx b/quartz/components/RecentNotes.tsx
index 81b354d..f8f6de4 100644
--- a/quartz/components/RecentNotes.tsx
+++ b/quartz/components/RecentNotes.tsx
@@ -5,10 +5,11 @@
import style from "./styles/recentNotes.scss"
import { Date, getDate } from "./Date"
import { GlobalConfiguration } from "../cfg"
+import { i18n } from "../i18n"
import { classNames } from "../util/lang"
interface Options {
- title: string
+ title?: string
limit: number
linkToMore: SimpleSlug | false
filter: (f: QuartzPluginData) => boolean
@@ -16,7 +17,6 @@
}
const defaultOptions = (cfg: GlobalConfiguration): Options => ({
- title: "Recent Notes",
limit: 3,
linkToMore: false,
filter: () => true,
@@ -30,10 +30,10 @@
const remaining = Math.max(0, pages.length - opts.limit)
return (
<div class={classNames(displayClass, "recent-notes")}>
- <h3>{opts.title}</h3>
+ <h3>{opts.title ?? i18n(cfg.locale).components.recentNotes.title}</h3>
<ul class="recent-ul">
{pages.slice(0, opts.limit).map((page) => {
- const title = page.frontmatter?.title
+ const title = page.frontmatter?.title ?? i18n(cfg.locale).propertyDefaults.title
const tags = page.frontmatter?.tags ?? []
return (
@@ -70,7 +70,9 @@
</ul>
{opts.linkToMore && remaining > 0 && (
<p>
- <a href={resolveRelative(fileData.slug!, opts.linkToMore)}>See {remaining} more →</a>
+ <a href={resolveRelative(fileData.slug!, opts.linkToMore)}>
+ {i18n(cfg.locale).components.recentNotes.seeRemainingMore({ remaining })}
+ </a>
</p>
)}
</div>
--
Gitblit v1.10.0