From 64e62ead5569f3f2a54777c3192d3135faadd9d0 Mon Sep 17 00:00:00 2001 From: username Date: Mon, 3 Jun 2019 18:10:47 +0200 Subject: [PATCH] posts should now merge with normal pages --- lib/jekyll/helper/rdf_generator_helper.rb | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/lib/jekyll/helper/rdf_generator_helper.rb b/lib/jekyll/helper/rdf_generator_helper.rb index 28e57214..b04989f5 100644 --- a/lib/jekyll/helper/rdf_generator_helper.rb +++ b/lib/jekyll/helper/rdf_generator_helper.rb @@ -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