Skip to content

Commit 1545dc8

Browse files
authored
feat: add /llm.txt (#307)
1 parent 65a0bbd commit 1545dc8

File tree

5 files changed

+382
-0
lines changed

5 files changed

+382
-0
lines changed

src/server/main.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,19 @@ async def robots() -> FileResponse:
104104
return FileResponse("static/robots.txt")
105105

106106

107+
@app.get("/llm.txt")
108+
async def llm_txt() -> FileResponse:
109+
"""
110+
Serve the `llm.txt` file to provide information about the site to LLMs.
111+
112+
Returns
113+
-------
114+
FileResponse
115+
The `llm.txt` file located in the static directory.
116+
"""
117+
return FileResponse("static/llm.txt")
118+
119+
107120
# Include routers for modular endpoints
108121
app.include_router(index)
109122
app.include_router(download)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<span class="inline-block transform -rotate-6 -translate-y-1 mx-1 px-1 bg-[#FE4A60] border border-gray-900 text-white text-[10px] font-bold shadow-[2px_2px_0_0_rgba(0,0,0,1)]">NEW</span>

src/server/templates/components/git_form.jinja

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
onchange="toggleAccessSettings()"
130130
{% if token %}checked{% endif %}>
131131
<label for="showAccessSettings" class="text-gray-900">Private Repository</label>
132+
{% include "components/badge_new.jinja" %}
132133
</div>
133134
<!-- PAT field -->
134135
<div id="accessSettingsContainer"

src/server/templates/components/navbar.jinja

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
</div>
3535
<!-- Navigation with updated styling -->
3636
<nav class="flex items-center space-x-6">
37+
<a href="/llm.txt"
38+
class="text-gray-900 hover:-translate-y-0.5 transition-transform flex items-center">
39+
{% include "components/badge_new.jinja" %}
40+
/llm.txt
41+
</a>
3742
<div class="flex items-center gap-2">
3843
<a href="https://github.com/cyclotruc/gitingest"
3944
target="_blank"

0 commit comments

Comments
 (0)