fix(ui): publish robots.txt at the site root again - #101
Merged
Conversation
The retired docs-ui bundle shipped src/ui.yml with a static_files list that included robots.txt -- that descriptor, not the file's location, is what made https://doc.owncloud.com/robots.txt serve. The move to this Antora monorepo copied docs-ui's static assets into ui/supplemental/ but not its ui.yml, and the stock antora-ui-default bundle ships none, so no code path was left that could publish anything at the site root: @antora/ui-loader classifies every unlisted UI file as an asset under ui.output_dir (assets/). robots.txt therefore had nowhere to land and the URL has 404'd since, leaving the sitemap that antora-extensions/sitemap-cleanup.js still publishes unadvertised. Add the missing ui.yml descriptor plus robots.txt itself, carrying over the legacy content and making the allow-all explicit with an empty Disallow (RFC 9309 4.2.1); the legacy file's bare `User-agent: *` group carried no rule at all. test/static-files.test.js guards the build output: robots.txt at the root, its Sitemap line matching site.url from site.yml, the advertised sitemap.xml actually present, and neither robots.txt nor ui.yml leaking into assets/ -- a dropped descriptor would otherwise still build green. Verified on a full `npm run antora` build served locally: /robots.txt 200 text/plain, /sitemap.xml 200, /assets/ui.yml 404. Closes #100 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
LukasHirt
approved these changes
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #100.
Root cause
Not simply "the file was forgotten" — the mechanism for publishing root-level static files was never carried over from
docs-ui.@antora/ui-loaderdecides where a UI file lands inclassifyFile()(node_modules/@antora/ui-loader/lib/load-ui.js): a file is published at the site root only if it matches a glob from thestatic_files:key of aui.ymldescriptor found in the merged UI file map (bundle files ⊕ui.supplemental_files). Everything else is classified as an asset and written underui.output_dir, i.e.assets/.Evidence:
ui.ymlanywhere in this repo, and the stockantora-ui-defaultbundle ships none either (74 files, verified in the cached bundle) — so no code path existed that could put any file at the site root.docs-uihadsrc/ui.ymlwith a 32-entrystatic_files:list includingrobots.txt. That descriptor, not the file's location, is what made/robots.txtserve.docs-ui@master:src/static/robots.txt(60 bytes, trailing newline).The migration copied
docs-ui's branding assets intoui/supplemental/but dropped itsui.yml, sorobots.txthad nowhere to land — and the sitemap thatantora-extensions/sitemap-cleanup.jsstill publishes has had nothing pointing crawlers at it since.Changes
ui/supplemental/ui.yml— the missing UI descriptor, listingrobots.txtunderstatic_files. Documents that it replaces a bundleui.ymlwholesale, should the stock bundle ever gain one.ui/supplemental/robots.txt— legacy content, plus an explicit emptyDisallow:— RFC 9309 §4.2.1's way of saying "crawl everything". The legacy file's bareUser-agent: *group carried no rule at all.test/static-files.test.js— build-output guards in the same style aslatest-alias.test.js(assert againstpublic/, skip when unbuilt):robots.txtat the root, itsSitemap:line matchingsite.urlderived fromsite.yml(so a domain change can't leave it stale), the advertisedsitemap.xmlactually present in the build, and neitherrobots.txtnorui.ymlleaking intoassets/. That last check covers the exact silent failure mode here — a missing or incomplete descriptor still builds green.Written test-first: it failed with
robots.txt was not published to the site rootbefore the fix.Verification
Full
npm run antorarebuild, thenpublic/served locally:npm test: 20/20 pass (17 pre-existing + 3 new).public/assets/{css,js,img,font}unchanged — adding the descriptor does not disturbui.output_dir.Out of scope
docs-uialso listed.nojekyllinstatic_files. It is unnecessary now:upload-pages-artifact/deploy-pagesserves the artifact directly, with no Jekyll pass.llms.txtquestion from robots.txt missing on doc.owncloud.com (dropped during monorepo migration) #100 — that issue itself suggests splitting it out, and it is not a regression.🤖 Generated with Claude Code