New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wordpress Pages #137

Merged
merged 4 commits into from May 24, 2014

Conversation

Projects
None yet
3 participants
@quiddle
Contributor

quiddle commented Apr 24, 2014

Wordpress pages are currently intermingled with all of the blog posts. This change to the wordpress importer separates out pages into the correct directory structure with index.markdown files.

@@ -106,6 +106,27 @@ def self.process(opts)
px = options[:table_prefix]
page_name_list = {}

This comment has been minimized.

@quiddle

quiddle Apr 24, 2014

Contributor

Rather than recursively querying the DB on each Page to figure out the proper path, I decided to pre-build a list of all pages, along with their slugs/names and their parent IDs.

@quiddle

quiddle Apr 24, 2014

Contributor

Rather than recursively querying the DB on each Page to figure out the proper path, I decided to pre-build a list of all pages, along with their slugs/names and their parent IDs.

Removed unused call to post_parent column in the posts_query and the …
…rename parent_path function since it's functionality was no longer reflected in its name.
@parkr

View changes

Show outdated Hide outdated lib/jekyll-import/importers/wordpress.rb
@@ -284,8 +305,15 @@ def self.process_post(post, db, options)
'comments' => options[:comments] ? comments : nil,
}.delete_if { |k,v| v.nil? || v == '' }.to_yaml
if post[:type] == 'page'
filename = page_path(post[:id], page_name_list) << 'index.markdown'

This comment has been minimized.

@parkr

parkr May 23, 2014

Member

Let's use + here instead of <<.

@parkr

parkr May 23, 2014

Member

Let's use + here instead of <<.

@parkr

View changes

Show outdated Hide outdated lib/jekyll-import/importers/wordpress.rb
def self.page_path( page_id, page_name_list )
path = ''
if page_name_list.key?(page_id)
path = page_path(page_name_list[page_id][:parent],page_name_list) << page_name_list[page_id][:slug] << '/'

This comment has been minimized.

@parkr

parkr May 23, 2014

Member

Same here – please use + instead of <<, or interpolate.

@parkr

parkr May 23, 2014

Member

Same here – please use + instead of <<, or interpolate.

parkr added a commit that referenced this pull request May 24, 2014

@parkr parkr merged commit 169313d into jekyll:master May 24, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

parkr added a commit that referenced this pull request May 24, 2014

parkr added a commit that referenced this pull request May 24, 2014

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.