Correctly handle wordpressdotcom drafts#213
Merged
parkr merged 3 commits intojekyll:masterfrom Aug 16, 2015
danbernier:correctly-handle-wordpressdotcom-drafts
Merged
Correctly handle wordpressdotcom drafts#213parkr merged 3 commits intojekyll:masterfrom danbernier:correctly-handle-wordpressdotcom-drafts
parkr merged 3 commits intojekyll:masterfrom
danbernier:correctly-handle-wordpressdotcom-drafts
Conversation
We'll add an 'item' local variable back soon.
* Store them in ./_drafts, not ./_posts * Don't prepend the date to the filename
Member
|
One of the best PR's ever! Some room for optimizations but looks solid to me! Thanks :) |
parkr
added a commit
that referenced
this pull request
Aug 16, 2015
parkr
added a commit
that referenced
this pull request
Aug 16, 2015
* danbernier-correctly-handle-wordpressdotcom-drafts: Clean up WordpressDotCom::Item usage a bit. /cc #213 Correctly handle draft posts. Wrap WP's item nodes in an Item, that can extract its data. Rename block var from `item` to `node`.
Contributor
Author
|
You're welcome! It's a common refactoring I use :) Glad you memoized the methods, I'm surprised I forgot to do that. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When importing an unpublished draft from wordpress.com, jekyll-import was raising an exception trying to parse its published date, which is set to
0000-00-00 00:00:00. It was using this to prepend the publish-date to the filename in./_posts.This pull request changes the WordpressDotCom import so that:
./_draftsinstead of./_postsI also added a bunch of test coverage for the WordpressDotCom importer, mostly by pulling lots of logic into a separate class,
JekyllImport::Importers::WordpressDotCom::Item, and constructing those with specific XML. The actual writing of files is still untested, but there's less going on there now.