Commit df21ff0c authored by Richard Perry's avatar Richard Perry
Browse files

Small modifications to the Indii Flickr Plugin

parent 80de4001
Pipeline #1672070 passed with stage
......@@ -38,9 +38,11 @@ category_dir: /
flickr:
enabled: yes
screen_name: Richard Perry
cache_dir: ./_cache/flickr
api_key: 4389a0eb79c41ca17e149830c22fc7c2
shared_secret: ef41108edae962b0
access_token: 72157641557984045-92a5dbebf3e01418
access_secret: 1625dbdd3cf26db6
 
use_cache: true
cache_dir: ./_cache/flickr
......@@ -261,26 +261,26 @@ class FlickrPageGenerator < Generator
file_photosets = Dir.glob(File.join(cache_dir, '*.yml'))
file_photosets.each_with_index do |file_photoset, pos|
photoset = Photoset.new(site, file_photoset)
if site.config['flickr']['generate_photosets'].include? photoset.title
# generate photo pages if requested
if site.config['flickr']['generate_posts']
file_photos = Dir.glob(File.join(photoset.cache_dir, '*.yml'))
file_photos.each do |file_photo, pos|
photo = Photo.new(site, photoset, file_photo, pos)
page_photo = PhotoPost.new(site, site.source, '', photo)
# if site.config['flickr']['generate_photosets'].include? photoset.title
# # generate photo pages if requested
# if site.config['flickr']['generate_posts']
# file_photos = Dir.glob(File.join(photoset.cache_dir, '*.yml'))
# file_photos.each do |file_photo, pos|
# photo = Photo.new(site, photoset, file_photo, pos)
# page_photo = PhotoPost.new(site, site.source, '', photo)
 
# posts need to be in a _posts directory, but this means Jekyll has already
# read in photo posts from any previous run... so for each photo, update
# its associated post if it already exists, otherwise create a new post
site.posts.each_with_index do |post, pos|
if post.data['slug'] == photo.slug
site.posts.delete_at(pos)
end
end
site.posts << page_photo
end
end
end
# # posts need to be in a _posts directory, but this means Jekyll has already
# # read in photo posts from any previous run... so for each photo, update
# # its associated post if it already exists, otherwise create a new post
# site.posts.each_with_index do |post, pos|
# if post.data['slug'] == photo.slug
# site.posts.delete_at(pos)
# end
# end
# site.posts << page_photo
# end
# end
# end
end
# re-sort posts by date
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment