Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom favicons #1062

Merged
merged 4 commits into from
Oct 27, 2024
Merged

Allow custom favicons #1062

merged 4 commits into from
Oct 27, 2024

Conversation

richard-to
Copy link
Collaborator

If static folder is enabled, then we will check if there is a favicon.ico in the designated static folder. If it exists, we will use the user's favicon instead of the default.

Also:

  • Moved the static folder functions to server_utils.py
  • Improved validation slightly for static URL paths
  • Updated docs with custom favicon example

Closes #563

For a future improvement, we can add more complete favicon support. See https://www.emergeagency.com/insights/detail/the-essentials-of-favicons/

If static folder is enabled, then we will check if there is a
favicon.ico in the designated static folder. If it exists, we will use
the user's favicon instead of the default.

Also:

- Moved the static folder functions to server_utils.py
- Improved validation slightly for static URL paths
- Updated docs with custom favicon example

Closes google#563
Copy link
Collaborator

@wwwillchen wwwillchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome

static_url_path = get_static_url_path()
if static_folder and static_url_path:
print(f"Static folder enabled: {static_folder}")
else:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo, I think it's a little spammy to print this out (in the disabled case). we should eventually move most/if not all of our print statements into proper logger statements #903, but for now we should avoid adding prints in the base/default cause.

@richard-to richard-to merged commit 78bcad4 into google:main Oct 27, 2024
6 checks passed
@richard-to richard-to deleted the favicon branch October 27, 2024 21:04
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.

Add ability to add custom favicon
2 participants