fuck my butthole pls
This commit is contained in:
@@ -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$/, '')),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user