From c7e09acb74cec3dc5e5218f6e5daa29f06f7a4dc Mon Sep 17 00:00:00 2001 From: Yuriy Andamasov Date: Wed, 6 May 2026 23:46:51 +0300 Subject: docs(conf.py): fail loudly when html_baseurl is missing Same fix as `current`: replace the silent `(app.config.html_baseurl or '').rstrip('/') + '/'` fallback with an explicit `RuntimeError`. Every supported branch sets html_baseurl, so a missing value would only ever happen as a regression. Addresses CodeRabbit review feedback on PR #1876. \xf0\x9f\xa4\x96 Generated by [robots](https://vyos.io) --- docs/conf.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/conf.py b/docs/conf.py index 3af7b99b..4778063e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -259,11 +259,17 @@ def _write_llms_txt(app, exception): if exception is not None or app.builder.name not in ( 'html', 'readthedocs'): return + if not app.config.html_baseurl: + # Fail loudly rather than rendering /quick-start.html etc. as a + # silently-broken root-relative URL — every supported branch + # sets html_baseurl, so a missing value is a regression. + raise RuntimeError( + 'html_baseurl must be set to render llms.txt') from pathlib import Path from jinja2 import Environment, StrictUndefined tpl_path = Path(app.srcdir) / '_templates' / 'llms.txt.j2' out_path = Path(app.outdir) / 'llms.txt' - baseurl = (app.config.html_baseurl or '').rstrip('/') + '/' + baseurl = app.config.html_baseurl.rstrip('/') + '/' # StrictUndefined: missing template variables raise rather than # silently render as empty strings, so a typo in llms.txt.j2 fails # the build instead of shipping a half-blank llms.txt. -- cgit v1.2.3