iv-org / invidious

Invidious is an alternative front-end to YouTube
https://invidious.io
GNU Affero General Public License v3.0
16.08k stars 1.78k forks source link

How to customize the Logo and UI[Enhancement] #3800

Closed sdogruyol closed 1 year ago

sdogruyol commented 1 year ago

First of all, I'd like to thank everyone who's involved in this project. (I'm the author of Kemal Web Framework)

I've looked through the docs and issues...and couldn't find a way to customize the logo and UI.

Is it possible? How can I do that?

TorutheRedFox commented 1 year ago

I currently just do it using a custom PHP frontend running on my Apache server that just interfaces with the API

SamantazFox commented 1 year ago

Thanks too for your work on kemal, we owe you a lot ^^

For the logo, you can change it by replacing the logo in the assets folder. For the rest of the UI, you'd need to edit the various ECR files located at src/invidious/views as well as some HTML snippets present in src/invidious/frontend, and the CSS located in assets/css

I'm currently working on some heavy changes regarding the UI to make styling easier (See #3020, #3763, #3784). The goal is to clean code, reuse HTML snippets, remove inline styles (there are a lot of them!) and consolidate (or create) CSS class names.

I'm also looking into switching to a proper DSL shard for HTML templating, with the goal of dropping ECR altogether.

sdogruyol commented 1 year ago

Thanks a lot @SamantazFox

I actually changed some files in src\views\template.ecr however when I do docker compose down and docker compose up -d the changes are not applied to the UI.

Am I missing something?

unixfox commented 1 year ago

Thanks a lot @SamantazFox

I actually changed some files in src\views\template.ecr however when I do docker compose down and docker compose up -d the changes are not applied to the UI.

Am I missing something?

You need to rebuild the docker container: docker compose up -d --build

sdogruyol commented 1 year ago

I'm already doing that @unixfox, could it be caching issue somewhere?

unixfox commented 1 year ago

Well you did not send the command with the parameter --build as the command that you ran.

I think you should try at first in incognito mode or on another browser.

sdogruyol commented 1 year ago

Thanks a lot @unixfox I'll try again.

sdogruyol commented 1 year ago

Another guess, seems like the binary is not re-compiled on docker compose build or up? How can I trigger a recompile of the binary?

unixfox commented 1 year ago

If you do not have anything important on docker:

docker compose down -v
docker system prune -a
docker compose up -d
sdogruyol commented 1 year ago

Nope, that didn't work either

SamantazFox commented 1 year ago

Make sure you have the following at the beginning of your docker-compose (without the image entry) otherwise docker won't build from source, and instead use the quay image:

version: "3"
services:

  invidious:
    build:
      # Adapt to the path where you cloned the source code
      context: /home/invidious/invidious.git/
      dockerfile: docker/Dockerfile
      args:
        release: 1
        disable_quic: 1
unixfox commented 1 year ago

That's already the default behavior when using the docker-compose file of the repository: https://github.com/iv-org/invidious/blob/master/docker-compose.yml

sdogruyol commented 1 year ago

@SamantazFox thanks a lot! That did the trick 👍