From d794500cd97eee8fa3065bcecdc08ea71704e7b7 Mon Sep 17 00:00:00 2001 From: Valery Melou Date: Sun, 28 Jul 2024 09:22:52 +0100 Subject: [PATCH] fix: build to use publishedAt insted of createdAt --- libs/blog/feature-article/src/lib/blog-article.component.html | 2 +- libs/blog/tasks/src/lib/executor.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/blog/feature-article/src/lib/blog-article.component.html b/libs/blog/feature-article/src/lib/blog-article.component.html index 8a4f164..9e0c33c 100644 --- a/libs/blog/feature-article/src/lib/blog-article.component.html +++ b/libs/blog/feature-article/src/lib/blog-article.component.html @@ -30,7 +30,7 @@ } -
+

= async (options) => { const defaultQuery: { [key: string]: string } = { content_type: 'article', limit: options.limit?.toString() ?? '10', - order: options.order ?? '-sys.createdAt', + order: options.order ?? '-fields.publishedAt', }; const entries = await cdaClient.getEntries(defaultQuery); const routes = entries.items.map( (entry) => - `/blog/${entry.sys.createdAt.split('T')[0]}-${entry.fields['slug']}`, + `/blog/${(entry.fields['publishedAt'] as string).split('T')[0]}-${entry.fields['slug']}`, ); const routesString = routes.join('\n');