Class: Jekyll::FlickrPhotosetTag
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Jekyll::FlickrPhotosetTag
- Defined in:
- lib/badpixxel-jekyll-flickr.rb
Instance Method Summary collapse
-
#initialize(tag_name, markup, tokens) ⇒ FlickrPhotosetTag
constructor
A new instance of FlickrPhotosetTag.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, markup, tokens) ⇒ FlickrPhotosetTag
Returns a new instance of FlickrPhotosetTag.
110 111 112 113 114 115 |
# File 'lib/badpixxel-jekyll-flickr.rb', line 110 def initialize(tag_name, markup, tokens) super params = Shellwords.shellwords markup title = params[0] @slug = title.downcase.gsub(/ /, '-').gsub(/[^a-z\-]/, '') end |
Instance Method Details
#render(context) ⇒ Object
117 118 119 120 121 122 123 |
# File 'lib/badpixxel-jekyll-flickr.rb', line 117 def render(context) site = context.registers[:site] Jekyll::flickr_setup(site) file_photoset = File.join(site.config['flickr']['cache_dir'], "#{@slug}.yml") photoset = Photoset.new(site, file_photoset) return photoset.gen_html end |