@@ -3,33 +3,10 @@ import { getCollection } from "astro:content";
33import FeaturedCarousel from " ./FeaturedCarousel" ;
44import Container from " ./container.astro" ;
55
6- // Import necessary modules
7- import fs from ' fs' ;
8- import path from ' path' ;
9-
10- // Define the path to the software content directory
11- const softwareDir = path .resolve (' ./src/content/software' );
12-
13- // Read the files in the directory
14- const files = fs .readdirSync (softwareDir );
15-
16- // Get file creation times and sort files by creation date
17- const recentFiles = files
18- .map (file => ({
19- name: file ,
20- time: fs .statSync (path .join (softwareDir , file )).birthtime
21- }))
22- .sort ((a , b ) => b .time - a .time ) // Sort by creation time, newest first
23- .slice (0 , 3 ) // Pick the top 3 most recent files
24- .map (file => file .name .replace (/ \. [^ /. ] + $ / , " " )); // Remove file extension
25-
26- // Populate the featuredEntriestags variable with recent file names
27- const featuredEntriestags = recentFiles ;
6+ const softwareEntries = await getCollection (" software" );
287
29- // Log the featured entries tags
30- console .log (" Recent Entries:" , featuredEntriestags );
8+ const featuredEntriestags = [" beeceptor" , " keploy" , " hatchfast" ];
319
32- const softwareEntries = await getCollection (" software" );
3310const featuredEntries = softwareEntries .filter ((entry ) =>
3411 featuredEntriestags .includes (entry .id )
3512);
0 commit comments