Skip to content

Commit 1f1c66c

Browse files
committed
Revert "Feature: Recently added entries are featured on the homepage."
This reverts commit bc4fe87.
1 parent 86ad106 commit 1f1c66c

File tree

1 file changed

+2
-25
lines changed

1 file changed

+2
-25
lines changed

src/components/spotlight.astro

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,10 @@ import { getCollection } from "astro:content";
33
import FeaturedCarousel from "./FeaturedCarousel";
44
import 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");
3310
const featuredEntries = softwareEntries.filter((entry) =>
3411
featuredEntriestags.includes(entry.id)
3512
);

0 commit comments

Comments
 (0)