diff --git a/changelog/_template.md.jinja2 b/changelog/_template.md.jinja2 index 1369ad3fba7a..a96ea9aacf48 100644 --- a/changelog/_template.md.jinja2 +++ b/changelog/_template.md.jinja2 @@ -1,5 +1,5 @@ {# Based on https://github.com/hawkowl/towncrier/blob/master/src/towncrier/templates/default.rst #} -{% for section in sections %}{% if section %}{{section}}{% endif %}{% if sections[section] %}{% for category, val in definitions.items() if category in sections[section] %} +{% if top_line %}{{ top_line }} {{ top_underline * ((top_line)|length)}} {% elif versiondata.name %}{{ versiondata.name }} {{ versiondata.version }} ({{ versiondata.date }}) {{ top_underline * ((versiondata.name + versiondata.version + versiondata.date)|length + 4)}}{% else %}{{ versiondata.version }} ({{ versiondata.date }}) {{ top_underline * ((versiondata.version + versiondata.date)|length + 3)}}{% endif %}{% for section in sections %}{% if section %}{{section}}{% endif %}{% if sections[section] %}{% for category, val in definitions.items() if category in sections[section] %} {{ "### " + definitions[category]['name'] }} {% if definitions[category]['showcontent'] %}{% for text, values in sections[section][category]|dictsort(by='value') %}{% set issue_joiner = joiner(', ') %}- {% for value in values|sort %}{{ issue_joiner() }}{{ value }}{% endfor %}: {{ text }} @@ -7,4 +7,4 @@ {% else %}{% endif %}{% endfor %}{% else %} No significant changes. -{% endif %}{% endfor %} \ No newline at end of file +{% endif %}{% endfor %} diff --git a/scripts/release.py b/scripts/release.py index f23f06152d46..f215f4bd0138 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -285,7 +285,8 @@ def next_version(args: argparse.Namespace) -> Version: def generate_changelog(version: Version) -> None: """Call tonwcrier and create a changelog from all available changelog entries.""" check_call( - ["towncrier", "--yes", "--version", str(version)], cwd=str(project_root()) + ["towncrier", "build", "--yes", "--version", str(version)], + cwd=str(project_root()), )