From 001ba71b9101445243d194887adbd0b95852cc54 Mon Sep 17 00:00:00 2001 From: syeopite Date: Wed, 13 Mar 2024 14:01:20 -0700 Subject: [PATCH] Add config to add custom text in the footer Co-authored-by: Aural Glow <125497673+auralglow@users.noreply.github.com> --- assets/css/default.css | 12 ++++++------ config/config.example.yml | 15 ++++++++++++++- locales/en-US.json | 2 +- src/invidious/config.cr | 2 ++ src/invidious/views/template.ecr | 9 +++++++-- 5 files changed, 30 insertions(+), 10 deletions(-) diff --git a/assets/css/default.css b/assets/css/default.css index a218fafd..633e9bbd 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -487,7 +487,7 @@ footer a { color: #919191; } -.footer-content #about-invidious-description > b { +.footer-content #footer-custom-text > b { font-size: 30px; } @@ -519,7 +519,7 @@ footer a { } @media screen and (max-width: 929px) { - #about-invidious-description { + #footer-custom-text { display: none; } } @@ -600,7 +600,7 @@ span > select { color: #7c7c7c !important; } -.light-theme footer #about-invidious-description > b { +.light-theme footer #footer-custom-text > b { color: #565D64; } @@ -648,7 +648,7 @@ span > select { color: #7c7c7c; } - .no-theme footer #about-invidious-description > b { + .no-theme footer #footer-custom-text > b { color: #565D64; } @@ -726,7 +726,7 @@ body.dark-theme { color: #313131; } -.dark-theme .footer-content #about-invidious-description > b { +.dark-theme .footer-content #footer-custom-text > b { color: #ccc; } @@ -790,7 +790,7 @@ body.dark-theme { color: #313131; } - .no-theme footer #about-invidious-description > b { + .no-theme footer #footer-custom-text > b { color: #ccc; } } diff --git a/config/config.example.yml b/config/config.example.yml index f1700bf0..ae922f2c 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -425,6 +425,18 @@ jobs: ## #banner: +## +## custom text displayed at the bottom of every page within Invidious' footer. This can +## used for instance announcements, e.g +## +## When unset Invidious defaults to some text that describes what Invidious is. See +## localization key default_invidious_footer_text +## +## Accepted values: any string. HTML is accepted. +## Default: +## +#footer: + ## ## Source code URL. If your instance is running a modified source ## code, you MUST publish it somewhere and set this option. @@ -440,7 +452,8 @@ jobs: ## Accepted values: Email ## Default: ## -# instance_maintainer_email: +# instance_maintainer_email: + # ----------------------------- # Miscellaneous diff --git a/locales/en-US.json b/locales/en-US.json index f7744b34..c52af523 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -464,7 +464,7 @@ "next_steps_error_message_refresh": "Refresh", "next_steps_error_message_go_to_youtube": "Go to YouTube", - "footer_invidious_project_description": "A free and open source frontend for Youtube that that respects your privacy! Now you can watch videos (ad-free), subscribe to channels, create playlist and much more all without the prying eyes of Google!", + "default_invidious_footer_text": "A free and open source frontend for Youtube that that respects your privacy! Now you can watch videos (ad-free), subscribe to channels, create playlist and much more all without the prying eyes of Google!", "footer_navigation_section_header": "Navigation", "footer_home_link": "Home", "footer_project_information_section_header": "Invidious", diff --git a/src/invidious/config.cr b/src/invidious/config.cr index 6460a265..a6354c41 100644 --- a/src/invidious/config.cr +++ b/src/invidious/config.cr @@ -114,6 +114,8 @@ class Config property cache_annotations : Bool = false # Optional banner to be displayed along top of page for announcements, etc. property banner : String? = nil + # Optional footer text to be displayed within Invidious' footer. Can be used for maintainer contact info, etc. + property footer : String? = nil # Enables 'Strict-Transport-Security'. Ensure that `domain` and all subdomains are served securely property hsts : Bool? = true # Disable proxying server-wide: options: 'dash', 'livestreams', 'downloads', 'local' diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr index c3f021e0..b55f7040 100644 --- a/src/invidious/views/template.ecr +++ b/src/invidious/views/template.ecr @@ -139,9 +139,14 @@