Skip to content
This repository was archived by the owner on Oct 29, 2025. It is now read-only.

Add support for custom templates#99

Merged
pxjohnny merged 11 commits into
HumanSecurity:devfrom
zsgalusz:customtemplate
Jul 28, 2019
Merged

Add support for custom templates#99
pxjohnny merged 11 commits into
HumanSecurity:devfrom
zsgalusz:customtemplate

Conversation

@zsgalusz

Copy link
Copy Markdown
Contributor

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:

  • customTemplateRoot allows to override the root directory used by mustache
  • customTemplateData allows to pass through an object that can be accessed as customData inside 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.

@pxjohnny pxjohnny changed the base branch from master to dev July 28, 2019 11:29
@pxjohnny pxjohnny merged commit 6ad30b6 into HumanSecurity:dev Jul 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants