File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,21 +9,11 @@ import ArwesBackground from '../../../components/ArwesBackground';
99import Pagination from ' ../../../components/Pagination.astro' ;
1010import { SITE_DESCRIPTION , SITE_TITLE } from ' ../../../consts' ;
1111
12- export async function getStaticPaths({ paginate }: any ) {
13- const posts = await getCollection (' blog' );
14- const tags = [... new Set (posts .flatMap (post => post .data .tags ))] as string [];
15-
16- return tags .flatMap ((tag ) => {
17- const tagPosts = posts .filter (post =>
18- post .data .tags .includes (tag )
19- ).sort ((a , b ) => b .data .pubDate .valueOf () - a .data .pubDate .valueOf ());
20-
21- return paginate (tagPosts , {
22- params: { tag: tag .toLowerCase ().replace (/ \s + / g , ' -' ) },
23- props: { tagName: tag },
24- pageSize: 6
25- });
26- });
12+ export async function getStaticPaths() {
13+ // This file was previously used for tag pages, but pagination now uses
14+ // the nested route at `src/pages/articles/tag/[tag]/[page].astro`.
15+ // Return no paths here to avoid duplicate/contradictory routes.
16+ return [];
2717}
2818
2919const { page, tagName }: any = Astro .props ;
You can’t perform that action at this time.
0 commit comments