Skip to content

how to handle the jinja template in cliff.toml when using cookiecutter #818

Answered by pplmx
pplmx asked this question in Q&A
Discussion options

You must be logged in to vote

hi, @orhun

This is my final solution, which has the same effect as the cliff.toml file in the existing git-cliff repository. There’s no difference, and maybe you can use this updated version.

Thanks for your help. :)

body = """
{%- macro remote_url() -%}
  https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
{%- endmacro -%}

{% macro print_commit(commit) -%}
    - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
        {% if commit.breaking %}[**breaking**] {% endif %}\
        {{ commit.message | upper_first }} - \
        ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\
{% endmacro -%}

{% if version %}\

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@orhun
Comment options

Comment options

You must be logged in to vote
3 replies
@orhun
Comment options

@pplmx
Comment options

@pplmx
Comment options

Answer selected by pplmx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants