1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-26 14:28:25 -04:00

only count post hits on production site

This commit is contained in:
Jake Jarvis 2022-02-16 12:19:00 -05:00
parent 3edaa6b0e4
commit 416eb4b4cf
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39

View File

@ -56,12 +56,15 @@ const NoteMeta = ({ slug, date, title, tags = [] }: NoteMetaProps) => (
</a>
</div>
<div className={classNames(styles.meta_item, styles.views)}>
<span>
<ViewsIcon className={styles.icon} />
</span>
<HitCounter slug={`notes/${slug}`} />
</div>
{/* only count hits on production site */}
{process.env.NEXT_PUBLIC_VERCEL_ENV === "production" && (
<div className={classNames(styles.meta_item, styles.views)}>
<span>
<ViewsIcon className={styles.icon} />
</span>
<HitCounter slug={`notes/${slug}`} />
</div>
)}
</div>
);