diff --git a/packages/marko-web-html-sitemap/templates/day.marko b/packages/marko-web-html-sitemap/templates/day.marko index 873bfe110..0f1e912c0 100644 --- a/packages/marko-web-html-sitemap/templates/day.marko +++ b/packages/marko-web-html-sitemap/templates/day.marko @@ -30,6 +30,7 @@ $ const pageNode = { { @@ -74,6 +76,7 @@ module.exports = async (apolloClient, { since: date(since), beginning: { after: date(beginningAfter), before: date(beginningBefore) }, ending: { after: date(endingAfter), before: date(endingBefore) }, + requiresIndexed, ...(publishedAfter && { after: date(publishedAfter) }), }; if (field || order) input.sort = { field, order }; diff --git a/services/graphql-server/src/graphql/definitions/platform/content/index.js b/services/graphql-server/src/graphql/definitions/platform/content/index.js index 05ce86810..2878a42ec 100644 --- a/services/graphql-server/src/graphql/definitions/platform/content/index.js +++ b/services/graphql-server/src/graphql/definitions/platform/content/index.js @@ -523,6 +523,8 @@ input AllPublishedContentQueryInput { sectionBubbling: Boolean = true "Adjusts the order items are returned in." sort: ContentSortInput = { field: published, order: desc } + "Whether or not the content needs to be indexed by a search engine" + requiresIndexed: Boolean = false "Adjust which subset of results should be returned." pagination: PaginationInput = {} "For types with a startDate field: Limit results to items with a startDate matching the criteria." diff --git a/services/graphql-server/src/graphql/resolvers/platform/content.js b/services/graphql-server/src/graphql/resolvers/platform/content.js index b212416e7..123dd7089 100644 --- a/services/graphql-server/src/graphql/resolvers/platform/content.js +++ b/services/graphql-server/src/graphql/resolvers/platform/content.js @@ -904,6 +904,7 @@ module.exports = { withSite, customAttributes, updated, + requiresIndexed, } = input; // @deprecated Prefer includeContentTypes over contentTypes. @@ -951,6 +952,9 @@ module.exports = { if (includeLabels.length) { query.labels = { $in: includeLabels }; } + if (requiresIndexed) { + query.$and.push({ $or: [{ 'mutations.Website.noIndex': { $exists: false } }, { 'mutations.Website.noIndex': false }] }); + } const projection = connectionProjection(info); return basedb.paginate('platform.Content', {