From 1dfdbb282a1a81042e4d33e65c817a7f93ccb5eb Mon Sep 17 00:00:00 2001 From: mooleshacat <43627985+mooleshacat@users.noreply.github.com> Date: Tue, 22 Oct 2024 08:44:25 -0400 Subject: [PATCH] added donation link enable/disable in cfg file & custom dono link --- config/config.example.yml | 34 ++++++++++++++++++++++++++++++++ src/invidious/config.cr | 6 ++++++ src/invidious/views/template.ecr | 22 ++++++++++++++++----- 3 files changed, 57 insertions(+), 5 deletions(-) diff --git a/config/config.example.yml b/config/config.example.yml index 7a92d156..2ed256e4 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -246,6 +246,40 @@ tokenmon_enabled: true # Features # ----------------------------- +## +## Enable/Disable catspeed branding. +## +## Accepted values: true, false +## Default: true +## +#catspeed_branding_enabled: false + +## +## Enable/Disable showing the catspeed donation link (please :3c) +## +## Accepted values: true, false +## Default: true +## +#catspeed_donolink_enabled: false + +## +## Enable/Disable showing the invidious donation link (please :3c) +## +## Accepted values: true, false +## Default: true +## +#invidious_donolink_enabled: false + +## +## Enable/Disable showing your custom donation link +## +## Accepted values: true, false +## Default: false +## +#custom_donolink_enabled: true +#custom_donolink_text: "Donate to mysite.com" +#custom_donolink_link: "https://mysite.com/donate/" + ## ## Enable/Disable showing the uptime on the main page. ## diff --git a/src/invidious/config.cr b/src/invidious/config.cr index 4629ee30..11b67624 100644 --- a/src/invidious/config.cr +++ b/src/invidious/config.cr @@ -102,6 +102,12 @@ class Config property tokenmon_enabled : Bool = true # Subscribe to channels using PubSubHubbub (requires domain, hmac_key) property use_pubsub_feeds : Bool | Int32 = false + property catspeed_branding_enabled : Bool = true + property catspeed_donolink_enabled : Bool = true + property invidious_donolink_enabled : Bool = true + property custom_donolink_enabled : Bool = false + property custom_donolink_text : String = "" + property custom_donolink_link : String = "" property popular_enabled : Bool = true property uptime_enabled : Bool = false property loadavg_enabled : Bool = false diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr index bcd586b7..07768a03 100644 --- a/src/invidious/views/template.ecr +++ b/src/invidious/views/template.ecr @@ -1,8 +1,6 @@ <% locale = env.get("preferences").as(Preferences).locale dark_mode = env.get("preferences").as(Preferences).dark_mode - uptime_enabled = CONFIG.uptime_enabled - loadavg_enabled = CONFIG.loadavg_enabled %> @@ -35,11 +33,15 @@ <% if navbar_search %>
Invidious |
server <%= Invidious::Uptime.get_uptime %> |
server load <%= Invidious::Loadavg.get_loadavg %> |