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

Configuration feature: Enables Apple home screen touch icon #1581

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions backend/chainlit/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@
# Specify a custom meta image url.
# custom_meta_image_url = "https://chainlit-cloud.s3.eu-west-3.amazonaws.com/logo/chainlit_banner.png"

# Specify a custom ios home screen bookmark icon url.
# custom_bookmark_icon = "/public/bookmark.png"

# Specify a custom build directory for the frontend.
# This can be used to customize the frontend code.
# Be careful: If this is a relative path, it should not start with a slash.
Expand Down Expand Up @@ -266,6 +269,8 @@ class UISettings(DataClassJsonMixin):
custom_font: Optional[str] = None
# Optional custom meta tag for image preview
custom_meta_image_url: Optional[str] = None
# Optional custom ios home screen bookmark icon
custom_bookmark_icon: Optional[str] = None
# Optional custom build directory for the frontend
custom_build: Optional[str] = None

Expand Down
5 changes: 5 additions & 0 deletions backend/chainlit/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,11 @@ def get_html_template():
if config.ui.custom_font:
font = f"""<link rel="stylesheet" href="{config.ui.custom_font}">"""

if config.ui.custom_bookmark_icon:
tags += (
f"""<link rel="apple-touch-icon" href="{config.ui.custom_bookmark_icon}">"""
)

index_html_file_path = os.path.join(build_dir, "index.html")

with open(index_html_file_path, encoding="utf-8") as f:
Expand Down
1 change: 1 addition & 0 deletions libs/react-client/src/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export interface IChainlitConfig {
custom_js?: string;
custom_font?: string;
custom_meta_image_url?: string;
custom_bookmark_icon?: string;
};
features: {
spontaneous_file_upload?: {
Expand Down
Loading