refactor: move pubDate to date in posts front matter

This commit is contained in:
草师傅 2025-08-11 17:44:56 +08:00
parent 123da1747f
commit b2270003bd
Signed by: gb
GPG key ID: 43330A030E2D6478
15 changed files with 21 additions and 22 deletions

View file

@ -34,7 +34,7 @@ const author = Array.isArray(entry.data.author) ? entry.data.author : (entry.dat
const wordcount = remarkPluginFrontmatter.wordcount;
const lastUpdated = remarkPluginFrontmatter.lastModified;
const pubDate = new Date(entry.data.pubDate).toISOString().split('T')[0]
const pubDate = new Date(entry.data.date).toISOString().split('T')[0]
const lastUpdatedDate = new Date(lastUpdated).toISOString().split('T')[0]
// Get author data

View file

@ -11,7 +11,7 @@ export async function GET({ props }) {
const { entry } = props;
// Format the content as plain text
const title = entry.data.title;
const date = entry.data.pubDate.toISOString().split('T')[0];
const date = entry.data.date.toISOString().split('T')[0];
const content = entry.body;
// Combine the post info and body into a single text file