Openring-rs:一个用Rust编写的静态网站生成器Webring。
Openring-rs: a webring for static site generators written in Rust

原始链接: https://github.com/lukehsiao/openring-rs

## openring-rs:一个Webring生成器 openring-rs 是一个基于 Rust 的工具,可以从 Atom/RSS 订阅源创建 Webring,让您轻松地在自己的网站上展示来自其他博客的内容。它是 Drew DeVault 的 openring 的一个移植版本,并增加了诸如请求节流、缓存(带有条件请求)、并发订阅源获取以及改进的错误报告等功能。 用户提供一个 Tera 模板文件和订阅源 URL 列表(通过文件或单独提供)。然后,该工具会获取最新的文章,并尊重 `--before` 选项中的日期过滤,并填充模板以生成 Webring 输出。 主要选项包括控制获取的文章总数 (`--num-articles`) 和每个来源的文章数 (`--per-source`),使用请求缓存 (`--cache`) 以及调整日志详细程度。它专为静态站点生成器设计,并提供了一种通过内容聚合来建立社区的简单方法。

## Openring-rs:一个基于 Rust 的静态网站 Webring 一个名为 **Openring-rs** 的新项目在 Hacker News 上分享。它是一个用 Rust 编写的 Webring 实现,设计用于静态网站生成器。本质上,它允许你轻松地将你的静态网站链接到其他网站,创建一个用于发现的网络。 初步反馈表明,该项目的 README 可以通过更显眼的演示来快速说明其用途——一些用户需要研究“Webring”才能理解这个概念。 尽管如此,评论者认为这是一个很酷且有用的项目,其中一人指出,对于静态网站来说,一个精选的“我关注的博客文章”功能会很有益。作者承认了这些反馈,并感谢评论者对他们博客设计的赞美。该项目在 GitHub 上可用:[github.com/lukehsiao](github.com/lukehsiao)。
相关文章

原文

A tool for generating a webring from Atom/RSS feeds.


openring-rs is a tool for generating a webring from Atom/RSS feeds, so you can populate a template with articles from those feeds and embed them in your own blog. An example template is provided in in.html.

This is a Rust-port of Drew DeVault's openring, with the primary differences being:

  • we respect throttling and send conditional requests when using --cache (recommended!)
  • the template is written using Tera and is provided as an argument, not read from stdin
  • we show a little progress bar
  • we fetch all feeds concurrently
  • we provide better error messages (via miette)
  • we allow filtering feeds with --before

To see this in action, you can look at the footer of this blog post.

https://luke.hsiao.dev/blog/openring-rs/

cargo install --locked openring
A webring for static site generators written in Rust

Usage: openring [OPTIONS] --template-file <FILE>

Options:
  -n, --num-articles <NUM_ARTICLES>    Total number of articles to fetch [default: 3]
  -p, --per-source <PER_SOURCE>        Number of most recent articles to get from each feed [default: 1]
  -S, --url-file <FILE>                File with URLs of Atom/RSS feeds to read (one URL per line, lines starting with '#' or "//" are ignored)
  -t, --template-file <FILE>           Tera template file
  -s, --url <URL>                      A single URL to consider (can be repeated to specify multiple)
  -b, --before <BEFORE>                Only include articles before this date (in YYYY-MM-DD format)
  -c, --cache                          Use request cache stored on disk at `.openringcache`
      --max-cache-age <MAX_CACHE_AGE>  Discard all cached requests older than this duration [default: 14d]
  -v, --verbose...                     Increase logging verbosity
  -q, --quiet...                       Decrease logging verbosity
  -h, --help                           Print help (see more with '--help')
  -V, --version                        Print version

The templates supported by openring-rs are written using Tera. Please refer to the Tera documentation for details.

Just for fun.

联系我们 contact @ memedata.com