- #68 and #69: Add json helpers to docs (thanks @arunvelsriram)
- #66: Add ternary function (thanks @binoculars)
- #67: Allow keys function to take multiple dicts (thanks @binoculars)
- #89: Added sha1sum to crypto function (thanks @benkeil)
- #81: Allow customizing Root CA that used by genSignedCert (thanks @chenzhiwei)
- #92: Add travis testing for go 1.10
- #93: Adding appveyor config for windows testing
- #90: Updating to more recent dependencies
- #73: replace satori/go.uuid with google/uuid (thanks @petterw)
- #76: Fixed documentation typos (thanks @Thiht)
- Fixed rounding issue on the
ago
function. Note, the removes support for Go 1.8 and older
- #60: Fix typo in function name documentation (thanks @neil-ca-moore)
- #61: Removing line with {{ due to blocking github pages genertion
- #64: Update the list functions to handle int, string, and other slices for compatibility
This new version of Sprig adds a set of functions for generating and working with SSL certificates.
genCA
generates an SSL Certificate AuthoritygenSelfSignedCert
generates an SSL self-signed certificategenSignedCert
generates an SSL certificate and key based on a given CA
This release adds new functions, including:
regexMatch
,regexFindAll
,regexFind
,regexReplaceAll
,regexReplaceAllLiteral
, andregexSplit
to work with regular expressionsfloor
,ceil
, andround
math functionstoDate
converts a string to a datenindent
is just likeindent
but also prepends a new lineago
returns the time fromtime.Now
- #40: Added basic regex functionality (thanks @alanquillin)
- #41: Added ceil floor and round functions (thanks @alanquillin)
- #48: Added toDate function (thanks @andreynering)
- #50: Added nindent function (thanks @binoculars)
- #46: Added ago function (thanks @slayer)
- #51: Updated godocs to include new string functions (thanks @curtisallen)
- #49: Added ability to merge multiple dicts (thanks @binoculars)
snakecase
,camelcase
, andshuffle
are three new string functionsfail
allows you to bail out of a template render when conditions are not met
- Added
toJson
andtoPrettyJson
- Added
merge
- Refactored documentation
- Added
semver
andsemverCompare
for Semantic Versions list
replacestuple
- Fixed issue with
join
- Added
first
,last
,intial
,rest
,prepend
,append
,toString
,toStrings
,sortAlpha
,reverse
,coalesce
,pluck
,pick
,compact
,keys
,omit
,uniq
,has
,without
- Added
splitList
to split a list - Added crypto functions of
genPrivateKey
andderivePassword
- Added access to several path functions (
base
,dir
,clean
,ext
, andabs
) - Added functions for mutating dictionaries (
set
,unset
,hasKey
)
- Added
sha256sum
to generate a hash of an input - Added functions to convert a numeric or string to
int
,int64
,float64
- Added a
uuidv4
template function for generating UUIDs inside of a template.
- New
trimSuffix
,trimPrefix
,hasSuffix
, andhasPrefix
functions - New aliases have been added for a few functions that didn't follow the naming conventions (
trimAll
andabbrevBoth
) trimall
andabbrevboth
(notice the case) are deprecated and will be removed in 3.0.0
- Adds two functions:
until
anduntilStep
- cat: Concatenate strings with whitespace separators.
- replace: Replace parts of a string:
replace " " "-" "Me First"
renders "Me-First" - plural: Format plurals:
len "foo" | plural "one foo" "many foos"
renders "many foos" - indent: Indent blocks of text in a way that is sensitive to "\n" characters.
- Added a
genPrivateKey
function (Thanks @bacongobbler)
default
now prints the default value when it does not receive a value down the pipeline. It is much safer now to do{{.Foo | default "bar"}}
.- Added accessors for "hermetic" functions. These return only functions that, when given the same input, produce the same output.
Because we switched from int
to int64
as the return value for all integer math functions, the library's major version number has been incremented.
min
complementsmax
(formerlybiggest
)empty
indicates that a value is the empty value for its typetuple
creates a tuple inside of a template:{{$t := tuple "a", "b" "c"}}
dict
creates a dictionary inside of a template{{$d := dict "key1" "val1" "key2" "val2"}}
- Date formatters have been added for HTML dates (as used in
date
input fields) - Integer math functions can convert from a number of types, including
string
(viastrconv.ParseInt
).
- Added quote and squote
- Added b32enc and b32dec
- add now takes varargs
- biggest now takes varargs
- Added #4: Added contains function. strings.Contains, but with the arguments switched to simplify common pipelines. (thanks krancour)
- Added Travis-CI testing support
- Initial release