fuck my butthole pls

This commit is contained in:
rattatwinko
2025-06-16 20:10:14 +02:00
parent 500695d471
commit 1303078c2e
4 changed files with 163 additions and 40 deletions

View File

@@ -7,6 +7,14 @@ import html from 'remark-html';
const postsDirectory = path.join(process.cwd(), 'posts');
const pinnedPath = path.join(postsDirectory, 'pinned.json');
let pinnedSlugs: string[] = [];
if (fs.existsSync(pinnedPath)) {
try {
pinnedSlugs = JSON.parse(fs.readFileSync(pinnedPath, 'utf8'));
} catch {}
}
// Function to get file creation date
function getFileCreationDate(filePath: string): Date {
const stats = fs.statSync(filePath);
@@ -27,6 +35,7 @@ async function getPostByPath(filePath: string, relPath: string) {
summary: data.summary,
content: processedContent.toString(),
createdAt: createdAt.toISOString(),
pinned: pinnedSlugs.includes(relPath.replace(/\.md$/, '')),
};
}