Alq
2024-02-11 3518ca9e2a04f326eda25ada2393a4bbfde10738
quartz/components/ContentMeta.tsx
@@ -2,6 +2,7 @@
import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
import readingTime from "reading-time"
import { classNames } from "../util/lang"
import { i18n } from "../i18n"
interface ContentMetaOptions {
  /**
@@ -30,8 +31,11 @@
      // Display reading time if enabled
      if (options.showReadingTime) {
        const { text: timeTaken, words: _words } = readingTime(text)
        segments.push(timeTaken)
        const { minutes, words: _words } = readingTime(text)
        const displayedTime = i18n(cfg.locale).components.contentMeta.readingTime({
          minutes: Math.ceil(minutes),
        })
        segments.push(displayedTime)
      }
      return <p class={classNames(displayClass, "content-meta")}>{segments.join(", ")}</p>