module

Import

Import module

Fetches content from external RSS/Atom/JSON feeds and generates posts based on templates. Similar to Nikola's continuous import feature.

Constants

DEFAULT_TEMPLATE = "{{ content }}"

Default template (baked-in) for simple use cases

Class methods

collect_feed_items(doc : XML::Node, url : String, items : Array(FeedItem)) : Nil

Collect the items of an RSS/Atom document into items. Logs a warning only for unrecognized documents: a valid feed root with no items (e.g. the last page of a paginated feed) is not an error.

Source
fetch_feed(url : String) : Array(FeedItem)

Parse an RSS/Atom feed from URL

Source
fetch_json(url : String, token : String | Nil = nil) : Array(FeedItem)

Fetch articles from JSON API (Pocketbase or generic)

Source
generate_filename(item : FeedItem, config : FeedConfig) : String

Generate filename for post

Source
generate_post(item : FeedItem, config : FeedConfig, template_content : String) : String

Generate post from feed item

Source
import_all

Import all configured feeds

Source
import_feed(name : String, config : FeedConfig, templates_dir : String)

Import items from a feed configuration

Source

Nested types