class BridgetownFeed::Builder
Constants
- Context
Public Instance Methods
build()
click to toggle source
# File lib/bridgetown-feed/builder.rb, line 8 def build @context = Context.new({ site: site }) helper "feed_meta", :generate_link_tag liquid_tag "feed_meta", :generate_link_tag end
generate_link_tag(*)
click to toggle source
# File lib/bridgetown-feed/builder.rb, line 14 def generate_link_tag(*) attrs = attributes.map { |k, v| %(#{k}="#{v}") }.join(" ") tag_output = "<link #{attrs} />" tag_output.respond_to?(:html_safe) ? tag_output.html_safe : tag_output end
Private Instance Methods
attributes()
click to toggle source
# File lib/bridgetown-feed/builder.rb, line 30 def attributes { type: "application/atom+xml", rel: "alternate", href: absolute_url(path), title: title, }.keep_if { |_, v| v } end
config()
click to toggle source
# File lib/bridgetown-feed/builder.rb, line 22 def config @config ||= site.config end
metadata()
click to toggle source
# File lib/bridgetown-feed/builder.rb, line 26 def metadata @metadata ||= site.data["site_metadata"] end
path()
click to toggle source
# File lib/bridgetown-feed/builder.rb, line 39 def path config.dig("feed", "path") || "feed.xml" end
title()
click to toggle source
# File lib/bridgetown-feed/builder.rb, line 43 def title metadata["title"] || metadata["name"] end