diff --git a/packages/explorer/src/core/content/compute.mts b/packages/explorer/src/core/content/compute.mts index e6ebc183..95272745 100644 --- a/packages/explorer/src/core/content/compute.mts +++ b/packages/explorer/src/core/content/compute.mts @@ -109,8 +109,6 @@ const computeRemainingListingPages = async ( const translationOfWorkDocument = getDocumentByIdentifier( _d.translationOfWork['@id'] ); - console.log(_d.translationOfWork, translationOfWorkDocument); - if (translationOfWorkDocument?.isPartOf) { translationOfWork = { type: 'Id', diff --git a/packages/explorer/src/core/content/repositories/generated.mts b/packages/explorer/src/core/content/repositories/generated.mts index 264a624c..d21eb7d6 100644 --- a/packages/explorer/src/core/content/repositories/generated.mts +++ b/packages/explorer/src/core/content/repositories/generated.mts @@ -14,6 +14,8 @@ import type { RepositoryFilters, WebPageElementFilters } from './filters.mjs'; let _generated: ContentlayerDataExports; let _documents: Content[]; +const dateNow = new Date() + const documentsByLanguagesSelector = >(documents: T[]) => (inLanguages: string[]) => @@ -51,14 +53,16 @@ const getWebPageDocuments = async (): Promise => { const config = getConfig(); const generated = await getGenerated(); + const publishedDocuments = new Array() + .concat(generated.allPages || []) + .concat(generated.allArticles || []) + .concat(generated.allPeople || []) + .concat(generated.allPlaces || []) + .filter(_d => !_d.datePublished || new Date(_d.datePublished) <= dateNow); _documents = await computeDocuments({ config, websites: await getWebsites(), - documents: new Array() - .concat(generated.allPages || []) - .concat(generated.allArticles || []) - .concat(generated.allPeople || []) - .concat(generated.allPlaces || []), + documents: publishedDocuments, people: generated.allPeople || [], });