From 562389bc6d91e98c15875921d30c07805171bce8 Mon Sep 17 00:00:00 2001 From: NorkzYT Date: Sun, 22 Mar 2026 21:42:11 +0000 Subject: [PATCH] fix(pages_enabled): hide search UI and block all search routes when disabled - Hide navbar search box when CONFIG.page_enabled?("search") is false - Keep Invidious logo visible with proper width when search bar is hidden - Hide search widget on search_homepage when search is disabled - Block /results, /api/v1/search/suggestions in before_all guard - Block /hashtag/* and /api/v1/hashtag/* when search is disabled --- src/invidious/routes/before_all.cr | 4 +++- src/invidious/views/search_homepage.ecr | 2 ++ src/invidious/views/template.ecr | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/invidious/routes/before_all.cr b/src/invidious/routes/before_all.cr index 90958934..841bbab2 100644 --- a/src/invidious/routes/before_all.cr +++ b/src/invidious/routes/before_all.cr @@ -150,7 +150,9 @@ module Invidious::Routes::BeforeAll "popular" when "/feed/trending", "/api/v1/trending" "trending" - when "/search", "/api/v1/search" + when "/search", "/api/v1/search", "/api/v1/search/suggestions", "/results" + "search" + when .starts_with?("/hashtag/"), .starts_with?("/api/v1/hashtag/") "search" else nil diff --git a/src/invidious/views/search_homepage.ecr b/src/invidious/views/search_homepage.ecr index 2424a1cf..f651dc5c 100644 --- a/src/invidious/views/search_homepage.ecr +++ b/src/invidious/views/search_homepage.ecr @@ -12,9 +12,11 @@ + <% if CONFIG.page_enabled?("search") %>
+ <% end %> diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr index 40f5544f..9aa45e68 100644 --- a/src/invidious/views/template.ecr +++ b/src/invidious/views/template.ecr @@ -31,13 +31,17 @@