Class: BridgetownFeed::Generator
- Inherits:
-
Bridgetown::Generator
- Object
- Bridgetown::Generator
- BridgetownFeed::Generator
- Defined in:
- lib/bridgetown-feed/generator.rb
Constant Summary collapse
- MINIFY_REGEX =
Matches all whitespace that follows
1. A '>', which closes an XML tag or 2. A '}', which closes a Liquid tagWe will strip all of this whitespace to minify the template
%r!(?<=>|})\s+!.freeze
Instance Method Summary collapse
-
#generate(site) ⇒ Object
Main plugin action, called by Bridgetown-core.
Instance Method Details
#generate(site) ⇒ Object
Main plugin action, called by Bridgetown-core
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/bridgetown-feed/generator.rb', line 14 def generate(site) @site = site collections.each do |name, | Bridgetown.logger.info "Bridgetown Feed:", "Generating feed for #{name}" (["categories"] + [nil]).each do |category| path = feed_path(collection: name, category: category) next if file_exists?(path) @site.generated_pages << make_page(path, collection: name, category: category) end end end |