Skip to content

Commit

Permalink
Revert "Index.html -> index.html.j2"
Browse files Browse the repository at this point in the history
This reverts commit 1f9da15.
  • Loading branch information
dhruvsyos committed Jul 17, 2024
1 parent 1f9da15 commit 5298c72
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/chainlit/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def get_html_template(request: Request):
"twitter_card_image_url": twitter_card_image_url,
}

return templates.TemplateResponse("index.html.j2", context)
return templates.TemplateResponse("index.html", context)


def get_user_facing_url(url: URL):
Expand Down
56 changes: 56 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{{ name }}</title>
<link rel="icon" href="{{ favicon_path }}" />
<meta name="description" content="{{ description }}">
<meta property="og:type" content="website">
<meta property="og:title" content="{{ name }}">
<meta property="og:description" content="{{ description }}">
<meta property="og:image" content="{{ og_image_url }}">
<meta property="og:url" content="{{ github }}">

<!-- Twitter Card data -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="{{ name }}">
<meta name="twitter:description" content="{{ description }}">
<meta name="twitter:image" content="{{ twitter_card_image_url }}">

<!-- Preconnect for performance -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />

<!-- Conditionally include custom font or default Inter font -->
{% if custom_font %}
<link rel="stylesheet" href="{{ custom_font }}">
{% else %}
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap" rel="stylesheet" />
{% endif %}

<!-- Include KaTeX CSS if needed -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" />

<!-- Conditionally include custom CSS -->
{% if custom_css %}
<link rel="stylesheet" type="text/css" href="{{ custom_css }}">
{% endif %}

<!-- Theme Configuration Script -->
{% if theme %}
<script id="theme-data" type="application/json">
window.theme = {{ theme | tojson | safe }};
</script>
{% endif %}

<!-- Conditionally include custom JS -->
{% if custom_js %}
<script src="{{ custom_js }}" defer></script>
{% endif %}
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

0 comments on commit 5298c72

Please sign in to comment.