Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per-site views failing to be considered when using SSG #127

Open
davebarrau opened this issue Feb 20, 2023 · 1 comment
Open

Per-site views failing to be considered when using SSG #127

davebarrau opened this issue Feb 20, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@davebarrau
Copy link

davebarrau commented Feb 20, 2023

The Multi-Site docs state that you can arrange your directory structure so that if resources/views/<site name>/ exists, it will preference that over resources/views/.

This currently works in statamic/cms for the control panel + anything web-based, but not for ssg: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 from DataResponse::toResponse(). I believe ssg:generate uses DataResponse::toResponse() (via Page::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 to DataResponse::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?).

@michaelr0
Copy link

Closed #128 in favour of this issue.

I’ll copy what I experienced from that issue into this comment.

  • Run SSG generate and see that site1 and site2 will use the override of site1
  • Run SSG generate again and you may see that the overrides aren't used, both site1 and site2 will fallback to resources/views/home.antlers.html instead of the site override

@duncanmcclean duncanmcclean added the bug Something isn't working label Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants