class Jekyll::PhotoPost
Public Class Methods
new(site, base, dir, photo)
click to toggle source
Calls superclass method
# File lib/badpixxel-jekyll-flickr.rb, line 48 def initialize(site, base, dir, photo) name = photo.date[0..9] + '-photo-' + photo.slug + '.md' data = Hash.new data['title'] = photo.title data['shorttitle'] = photo.title data['description'] = photo.description data['date'] = photo.date data['slug'] = photo.slug data['permalink'] = File.join('/archives', photo.slug, 'index.html') data['flickr'] = Hash.new data['flickr']['id'] = photo.id data['flickr']['url_full'] = photo.url_full data['flickr']['url_thumb'] = photo.url_thumb if site.config['flickr']['generate_frontmatter'] site.config['flickr']['generate_frontmatter'].each do |key, value| data[key] = value end end File.open(File.join('_posts', name), 'w') {|f| f.print(YAML::dump(data)) f.print("---\n\n") f.print(photo.gen_full_html) } super(site, base, dir, name) end