mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-06-05 15:09:59 +09:00
add modifiedDate field to parser and frontmatter
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user