This commit is contained in:
@@ -2,10 +2,8 @@ import { parse } from "@retorquere/bibtex-parser";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
// Your existing path is correct.
|
||||
const bibliographyPath = path.join(process.cwd(), "content", "_bibliography.bib");
|
||||
|
||||
// --- FIX: Add `pdfAvailable` to the Publication interface ---
|
||||
export interface Publication {
|
||||
key: string;
|
||||
title: string;
|
||||
@@ -14,8 +12,8 @@ export interface Publication {
|
||||
year: string;
|
||||
bibtex: string;
|
||||
pdfUrl: string;
|
||||
url?: string; // Also make url optional to be safe
|
||||
pdfAvailable?: boolean; // This will hold the result of our check
|
||||
url?: string;
|
||||
pdfAvailable?: boolean;
|
||||
}
|
||||
|
||||
export function getPublicationsData(): Publication[] {
|
||||
@@ -59,7 +57,7 @@ export function getPublicationsData(): Publication[] {
|
||||
url: Array.isArray(entry.fields.url) ? entry.fields.url.join(" ") : entry.fields.url,
|
||||
bibtex: bibtexEntryString,
|
||||
pdfUrl: `/publications/${entry.key}.pdf`,
|
||||
pdfAvailable: pdfExists, // <-- Add the result here
|
||||
pdfAvailable: pdfExists,
|
||||
};
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user