From 1906d2dd201d2c30b4c2be9b906d6ea78fde9c6c Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Wed, 16 Jul 2025 08:40:24 -0500 Subject: [PATCH] Only log non-0 static generation --- src/app/static.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app/static.ts b/src/app/static.ts index 67b2c1dd..3c9d0e43 100644 --- a/src/app/static.ts +++ b/src/app/static.ts @@ -15,8 +15,10 @@ import { depluralize, pluralize } from '@/utility/string'; type StaticOutput = 'page' | 'image'; const logStaticGenerationDetails = (count: number, content: string) => { - const label = pluralize(count, content, undefined, 3); - console.log(`> Statically generating ${label} ...`); + if (count > 0) { + const label = pluralize(count, content, undefined, 3); + console.log(`> Statically generating ${label} ...`); + } }; export const staticallyGeneratePhotosIfConfigured = (type: StaticOutput) => @@ -25,7 +27,7 @@ export const staticallyGeneratePhotosIfConfigured = (type: StaticOutput) => (type === 'image' && STATICALLY_OPTIMIZED_PHOTO_OG_IMAGES) ) ? async () => { - const photos = await getPublicPhotoIds({ + const photoIds = await getPublicPhotoIds({ limit: GENERATE_STATIC_PARAMS_LIMIT, }) .catch(e => { @@ -33,9 +35,9 @@ export const staticallyGeneratePhotosIfConfigured = (type: StaticOutput) => return []; }); if (IS_BUILDING) { - logStaticGenerationDetails(photos.length, `photo ${type}`); + logStaticGenerationDetails(photoIds.length, `photo ${type}`); } - return photos.map(photoId => ({ photoId })); + return photoIds.map(photoId => ({ photoId })); } : undefined;