You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
so there are links that points to the GitHub code compare, for the actual version (v0.4.10) with the "previous" (v0.4.9) semver version that was released, and the last released version (v0.5.0) with the HEAD
In order to make this same changelog available by cliff I've tried the cliff.toml as below:
# template for the changelog body# https://tera.netlify.app/docs/#introductionbody = """{% if version %}\ ## [{{ version | trim_start_matches(pat="v") }}] {{ timestamp | date(format="%Y-%m-%d") }} [{{ version | trim_start_matches(pat="v") }}]: https://github.com/sassman/putzen-rs/compare/{{ version }}...{{ previous_version }}{% else %}\ ## [unreleased] [Unreleased]: https://github.com/sassman/putzen-rs/compare/{{ latest_version }}...HEAD{% endif %}\
I guess this variables could be very tricky to provide, but maybe when assuming semver version tags it might be possible to have them all parsed and prepared for the tera rendering.
Alternatively it might be a filter available that goes to the previous version of a given version number like this:
[{{version|trim_start_matches(pat="v")}}]: https://github.com/sassman/putzen-rs/compare/{{ version }}...{{ version | previous_release }}
The text was updated successfully, but these errors were encountered:
Have you tried using the previous field which is mentioned in the template context?
So you can use it like this to get the same result:
{%ifversion%}\
## [{{ version | trim_start_matches(pat="v") }}] {{ timestamp | date(format="%Y-%m-%d") }}
[{{ version | trim_start_matches(pat="v") }}]: https://github.com/sassman/putzen-rs/compare/{{ version }}...{{ previous.version }}
{%else%}\
## [unreleased]
[Unreleased]: https://github.com/sassman/putzen-rs/compare/{{ previous.version }}...HEAD
{%endif%}\
But be aware, this will only work if you run git-cliff with --unreleased or --latest flags. Otherwise you might get template errors due to previous.version not being present. In that case you can add another conditional check to avoid this error.
For context:
I'm using in my changelog usually links that point to GitHubs version compare pages like this:
so there are links that points to the GitHub code compare, for the actual version (
v0.4.10
) with the "previous" (v0.4.9
) semver version that was released, and the last released version (v0.5.0
) with theHEAD
In order to make this same changelog available by cliff I've tried the
cliff.toml
as below:I guess this variables could be very tricky to provide, but maybe when assuming semver version tags it might be possible to have them all parsed and prepared for the tera rendering.
Alternatively it might be a filter available that goes to the previous version of a given version number like this:
The text was updated successfully, but these errors were encountered: