From 99d5b095c5a11b3feb1f2f362fabedc587c60ddc Mon Sep 17 00:00:00 2001 From: nicobo Date: Mon, 13 Apr 2020 22:50:33 +0200 Subject: [PATCH] + unfinished plugin --- _plugins/nicolabs-feed-collection.rb.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 _plugins/nicolabs-feed-collection.rb.txt diff --git a/_plugins/nicolabs-feed-collection.rb.txt b/_plugins/nicolabs-feed-collection.rb.txt new file mode 100644 index 0000000..3a67910 --- /dev/null +++ b/_plugins/nicolabs-feed-collection.rb.txt @@ -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