Skip to content

Commit

Permalink
posts should now merge with normal pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Simaris committed Jun 3, 2019
1 parent 46c890c commit 64e62ea
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions lib/jekyll/helper/rdf_generator_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,26 @@ def extract_list_resources path
result
end

def assimilate_pages(page, pages)
pages.map!{|old_page|
if (old_page.url.chomp('.html') == page.url.chomp('.html'))
changes||=true
page.assimilate_page(old_page)
page
else
old_page
end
}
end

def create_page(site, resource, mapper)
Jekyll::JekyllRdf::Helper::RdfPageHelper.prepare_resource resource, mapper
page = Jekyll::Page.new(site, site.source, resource.filedir, resource.filename)
page.re_init_as_rdf(resource, mapper)
if(page.complete)
changes = false
site.pages.map!{|old_page|
if (old_page.url.chomp('.html') == page.url.chomp('.html'))
changes||=true
page.assimilate_page(old_page)
page
else
old_page
end
}
assimilate_pages(page, site.pages)
assimilate_pages(page, site.posts.docs)
unless changes
site.pages << page
end
Expand Down

0 comments on commit 64e62ea

Please sign in to comment.