Skip to content

Dynamic favicon#1027

Open
frozenprocess wants to merge 1 commit into
educates:developfrom
frozenprocess:dynamic_icon
Open

Dynamic favicon#1027
frozenprocess wants to merge 1 commit into
educates:developfrom
frozenprocess:dynamic_icon

Conversation

@frozenprocess
Copy link
Copy Markdown

This PR helps users to change the favicon.

Simply build and deploy it on your educates setup and encode your favorite icon in secret. (wait is that why we call it favicon ?!?!)

kubectl create secret generic frozen-theme \
  --namespace educates-cli-ui \
  --from-file=favicon.ico=favicon.ico \
  --dry-run=client -o yaml | kubectl apply -f -

You can also embed in the default theme or at the installation step to make it global.

Fixes: #488

@GrahamDumpleton
Copy link
Copy Markdown
Collaborator

Thanks for submitting this.

From memory the reason I hadn't done anything on the original issue for allowing favicon to be overridden was the uncertainty as to what to do about the fact that many browsers only use favicon.ico as a fallback and favour newer image formats with higher resolutions. Unfortunately different browsers/platforms have different expectations and there is no standard that I know of for higher resolution variants. Frankly it is all a huge mess and horrible to deal with.

Let me review the change, but I may also approach this a different way. One can already from memory provide a html snippet file which is included in the head section, so I am wondering if that can instead be used to override what favicon image is used. The benefit of that approach would be that you could provide the higher resolution images in newer file formats if desired.

@GrahamDumpleton
Copy link
Copy Markdown
Collaborator

I suspect you can do this right now without any changes by using a theme defined in a secret as per docs at:

and add favicon.ico along side training-portal.html in the secret where the .html snippets include:

<link rel="shortcut icon" href="/static/workshops/theme/favicon.ico"/>

Similar thing to workshop-dashboard.html but use:

<link rel="shortcut icon" href="/static/theme/favicon.ico"/>

This will result in two "shortcut icon" link entries in the HTML head element, but the browser should use the last one listed and since the HTML snippets should be included as the last thing in the HTML head it will be the one from the theme override that wins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow theme to override favicon.ico file.

2 participants