wordpress-export-to-markdown
wordpress-export-to-markdown copied to clipboard
Handle drafts
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?
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/
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:
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 astrue
, the generated markdown files
That's news to me! Mine were entirely missing. I do not use prefixdate however.