Skip to content
Merged
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
3 changes: 3 additions & 0 deletions src/server/query_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ async def process_query(
if not query.url:
raise ValueError("The 'url' parameter is required.")

# Sets the "<user>/<repo>" for the page title
context["short_repo_url"] = f"{query.user_name}/{query.repo_name}"

clone_config = query.extract_clone_config()
await clone_repo(clone_config, token=token)
summary, tree, content = ingest_query(query)
Expand Down
8 changes: 7 additions & 1 deletion src/server/templates/base.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@
<meta property="og:url" content="{{ request.url }}">
<meta property="og:image" content="/static/og-image.png">
<title>
{% block title %}Gitingest{% endblock %}
{% block title %}
{% if short_repo_url %}
Gitingest - {{ short_repo_url }}
{% else %}
Gitingest
{% endif %}
{% endblock %}
</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="/static/js/utils.js"></script>
Expand Down
3 changes: 3 additions & 0 deletions src/static/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ function handleSubmit(event, showLoading = false) {
starsElement.textContent = starCount;
}

// Set dynamic title that includes the repo name.
document.title = document.body.getElementsByTagName('title')[0].textContent;

// Scroll to results if they exist
const resultsSection = document.querySelector('[data-results]');
if (resultsSection) {
Expand Down
Loading