Skip to content

Commit

Permalink
sum up contributions on the same name
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr Kulkov authored Jun 8, 2022
1 parent 4dbab53 commit ce31ef9
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/overrides/partials/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,20 @@
{% set contribs = {} %}

{% for author in git_info.page_authors %}
{% do contribs.setdefault(author.name, {}) %}
{% do contribs[author.name].update({
'contribution':author.contribution[:-1]|float,
'name':author.name,
'url':'#'
}) %}
{% if contribs[author.name] %}
{% do contribs[author.name].__setitem__(
'contribution',
contribs[author.name].contribution + author.contribution[:-1]|float
) %}
{% else %}
{% do contribs.__setitem__(author.name, {
'contribution':author.contribution[:-1]|float,
'name':author.name,
'url':'#'
}) %}
{% endif %}
{% endfor %}


{% for author in committers %}
{% do contribs.setdefault(author.name, {}) %}
{% do contribs[author.name].update({
Expand Down Expand Up @@ -69,4 +74,4 @@ <h1>{{ page.title | d(config.site_name, true)}}</h1>
<li><a href="{{ user.url }}" title="{{ user.name }}" data-bi-name="contributorprofile" target="_blank">{{ user.name }}</a> ({{user.contribution}}%)</li>
{%- endfor -%}
</ul>
</ul>
</ul>

0 comments on commit ce31ef9

Please sign in to comment.