amp-jekyll icon indicating copy to clipboard operation
amp-jekyll copied to clipboard

Loop through collections

Open gbreux opened this issue 7 years ago • 0 comments

Hi there,

Would it be possible to also loop through all collections and pages instead of posts only?

I think it can be interesting :)

I tried to add

      site.collections.each do |collection|
        collection.docs.each do |post|
          next if post.data['skip_amp'] == true
          site.pages << AmpPost.new(site, site.source, File.join(dir, post.id), post)
        end
      end

But as my knowledge in ruby is super limited, it failed (collection.docs doesn't exist) so maybe you can see a better workaround?

Thanks

gbreux avatar May 04 '17 10:05 gbreux