Merge pull request #1 from 10h30/feat/add-modified-date

add modifiedDate field to parser and frontmatter
This commit is contained in:
Thuan Bui
2026-03-12 11:17:10 +09:00
committed by GitHub
3 changed files with 7 additions and 1 deletions
+5
View File
@@ -39,6 +39,11 @@ export function id(post) {
return parseInt(post.id); 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) { export function slug(post) {
// previously parsed and decoded // previously parsed and decoded
return post.slug; return post.slug;
+1
View File
@@ -98,6 +98,7 @@ function buildPost(data) {
isDraft: data.childValue('status') === 'draft', isDraft: data.childValue('status') === 'draft',
slug: decodeURIComponent(data.childValue('post_name')), slug: decodeURIComponent(data.childValue('post_name')),
date: getPostDate(data), date: getPostDate(data),
modifiedDate: data.optionalChildValue('post_modified'),
coverImageId: getPostMetaValue(data, '_thumbnail_id'), coverImageId: getPostMetaValue(data, '_thumbnail_id'),
// these are possibly set later in mergeImagesIntoPosts() // these are possibly set later in mergeImagesIntoPosts()
+1 -1
View File
@@ -110,7 +110,7 @@ export function load() {
name: 'frontmatter-fields', name: 'frontmatter-fields',
type: 'list', type: 'list',
description: 'Frontmatter fields', description: 'Frontmatter fields',
default: 'title,date,categories,tags,coverImage,draft' default: 'title,date,modifiedDate,categories,tags,coverImage,draft'
}, },
{ {
name: 'request-delay', name: 'request-delay',