1+ import type { PaginateFunction } from 'astro' ;
12import { getCollection } from 'astro:content' ;
23import type { CollectionEntry } from 'astro:content' ;
34import type { Post } from '~/types' ;
@@ -162,7 +163,7 @@ export const findLatestPosts = async ({ count }: { count?: number }): Promise<Ar
162163} ;
163164
164165/** */
165- export const getStaticPathsBlogList = async ( { paginate } ) => {
166+ export const getStaticPathsBlogList = async ( { paginate } : { paginate : PaginateFunction } ) => {
166167 if ( ! isBlogEnabled || ! isBlogListRouteEnabled ) return [ ] ;
167168 return paginate ( await fetchPosts ( ) , {
168169 params : { blog : BLOG_BASE || undefined } ,
@@ -182,16 +183,16 @@ export const getStaticPathsBlogPost = async () => {
182183} ;
183184
184185/** */
185- export const getStaticPathsBlogCategory = async ( { paginate } ) => {
186+ export const getStaticPathsBlogCategory = async ( { paginate } : { paginate : PaginateFunction } ) => {
186187 if ( ! isBlogEnabled || ! isBlogCategoryRouteEnabled ) return [ ] ;
187188
188189 const posts = await fetchPosts ( ) ;
189- const categories = new Set ( ) ;
190+ const categories = new Set < string > ( ) ;
190191 posts . map ( ( post ) => {
191192 typeof post . category === 'string' && categories . add ( post . category . toLowerCase ( ) ) ;
192193 } ) ;
193194
194- return Array . from ( categories ) . flatMap ( ( category : string ) =>
195+ return Array . from ( categories ) . flatMap ( ( category ) =>
195196 paginate (
196197 posts . filter ( ( post ) => typeof post . category === 'string' && category === post . category . toLowerCase ( ) ) ,
197198 {
@@ -204,16 +205,16 @@ export const getStaticPathsBlogCategory = async ({ paginate }) => {
204205} ;
205206
206207/** */
207- export const getStaticPathsBlogTag = async ( { paginate } ) => {
208+ export const getStaticPathsBlogTag = async ( { paginate } : { paginate : PaginateFunction } ) => {
208209 if ( ! isBlogEnabled || ! isBlogTagRouteEnabled ) return [ ] ;
209210
210211 const posts = await fetchPosts ( ) ;
211- const tags = new Set ( ) ;
212+ const tags = new Set < string > ( ) ;
212213 posts . map ( ( post ) => {
213214 Array . isArray ( post . tags ) && post . tags . map ( ( tag ) => tags . add ( tag . toLowerCase ( ) ) ) ;
214215 } ) ;
215216
216- return Array . from ( tags ) . flatMap ( ( tag : string ) =>
217+ return Array . from ( tags ) . flatMap ( ( tag ) =>
217218 paginate (
218219 posts . filter ( ( post ) => Array . isArray ( post . tags ) && post . tags . find ( ( elem ) => elem . toLowerCase ( ) === tag ) ) ,
219220 {
0 commit comments