From 9fd4fd0c829662d62a3c5093ce46a765d2bac2d2 Mon Sep 17 00:00:00 2001 From: Rudis Muiznieks Date: Wed, 5 Apr 2023 18:48:21 -0500 Subject: [PATCH] added a search filter, fixed some bugs closes #1 closes #2 --- scripts/generate-site.csx | 10 +- site/index.html | 2 +- site/partial/genre/adventure.html | 44 ++++- site/partial/genre/children.html | 20 +- site/partial/genre/comedy.html | 51 ++++- site/partial/genre/crime.html | 29 ++- site/partial/genre/detective.html | 43 ++++- site/partial/genre/documentary.html | 23 ++- site/partial/genre/drama.html | 50 ++++- site/partial/genre/game-show.html | 12 +- site/partial/genre/horror.html | 25 ++- site/partial/genre/music.html | 25 ++- site/partial/genre/mystery.html | 32 +++- site/partial/genre/sci-fi.html | 18 +- site/partial/genre/western.html | 26 ++- site/partial/home.html | 1 + site/partial/series.html | 276 +++++++++++++++++++++++++++- site/radiostasis.js | 51 ++++- site/style.css | 26 ++- 19 files changed, 741 insertions(+), 23 deletions(-) diff --git a/scripts/generate-site.csx b/scripts/generate-site.csx index e98ea10..efd0b66 100755 --- a/scripts/generate-site.csx +++ b/scripts/generate-site.csx @@ -53,6 +53,10 @@ private class Series { return sb.ToString(); } } + + public string TitleFilter { + get => Title.ToLowerInvariant(); + } } private class Episode { @@ -194,7 +198,10 @@ private void GenerateSeriesListFragment( using var outStream = File.Open(path, FileMode.Create); using var sw = new StreamWriter(outStream); sw.Write( - @$"

{WebUtility.HtmlEncode(title)}

+ @$"
+

{WebUtility.HtmlEncode(title)}

+ +
"); foreach (var series in seriesList) { @@ -204,6 +211,7 @@ private void GenerateSeriesListFragment( hx-target='main' hx-push-url='/series/{series.SlugEncoded}' hx-swap='innerHTML show:top' + data-filter='{series.TitleFilter}' title='{series.TitleEncoded}'> cover image diff --git a/site/index.html b/site/index.html index e606cfe..b65dde4 100644 --- a/site/index.html +++ b/site/index.html @@ -89,7 +89,7 @@ -
+