mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-07-11 18:56:14 +09:00
Merge pull request #1 from 10h30/feat/add-modified-date
add modifiedDate field to parser and frontmatter
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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
@@ -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',
|
||||||
|
|||||||
Reference in New Issue
Block a user