Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pixeldesu/lume_openring
A Lume plugin that fetches articles from other blogs to be linked on your site
https://github.com/pixeldesu/lume_openring
deno-module lume lume-plugin openring
Last synced: 18 days ago
JSON representation
A Lume plugin that fetches articles from other blogs to be linked on your site
- Host: GitHub
- URL: https://github.com/pixeldesu/lume_openring
- Owner: pixeldesu
- License: mit
- Created: 2024-10-09T22:35:59.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-10-18T00:46:34.000Z (4 months ago)
- Last Synced: 2025-01-20T07:41:44.459Z (26 days ago)
- Topics: deno-module, lume, lume-plugin, openring
- Language: TypeScript
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-lume - Openring
README
# Lume Openring
A plugin that brings Drew DeVault's
[openring](https://git.sr.ht/~sircmpwn/openring) concept into
[Lume](https://lume.land) 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:
```ts
import openring from "https://deno.land/x/[email protected]/mod.ts";
```Just as with other plugins, you then pass the imported function into
`site.use()`, the most minimal version looking like this:```ts
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 sources
- `perSource`: 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 the
[`html-to-text` npm package](https://www.npmjs.com/package/html-to-text)
(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 article
- `date`: Date of the article
- `url`: URL of the article
- `content`: Content of the article (if a `` is present in the feed it
is preferred over actual ``)
- `sourceTitle`: Title of the feed source
- `sourceUrl`: URL of the feed source## Example
The section "Articles from blogs I read" below my posts on pixelde.su
([example post](https://pixelde.su/blog/retrospective-krile-starryeyes/),
[configuration](https://github.com/pixeldesu/pixelde.su/blob/main/_config.ts#L68-L76),
[layout implementation](https://github.com/pixeldesu/pixelde.su/blob/main/src/_includes/layouts/blog.njk#L36-L55))