From 4db87316ac841e33b395e89ca3978d6ec667f2fc Mon Sep 17 00:00:00 2001 From: Jason <123jasont@gmail.com> Date: Wed, 1 Nov 2023 10:37:09 -0700 Subject: [PATCH] revert: i hate this --- layouts/PostSimple.tsx | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/layouts/PostSimple.tsx b/layouts/PostSimple.tsx index fdbab97..d6caa6d 100644 --- a/layouts/PostSimple.tsx +++ b/layouts/PostSimple.tsx @@ -1,6 +1,5 @@ 'use client' -import Comments from '@/components/Comments' import Image from '@/components/Image' import Link from '@/components/Link' import PageTitle from '@/components/PageTitle' @@ -13,7 +12,6 @@ import NextImage from 'next/image' import { CoreContent } from 'pliny/utils/contentlayer' import { formatDate } from 'pliny/utils/formatDate' import { ReactNode, useState } from 'react' -import { Redis } from "@upstash/redis" interface LayoutProps { content: CoreContent @@ -23,13 +21,8 @@ interface LayoutProps { prev?: { path: string; title: string } } -const redis = Redis.fromEnv() - -export const revalidate = 60 - -export default async function PostLayout({ content, authorDetails, next, prev, children }: LayoutProps) { +export default function PostLayout({ content, authorDetails, next, prev, children }: LayoutProps) { const { path, slug, tags, date, title, thumbnail } = content - const views = (await redis.get(["pageviews", "projects", slug].join(":"))) ?? 0; const displayThumbnail = thumbnail ? thumbnail : '/static/images/twitter-card.png' const [isLoading, setIsLoading] = useState(true) @@ -67,14 +60,6 @@ export default async function PostLayout({ content, authorDetails, next, prev, c - {views > 0 && ( - - - {views.toLocaleString()} - {" "} - views - - )}