Closed michaelr0 closed 1 year ago
This issue might belong better on the statamic/ssg
repository - I'll leave it for the Statamic Team to move it if they feel necessary.
This and https://github.com/statamic/ssg/issues/127 are the for the same issue.
The Multi-Site docs state that you can arrange your directory structure so that if
resources/views/<site name>/
exists, it will preference that overresources/views/
.This currently works in
statamic/cms
for the control panel + anything web-based, but not forssg:generate
for me (using statamic/cms:v3.4.4 and statamic/ssg:1.3.0).I believe this may have been a regression when statamic/cms@01cc304 was introduced, as that commit moved
addViewPaths()
to a web middleware and removed the call fromDataResponse::toResponse()
. I believessg:generate
usesDataResponse::toResponse()
(viaPage::write()
) but does nothing with this new middleware, which means the per-site view path is not set correctly when using the static site generator.Adding
->addViewPaths()
back in toDataResponse::toResponse()
~fixes it for me~ (edit: scratch that, it reintroduces the exponential loop issue that was previously fixed), but I'm not sure if it was removed for a reason (perhaps to fix another bug?).
Closing in favour of https://github.com/statamic/ssg/issues/127
Bug description
It looks like there is an issue with generating multisite pages with the SSG package, when trying to use view overrides for particular sites/pages.
The below PR's might be related as those appeared to have removed the viewPath's in favour of moving it into a middleware and solving a SSG performance issue.
https://github.com/statamic/cms/pull/7030 https://github.com/statamic/ssg/pull/120
How to reproduce
resources/views/<site1>/home.antlers.html
andresources/views/<site2>/home.antlers.html
filesphp artisan view:clear
site1
andsite2
will use the override ofsite1
site1
andsite2
will fallback toresources/views/home.antlers.html
instead of the site overrideLogs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
regex (default)
Additional details
No response