From 73ce337a039ed7b58db6143dcd5822f59b410b21 Mon Sep 17 00:00:00 2001 From: LUCASTUCIOUS Date: Thu, 18 Jan 2024 18:13:10 +0100 Subject: [PATCH] hide reading time --- content | 2 +- quartz.layout.ts | 18 +++++++++++++++--- quartz/components/ContentMeta.tsx | 3 +-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/content b/content index dfb8464..e9762c3 160000 --- a/content +++ b/content @@ -1 +1 @@ -Subproject commit dfb8464c3e25b23cc01f4d2e82e21f4c7234284d +Subproject commit e9762c3f400dd60140a8b4912d7bd9d7b8bcd6cd diff --git a/quartz.layout.ts b/quartz.layout.ts index b5a1639..fac2e3b 100644 --- a/quartz.layout.ts +++ b/quartz.layout.ts @@ -16,9 +16,13 @@ export const sharedPageComponents: SharedLayout = { // components for pages that display a single page (e.g. a single note) export const defaultContentPageLayout: PageLayout = { beforeBody: [ - Component.Breadcrumbs(), + Component.Breadcrumbs({ + showCurrentPage: false, + }), Component.ArticleTitle(), - Component.ContentMeta(), + Component.ContentMeta({ + hideReadingTime: true, + }), Component.TagList(), ], left: [ @@ -37,7 +41,15 @@ export const defaultContentPageLayout: PageLayout = { // components for pages that display lists of pages (e.g. tags or folders) export const defaultListPageLayout: PageLayout = { - beforeBody: [Component.Breadcrumbs(), Component.ArticleTitle(), Component.ContentMeta()], + beforeBody: [ + Component.Breadcrumbs({ + showCurrentPage: false, + }), + Component.ArticleTitle(), + Component.ContentMeta({ + hideReadingTime: true, + }), + ], left: [ Component.PageTitle(), Component.MobileOnly(Component.Spacer()), diff --git a/quartz/components/ContentMeta.tsx b/quartz/components/ContentMeta.tsx index 9eb7eb4..5e9a3a0 100644 --- a/quartz/components/ContentMeta.tsx +++ b/quartz/components/ContentMeta.tsx @@ -15,7 +15,7 @@ interface ContentMetaOptions { } const defaultOptions: ContentMetaOptions = { - showReadingTime: true, + showReadingTime: false, showComma: true, } @@ -33,7 +33,6 @@ export default ((opts?: Partial) => { segments.push(formatDate(getDate(cfg, fileData)!, cfg.locale)) } - if (enabled !== false) { // Display reading time if enabled if (options.showReadingTime) { const { minutes, words: _words } = readingTime(text)