kirby3-janitor
kirby3-janitor copied to clipboard
Render job fails on local multilanguage site
I am using the CLI to render thumbs on my development machine (locally) via the render
job.
This worked fine in a single-language site, however after enabling multi-language setup the rendered job stop working (rendering failed
error).
The problem seems caused by the default language code that is appended to the site's URL by Kirby in multilanguage mod (en
in my case):
- The current value of Janitor's
renderSiteUrl
option is set to returnsite()->url()
when running in CLI mode. That would behttp://localhost:8000
in my case. - If I set
renderSiteUrl
to returnhttp://localhost:8000/en
, the render job succeeds.
site()->url()
ends with the language code as far as i can tell (kirby 3.8.0) in both CLI and webserver.
what is different in my code if you set it explicitly it uses a Remote
request instead of $page->render()
/site()->visit()
-combination.
my guess is that the cli does not have the right url because its not running on the webserver. it will just be /en
.
to confirm try this:
janitor --tinker
echo site()->url();
should return /en
.
to fix for the CLI use set the config value to this
'bnomei.janitor.renderSiteUrl' => fn() => '/', <-- set it to this, just `/`