Resurrect section html theming, custom layouts w/ fallback #200
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
This PR makes two changes to the way our templates work to support custom layouts.
custom/layouts
first, before the defaultlayouts
foldergetTemplates()
utility function to attempt to search thiscustom/layouts
directory as well.It also changes all the partial includes to not use relative paths, which means custom partials can also be resolved from a custom/layouts folder.
This change makes preexisting logic that allowed custom category templates based on the root path of Library urls more useful, because now you could add a
custom/layouts/categories
folder withyour-base-url-segment.ejs
and override the root template for subcategories of your Library site.Related Issue
#45 #36
Motivation and Context
There are a few exciting possibilities that custom HTML opens up for Library sites. This change represents a first pass at reenabling some customization functionality that was envisioned since the beginning, and empowering custom folder overrides to also change the HTML of any portion of the Library page, which was a missing feature at the time we originally open sourced the project.
Checklist
npm run lint
and updated code style accordinglynpm run test
passes[ ] tests are updated and/or added to cover new code