Sha256: bc7c57f449437f89e1e900ef8d795df2d54ec9ad81ce2e7cf0c6f77841489023

Contents?: true

Size: 1.03 KB

Versions: 10

Compression:

Stored size: 1.03 KB

Contents

module Jekyll
  class PodcastPlayerPage < Page
    def initialize(site, base, dir, post)
      @site = site
      @base = base
      @dir  = dir
      @name = 'index.html'

      self.process(@name)
      self.read_yaml(File.join(base, '_layouts'), 'player_index.html')

      self.data['title']    = post.data['title']
      self.data['subtitle'] = post.data['subtitle']
      self.data['datum']    = post.data['datum']
      self.data['author']   = post.data['author']
      self.data['explicit'] = post.data['explicit']
      self.data['audio']    = post.data['audio']
      self.data['chapters'] = post.data['chapters']
      self.data['template'] = 'player_index'
    end
  end

  class PodcastPlayerPageGenerator < Generator
    safe true

    def generate(site)
      if site.layouts.key? 'player_index'
        dir =  site.config['players_dir'] || 'players'
        site.posts.docs.each do |post|
          site.pages << PodcastPlayerPage.new(site, site.source, File.join(dir, post.data['slug']), post)
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
jekyll-octopod-0.6.6 assets/_plugins/podcast_player_page_generator.rb
jekyll-octopod-0.6.5 assets/_plugins/podcast_player_page_generator.rb
jekyll-octopod-0.6.4 assets/_plugins/podcast_player_page_generator.rb
jekyll-octopod-0.6.3 assets/_plugins/podcast_player_page_generator.rb
jekyll-octopod-0.6.2 assets/_plugins/podcast_player_page_generator.rb
jekyll-octopod-0.6.1 assets/_plugins/podcast_player_page_generator.rb
jekyll-octopod-0.6.0 assets/_plugins/podcast_player_page_generator.rb
jekyll-octopod-0.5.3 assets/_plugins/podcast_player_page_generator.rb
jekyll-octopod-0.5.1 assets/_plugins/podcast_player_page_generator.rb
jekyll-octopod-0.5.0 assets/_plugins/podcast_player_page_generator.rb