refactor(templater): Pass resource set path to insertFile function

This is actually several refactors in one:

* rename "fileContent" function to "insertFile"
* pass the resource set path to the "insetFile" function
* update docs and example with a pipeline including indentation
  adjustments for the inserted file
This commit is contained in:
Vincent Ambo 2018-03-09 14:49:33 +01:00 committed by Vincent Ambo
parent bafb792339
commit b8722ce83b
4 changed files with 26 additions and 33 deletions

View file

@ -74,9 +74,10 @@ Some template functions come from Go's standard library and are listed in the
[Go documentation][]. In addition the functions declared by [sprig][] are
available in kontemplate, as well as three custom functions:
`json`: Encodes any supplied data structure as JSON.
`passLookup`: Looks up the supplied key in [pass][].
`fromFile`: Insert the contents of the given file from the resource set folder.
* `json`: Encodes any supplied data structure as JSON.
* `passLookup`: Looks up the supplied key in [pass][].
* `insertFile`: Insert the contents of the given file in the resource
set folder as a string.
## Examples: