Skip to content
This repository was archived by the owner on May 11, 2026. It is now read-only.

Commit f5eaeb3

Browse files
dariyeclaude
andcommitted
Generate llms.txt at build time via assets:precompile
Move llms.txt from a committed static file to build-time generation. The rake task hooks into assets:precompile so Heroku and Docker builds produce it automatically. No manual step needed on deploy. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 45a70d8 commit f5eaeb3

4 files changed

Lines changed: 11 additions & 77 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
!/tmp/storage/.keep
2727

2828
/public/assets
29+
/public/llms.txt
2930

3031
# Ignore master key for decrypting credentials and more.
3132
/config/master.key

app/views/docs/getting_started/llms_txt.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ def view_template
4242
div(class: "space-y-4") do
4343
Heading(level: 2) { "Keeping it updated" }
4444
Text do
45-
plain "The llms.txt file is generated from the doc source files. If you're contributing to RubyUI, you can regenerate it with:"
45+
plain "The llms.txt file is auto-generated during every deploy as part of "
46+
InlineCode { "assets:precompile" }
47+
plain ". To regenerate locally:"
4648
end
4749
Codeblock("rake llms:generate", syntax: :bash)
4850
Text do

lib/tasks/llms_txt.rake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,10 @@ namespace :llms do
2323
puts "Generated #{output_path} (#{count} components)"
2424
end
2525
end
26+
27+
# Auto-generate llms.txt during assets:precompile (Heroku & Docker builds)
28+
if Rake::Task.task_defined?("assets:precompile")
29+
Rake::Task["assets:precompile"].enhance do
30+
Rake::Task["llms:generate"].invoke
31+
end
32+
end

public/llms.txt

Lines changed: 0 additions & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)