+ unfinished plugin

This commit is contained in:
nicobo 2020-04-13 22:50:33 +02:00
parent b651bcf63e
commit 99d5b095c5
No known key found for this signature in database
GPG key ID: 2581E71C5FA5285F

View file

@ -0,0 +1,20 @@
# FIXME This plugin does not work because I can't code in Ruby
# It should dynamically create the 'feed' collection,
# which would filter posts to include in the RSS/Atom feed.
# This would allow me to put all posts into the `_posts/` directory
# and simply filter on their `maturity` level or other parameter.
# Currently I have to put "live drafts" in a separate directory (_preposts)
require "jekyll"
module Nicolabs
class FeedCollectionGenerator < Jekyll::Generator
safe true
def generate(site)
#site.collections << Jekyll::Collection.new(site, 'feed')
site.pages.each do |post|
site.collections['feedy'] << post
end
end
end # class FeedCollectionGenerator
end # module Nicolabs