add modifiedDate field to parser and frontmatter

This commit is contained in:
kura5
2026-02-20 13:22:43 +09:00
parent 1476e46ed5
commit d93b9cb936
3 changed files with 7 additions and 1 deletions
+5
View File
@@ -39,6 +39,11 @@ export function id(post) {
return parseInt(post.id);
}
export function modifiedDate(post) {
// previously parsed as a raw string (e.g. "2013-12-09 06:24:33"), may be undefined
return post.modifiedDate;
}
export function slug(post) {
// previously parsed and decoded
return post.slug;
+1
View File
@@ -98,6 +98,7 @@ function buildPost(data) {
isDraft: data.childValue('status') === 'draft',
slug: decodeURIComponent(data.childValue('post_name')),
date: getPostDate(data),
modifiedDate: data.optionalChildValue('post_modified'),
coverImageId: getPostMetaValue(data, '_thumbnail_id'),
// these are possibly set later in mergeImagesIntoPosts()
+1 -1
View File
@@ -110,7 +110,7 @@ export function load() {
name: 'frontmatter-fields',
type: 'list',
description: 'Frontmatter fields',
default: 'title,date,categories,tags,coverImage,draft'
default: 'title,date,modifiedDate,categories,tags,coverImage,draft'
},
{
name: 'request-delay',