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

Move default user template to app/views/layouts/main.html #1752

Merged
merged 8 commits into from
Nov 8, 2022

Conversation

lfdebrux
Copy link
Member

@lfdebrux lfdebrux commented Nov 7, 2022

Makes changes listed in #1707.

We want to make sure that when users can override Nunjucks templates in
the kit and plugins by creating a file with the same path/filename. This
commit moves the `app/views` folder where a user keeps their templates
to the top of the Nunjucks folders list, so that Nunjucks will look
there for templates first.
This should make restoring files to their default state easier.
We've moved app/views/layout.html to app/views/layouts/main.html in the
prototype starter, but we don't yet want the migration script to change
layouts in existing prototypes, because that would require a lot of
extra code to handle updating every Nunjucks template. This does mean
though that we need to tweak the script a bit to be able to copy from
the starter files to the existing layout.
In cases where the user has deleted their default layout file, we still
want their prototype to work, so we add a fallback in the kit. Because
the Nunjucks environment has the location in `lib/nunjucks` at a lower
priority, this file will only be used if the user doesn't have a
similarly named file in `app/views/layout`.
@lfdebrux lfdebrux linked an issue Nov 7, 2022 that may be closed by this pull request
5 tasks
@lfdebrux lfdebrux changed the title Move default user template to layouts/main.html Move default user template to app/views/layouts/main.html Nov 7, 2022
@lfdebrux lfdebrux merged commit 84230ad into v13 Nov 8, 2022
@lfdebrux lfdebrux deleted the ldeb-layouts-folder branch November 8, 2022 14:37
@lfdebrux lfdebrux mentioned this pull request Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update approach to layouts
2 participants