mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-07-20 07:04:14 +09:00
Stuff for drafts, handling missing slugs and dates
This commit is contained in:
+6
-1
@@ -24,11 +24,16 @@ export function coverImage(post) {
|
||||
}
|
||||
|
||||
// get post date, previously saved as a luxon datetime object on post
|
||||
// this value is also used for year/month folders, date prefixes, etc. as needed
|
||||
export function date(post) {
|
||||
return post.date;
|
||||
}
|
||||
|
||||
// get boolean indicating if post is a draft
|
||||
// this will only be included if true, otherwise it's left off
|
||||
export function draft(post) {
|
||||
return post.isDraft ? true : undefined;
|
||||
}
|
||||
|
||||
// get excerpt, not decoded, newlines collapsed
|
||||
export function excerpt(post) {
|
||||
return post.data.encoded[1].replace(/[\r\n]+/gm, ' ');
|
||||
|
||||
Reference in New Issue
Block a user