upstream #1

Merged
jblu merged 1007 commits from upstream into main 2024-11-04 22:35:57 -06:00
Showing only changes of commit cc4e17d5b1 - Show all commits

View File

@ -23,6 +23,7 @@ import siteMetadata from './data/siteMetadata'
import { allCoreContent, sortPosts } from 'pliny/utils/contentlayer.js' import { allCoreContent, sortPosts } from 'pliny/utils/contentlayer.js'
const root = process.cwd() const root = process.cwd()
const isProduction = process.env.NODE_ENV === 'production'
const computedFields: ComputedFields = { const computedFields: ComputedFields = {
readingTime: { type: 'json', resolve: (doc) => readingTime(doc.body.raw) }, readingTime: { type: 'json', resolve: (doc) => readingTime(doc.body.raw) },
@ -47,7 +48,7 @@ const computedFields: ComputedFields = {
function createTagCount(allBlogs) { function createTagCount(allBlogs) {
const tagCount: Record<string, number> = {} const tagCount: Record<string, number> = {}
allBlogs.forEach((file) => { allBlogs.forEach((file) => {
if (file.tags && file.draft !== true) { if (file.tags && (!isProduction || file.draft !== true)) {
file.tags.forEach((tag) => { file.tags.forEach((tag) => {
const formattedTag = GithubSlugger.slug(tag) const formattedTag = GithubSlugger.slug(tag)
if (formattedTag in tagCount) { if (formattedTag in tagCount) {