Jacky Zhao
2023-07-24 e82ba97a396e4e9d77486b48e6ee8b1dfd1c1b4c
quartz/components/ReadingTime.tsx
@@ -3,10 +3,13 @@
function ReadingTime({ fileData }: QuartzComponentProps) {
  const text = fileData.text
  const isHomePage = fileData.slug === "index"
  if (text && !isHomePage) {
  if (text) {
    const { text: timeTaken, words } = readingTime(text)
    return <p class="reading-time">{words} words, {timeTaken}</p>
    return (
      <p class="reading-time">
        {words} words, {timeTaken}
      </p>
    )
  } else {
    return null
  }
@@ -15,7 +18,7 @@
ReadingTime.css = `
.reading-time {
  margin-top: 0;
  opacity: 0.5;
  color: var(--gray);
}
`