Open pauldambra opened 7 years ago
Sounds good! I'd be happy to test the parallelization and accept the PR.
Cool. Might be the weekend before I get to take a proper look...
On Tue, 28 Mar 2017, 08:05 Juuso Mikkonen, notifications@github.com wrote:
Sounds good! I'd be happy to test the parallelization and accept the PR.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/juusaw/amp-jekyll/issues/25#issuecomment-289682255, or mute the thread https://github.com/notifications/unsubscribe-auth/AA8G8UDQiPV60bnEduqUukThFPVo8ciFks5rqLEmgaJpZM4Ml9bN .
Just looking at adding this and having to include changes made here since I copied the files for my blog...
One of the changes added a layout:amp
to the top of the AMP layout
---
layout: amp
---
<!doctype html>
<html amp lang="en">
but that just causes warnings and doesn't render anything for me...
Build Warning: Layout 'amp' requested in amp/2016/yarn/index.html does not exist.
I think I must be misunderstanding something..?
Hi, did you update all the changed files before applying your updates? I managed to get the threaded version working from the latest version of master
.
class AmpGenerator < Generator
priority :low
def generate(site)
dir = site.config['ampdir'] || 'amp'
threads = site.posts.docs.map do |post|
next if post.data['skip_amp'] == true
Thread.new do
site.pages << AmpPost.new(site, site.source, File.join(dir, post.id), post)
end
end
ThreadsWait.all_waits(*threads)
end
end
:) It's worked for me without the skip for many builds now. If it's working for you too then was doing too many things at once this morning... I must have done something silly
Thanks for this plugin!
I found builds were taking 18 seconds for me.
I amended the main loop to start a new thread for each AmpPost to be generated and then wait for them all to finish.
That took my build from 18 seconds down to 7 seconds.
Happy to open a PR if you like?