From 8465afea0e9b905279038499479e74fb681d3b83 Mon Sep 17 00:00:00 2001 From: aleteoryx Date: Tue, 12 Nov 2024 15:49:19 -0500 Subject: homepage --- README.md | 3 ++- rss.php | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3db3cdc..8395b98 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,9 @@ displayed. The key of the entry is the name. The following options are supported per-feed: - `$feeds[feed]["url"]`: **REQUIRED**: The URL of the RSS/Atom feed. +- `$feeds[feed]["home"]`: An optional homepage for the feed. Will be linked under every entry from it. - `$feeds[feed]["ttl"]`: How long to cache the feed for, in seconds. Defaults to 1 hour. -- `$feeds[feed]["linkrel"]`: For Atom, which `rel=` value to prefer when getting a link. +- `$feeds[feed]["linkrel"]`: For Atom, which `rel=` value to prefer when getting a link. Defaults to alternate. The remaining config options are set on the `$config` array, and are documented inside the file. diff --git a/rss.php b/rss.php index 012bf4e..b71a746 100644 --- a/rss.php +++ b/rss.php @@ -1,9 +1,11 @@ $data) { foreach(load_cached($data["ttl"], $data["url"], $data["linkrel"]) as $entry) { $entry["source"] = $name; + $entry["home"] = @$data["home"]; $combined[] = $entry; } } @@ -196,7 +199,13 @@ $base = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); foreach ($combined as $entry): ?>

- + + + + + + +