aboutsummaryrefslogtreecommitdiffstats
path: root/rss.php
diff options
context:
space:
mode:
Diffstat (limited to 'rss.php')
-rw-r--r--rss.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/rss.php b/rss.php
index b71a746..14caeaa 100644
--- a/rss.php
+++ b/rss.php
@@ -44,6 +44,13 @@ $config["date_fmt"] = "l, M jS, Y, H:i T";
$config["timezone"] = new DateTimeZone('UTC');
+/// <a target=? >
+///
+/// What to set for the target= attribute on generated links.
+/// _top will redirect the main tab, _blank wil make a nwe tab
+$config["link_target"] = "_top";
+
+
/* --- CODE - DO NOT TOUCH --- */
function load_rss(string $uri, string $linkrel = "alternate"): array {
@@ -198,10 +205,10 @@ $base = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
<?php endif;
foreach ($combined as $entry): ?>
<article>
- <h1><a href="<?= htmlentities($entry['link']) ?>"><?= htmlentities($entry['title'] ?? "[[[No Title]]]") ?></a></h1>
+ <h1><a target="<?= htmlentities($config['link_target']) ?>" href="<?= htmlentities($entry['link']) ?>"><?= htmlentities($entry['title'] ?? "[[[No Title]]]") ?></a></h1>
<span class="source" data-source="<?= htmlentities($entry['source']) ?>">
<?php if ($entry['home']): ?>
- <a href="<?= htmlentities($entry['home']) ?>"><?= htmlentities($entry['source']) ?></a>
+ <a target="<?= htmlentities($config['link_target']) ?>" href="<?= htmlentities($entry['home']) ?>"><?= htmlentities($entry['source']) ?></a>
<?php else: ?>
<?= htmlentities($entry['source']) ?>
<?php endif; ?>