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

Add config.ui.meta_image #757

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions backend/chainlit/config.py
Expand Up @@ -130,6 +130,9 @@
#dark = "#980039"
#light = "#FFE7EB"

# Override default UI metadata
[UI.meta]
#image = "https://chainlit-cloud.s3.eu-west-3.amazonaws.com/logo/chainlit_banner.png"

[meta]
generated_by = "{__version__}"
Expand Down
5 changes: 4 additions & 1 deletion backend/chainlit/server.py
Expand Up @@ -206,12 +206,15 @@ def get_html_template():
default_url = "https://github.com/Chainlit/chainlit"
url = config.ui.github or default_url

default_meta_image = "https://chainlit-cloud.s3.eu-west-3.amazonaws.com/logo/chainlit_banner.png"
meta_image = config.ui.meta.image or default_meta_image

tags = f"""<title>{config.ui.name}</title>
<meta name="description" content="{config.ui.description}">
<meta property="og:type" content="website">
<meta property="og:title" content="{config.ui.name}">
<meta property="og:description" content="{config.ui.description}">
<meta property="og:image" content="https://chainlit-cloud.s3.eu-west-3.amazonaws.com/logo/chainlit_banner.png">
<meta property="og:image" content={meta_image}>
<meta property="og:url" content="{url}">"""

js = f"""<script>{f"window.theme = {json.dumps(config.ui.theme.to_dict())}; " if config.ui.theme else ""}</script>"""
Expand Down