From a3d823dd5a2055eb4769cdb442e1b8de827408bc Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Sun, 19 Jun 2022 21:11:43 -0500 Subject: [PATCH] Add XSLT stylesheet for RSS feed --- scripts/generate-rss.php | 2 +- templates/Header.php | 12 ++++++++---- www/css/core.css | 13 ++++++++++++- www/css/feed.css | 0 www/rss/style.php | 39 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 60 insertions(+), 6 deletions(-) create mode 100644 www/css/feed.css create mode 100644 www/rss/style.php diff --git a/scripts/generate-rss.php b/scripts/generate-rss.php index 1da1daa9..b20b65b4 100644 --- a/scripts/generate-rss.php +++ b/scripts/generate-rss.php @@ -35,7 +35,7 @@ krsort($sortedContentFiles); $sortedContentFiles = array_slice($sortedContentFiles, 0, $rssLength); -print("\n"); +print("\n\n"); ?> diff --git a/templates/Header.php b/templates/Header.php index 2510e4b3..33c385a9 100644 --- a/templates/Header.php +++ b/templates/Header.php @@ -5,11 +5,15 @@ $highlight = $highlight ?? ''; $description = $description ?? ''; $manual = $manual ?? false; $colorScheme = $_COOKIE['color-scheme'] ?? 'auto'; +$xmlDeclaration = $xmlDeclaration ?? true; -header('content-type: application/xhtml+xml'); -print(''); -print("\n"); -?> +if($xmlDeclaration){ + header('content-type: application/xhtml+xml'); + print(''); + print("\n"); + print("\n"); +} +?> diff --git a/www/css/core.css b/www/css/core.css index dd7eb151..42a07064 100644 --- a/www/css/core.css +++ b/www/css/core.css @@ -1376,6 +1376,11 @@ figure{ margin-top: 1rem; } +.rss ul.tags + p{ + font-style: italic; + margin-top: 0; +} + ul.tags{ list-style: none; display: flex; @@ -1384,6 +1389,11 @@ ul.tags{ margin-top: .5rem; } +.rss ul.tags{ + justify-content: flex-start; + margin: 0; +} + ul.tags li{ margin: .5rem; } @@ -1392,7 +1402,8 @@ ul.tags li:first-child{ margin: .5rem; } -ul.tags li a{ +ul.tags li a, +.rss ul.tags li p{ border: 1px solid var(--body-text); border-radius: 5px; padding: .25rem .5rem; diff --git a/www/css/feed.css b/www/css/feed.css new file mode 100644 index 00000000..e69de29b diff --git a/www/rss/style.php b/www/rss/style.php new file mode 100644 index 00000000..92dcb972 --- /dev/null +++ b/www/rss/style.php @@ -0,0 +1,39 @@ +\n") +?> + + + + false]) ?> +
+

+

+

This page is an RSS feed. The URL in your address bar () can be used in any RSS reader.

+
    + +
  1. + + + + + + +
      + +
    • +

      +
    • +
      +
    +

    + +

    +
  2. +
    +
+
+ +
+