This repository was archived by the owner on Oct 29, 2025. It is now read-only.
Add support for custom templates#99
Merged
Merged
Conversation
Release pxhd, proxy support, de and async params
Version 1.6.1
Version 1.7.0
Version 1.8.0
Release 2.1.0
Version 2.1.1
fix timeout error (HumanSecurity#96)
pxjohnny
approved these changes
Jul 28, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
While updating perimeterx in our own applications, I came across the need to customise the default block page templates with our own custom company designs. While I could just postinstall-patch the package locally, I figured maybe this would be a useful feature to have in general.
So I added two new config parameters:
customTemplateRootallows to override the root directory used by mustachecustomTemplateDataallows to pass through an object that can be accessed ascustomDatainside the custom templates. This is useful to pass some init data to custom scripts.When the parameters are omitted, nothing changes in the previous behaviour.
When the customTemplateRoot param is passed, mustache will look there for its templates instead of the ones in this package. This means that every template must have a copy there, and if anything is missing, it will error out. I thought this an acceptable limitation.