wordpress-export-to-markdown icon indicating copy to clipboard operation
wordpress-export-to-markdown copied to clipboard

Handle drafts

Open robinmetral opened this issue 5 years ago • 3 comments

Hi,

First off, thanks for the AMAZING utility!

One small thing I've noticed is that if there are drafts in the XML export and prefixdate is set as true, the generated markdown files are named something like Invalid DateTime-my-blog-post.md (because drafts don't have a date by definition).

Maybe we could look into taking another flag to include (or not) drafts, and name any draft posts draft-my-blog-post.md as a fallback for the lack of date.

What do you think?

robinmetral avatar Jan 06 '20 17:01 robinmetral

Ah, good catch!

This probably affects other options like --yearfolders and --yearmonthfolders that need a date component. I don't think using "draft" will work there.

Maybe we could go with Jekyll's approach? Bottom of this page: https://jekyllrb.com/docs/posts/

lonekorean avatar Jan 08 '20 18:01 lonekorean

Ah nice, yes I think a draft directory should work! draft could also be included in the filename for people opting for a more "flat" export with --postfolders=false --prefixdate=true :slightly_smiling_face:

robinmetral avatar Jan 08 '20 20:01 robinmetral

I would prefer drafts to be contained in a completely separate hierarchy so I don't need to load them when searching published posts.

drafts in the XML export and prefixdate is set as true, the generated markdown files

That's news to me! Mine were entirely missing. I do not use prefixdate however.

ployt0 avatar Aug 23 '22 11:08 ployt0