Lume Openring
A plugin that brings Drew DeVault's openring concept into Lume sites as a plugin. No need to run an additional tool in your site building pipeline to achieve the same goal.
Usage
To use the plugin, simply import it in your sites _config.ts
like so:
import openring from "https://deno.land/x/lume_openring@1.0.0/mod.ts";
Just as with other plugins, you then pass the imported function into
site.use()
, the most minimal version looking like this:
site.use(openring({
sources: ["https://pixelde.su/blog/posts.rss"],
}));
When building your site, this then fetches one article per source and stores the
list of articles in the data variable openring
in your site.
You can provide following options to the plugin:
sources
: An array of RSS/Atom feed sourcesperSource
: A number of how many articles should be fetched per source (default:1
)dataKey
: Name of the key in which the articles should be saved in your site (default:openring
)htmlToText
: Options for thehtml-to-text
npm package (default: inline link text and remove images)
The list of articles returned by the plugin follows general site convention, with some additional values:
title
: Title of the articledate
: Date of the articleurl
: URL of the articlecontent
: Content of the article (if a<summary>
is present in the feed it is preferred over actual<content>
)sourceTitle
: Title of the feed sourcesourceUrl
: URL of the feed source
Example
The section "Articles from blogs I read" below my posts on pixelde.su (example post, configuration, layout implementation)