class

Hwaro::Content::Seo::Feeds

Inherits Reference / Object

Constants

FEED_TEMPLATE_KEYS = {"rss" => "rss.xml", "atom" => "atom.xml"}

User template keys that override the built-in feed output, per feed type. templates/rss.xml.jinja loads under the key "rss.xml" (template keys strip only the final template extension).

Class methods

build_template_context(pages : Array(Models::Page), config : Models::Config, feed_type : String, filename : String, is_text : Bool, feed_title : String, base_path : String, language : String | Nil, *, kind : String, section_url : String | Nil, taxonomy : String | Nil, term : String | Nil) : Hash(String, Crinja::Value)

Template context for user feed templates. Everything a feed body needs is precomputed here with the same helpers the programmatic generators use (URLs absolute + percent-encoded, dates normalized and preformatted), so a template never has to re-derive feed semantics — XML escaping via the xml_escape filter is the template author's job.

Source
dedupe_by_output_url(pages : Array(Models::Page)) : Array(Models::Page)

Keep the page the build actually wrote when two pages collide on one URL (path-sort-first winner, matching render.cr#compute_output_url_winners). Used for main, section, language, and taxonomy feeds so no surface advertises a loser.

Source
feed_output_dir_for(output_dir : String, url : String) : String | Nil

Safe subdirectory under output_dir for a section/lang/taxonomy feed. Returns nil (and warns) when the URL escapes the public tree.

Source
generate(pages : Array(Models::Page), config : Models::Config, output_dir : String, verbose : Bool = false, skip_if_unchanged : Bool = false, templates : Hash(String, String) | Nil = nil, renderer : Renderer | Nil = nil)
Source
generate_atom(pages : Array(Models::Page), config : Models::Config, filename : String, is_text : Bool, feed_title : String, base_path : String, language : String | Nil = nil) : String
Source
generate_rss(pages : Array(Models::Page), config : Models::Config, filename : String, is_text : Bool, feed_title : String, base_path : String, language : String | Nil = nil) : String
Source
process_feed(pages : Array(Models::Page), config : Models::Config, output_dir : String, custom_filename : String, feed_title : String, base_path : String = "", verbose : Bool = false, language : String | Nil = nil, templates : Hash(String, String) | Nil = nil, renderer : Renderer | Nil = nil, kind : String = "main", section_url : String | Nil = nil, taxonomy : String | Nil = nil, term : String | Nil = nil)
Source
safe_feed_filename(custom_filename : String, feed_type : String) : String

Config feeds.filename and empty custom names resolve to a single basename under the feed's output directory.

Source

Nested types