tera
tera copied to clipboard
Feature request, `strip_prefix`, and `strip_suffix`
Already internally tera makes use of path.strip_prefix. I would argue .strip_prefix is pretty useful for a templating language. It would be great to have that allowed.
My use case specifically is git cliff which uses tera. I want to strip out the project from the version in a string of project-version. Currently they're combined and I'm trying to work around https://github.com/orhun/git-cliff/issues/1068
I found the way to do what I want. Since .trim_start_matches only takes a string not a pattern. I could do
{{ version | split(pat="-") | last }}