Open mdaizcorbe opened 7 years ago
What version of Ruby, Jekyll etc. are you using? This plugin is in use on client websites right now and working...
I have been meaning to release a new version using hooks instead of a generator, just haven't gotten around to it yet.
I'm using the following on Windows 7: ruby 2.3.3p222 (2016-11-21 revision 56859) [x64-mingw32] jekyll 3.1.6
I'm not sure what the difference is between site.pages and site.documents but I could imagine if the content to be put into the pdf is in site.documents then this wouldn't be an issue.
I am also experiencing this issue when trying to generate a PDF for a page
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16] Jekyll 3.4.3
There seems to be a fix for this in one of the forks https://github.com/magento-mcom/jekyll-pdf/commit/f6b6f9a439a18c8ca61d2abdb773f9ad4349a869
see https://github.com/abeMedia/jekyll-pdf/issues/24
it also contains mlenkeit's fix for this issue
The following line in generator.rb causes an infinite loop since it is appending an item to the array it is iterating on that meets the condition:
site.pages << Document.new(site, site.source, item) if item.data['pdf']
I found that prepending the item instead seemed to have the desired effect.