Class: Jekyll::AmpGenerator

Inherits:
Generator
  • Object
show all
Defined in:
lib/jekyll/amp_generate.rb

Overview

Generates a new AMP post for each existing post

Instance Method Summary collapse

Instance Method Details

#generate(site) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/jekyll/amp_generate.rb', line 32

def generate(site)
  dir = site.config['ampdir'] || 'amp'
  site.posts.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