|
1 | 1 | {#-
|
2 | 2 | This file was automatically generated - do not edit
|
3 | 3 | -#}
|
| 4 | +{% macro render_updated(date) %} |
| 5 | + <span class="md-source-file__fact"> |
| 6 | + <span class="md-icon" title="{{ lang.t('source.file.date.updated') }}"> |
| 7 | + {% include ".icons/material/clock-edit-outline.svg" %} |
| 8 | + </span> |
| 9 | + {{ date }} |
| 10 | + </span> |
| 11 | +{% endmacro %} |
| 12 | +{% macro render_created(date) %} |
| 13 | + <span class="md-source-file__fact"> |
| 14 | + <span class="md-icon" title="{{ lang.t('source.file.date.created') }}"> |
| 15 | + {% include ".icons/material/clock-plus-outline.svg" %} |
| 16 | + </span> |
| 17 | + {{ date }} |
| 18 | + </span> |
| 19 | +{% endmacro %} |
| 20 | +{% macro render_authors(authors) %} |
| 21 | + <span class="md-source-file__fact"> |
| 22 | + <span class="md-icon" title="{{ lang.t('source.file.contributors') }}"> |
| 23 | + {% if authors | length == 1 %} |
| 24 | + {% include ".icons/material/account.svg" %} |
| 25 | + {% else %} |
| 26 | + {% include ".icons/material/account-group.svg" %} |
| 27 | + {% endif %} |
| 28 | + </span> |
| 29 | + <nav> |
| 30 | + {% for author in authors %} |
| 31 | + <a href="mailto:{{ author.email }}"> |
| 32 | + {{- author.name -}} |
| 33 | + </a> |
| 34 | + {%- if loop.revindex > 1 %}, {% endif -%} |
| 35 | + {% endfor %} |
| 36 | + </nav> |
| 37 | + </span> |
| 38 | +{% endmacro %} |
| 39 | +{% macro render_committers_github(title) %} |
| 40 | + <span class="md-icon" title="{{ lang.t('source.file.contributors') }}"> |
| 41 | + {% include ".icons/material/github.svg" %} |
| 42 | + </span> |
| 43 | + <span>{{ title }}</span> |
| 44 | +{% endmacro %} |
| 45 | +{% macro render_committers_gitlab(title) %} |
| 46 | + <span class="md-icon" title="{{ lang.t('source.file.contributors') }}"> |
| 47 | + {% include ".icons/material/gitlab.svg" %} |
| 48 | + </span> |
| 49 | + <span>{{ title }}</span> |
| 50 | +{% endmacro %} |
| 51 | +{% macro render_committers(authors) %} |
| 52 | + <span class="md-source-file__fact"> |
| 53 | + {% if committers_source == "gitlab" %} |
| 54 | + {{ render_committers_gitlab("GitLab") }} |
| 55 | + {% else %} |
| 56 | + {{ render_committers_github("GitHub") }} |
| 57 | + {% endif %} |
| 58 | + <nav> |
| 59 | + {% for author in authors[:4] %} |
| 60 | + <a href="{{ author.url }}" class="md-author" title="@{{ author.login }}"> |
| 61 | + {% set separator = "&" if "?" in author.avatar else "?" %} |
| 62 | + <img src="{{ author.avatar }}{{ separator }}size=72" alt="{{ author.name or 'GitHub user' }}"> |
| 63 | + </a> |
| 64 | + {% endfor %} |
| 65 | + {% set more = authors[4:] | length %} |
| 66 | + {% if more > 0 %} |
| 67 | + {% if page.edit_url %} |
| 68 | + <a href="{{ page.edit_url | replace('edit', 'blob') }}" class="md-author md-author--more"> |
| 69 | + +{{ more }} |
| 70 | + </a> |
| 71 | + {% else %} |
| 72 | + <span class="md-author md-author--more"> |
| 73 | + +{{ more }} |
| 74 | + </span> |
| 75 | + {% endif %} |
| 76 | + {% endif %} |
| 77 | + </nav> |
| 78 | + </span> |
| 79 | +{% endmacro %} |
4 | 80 | {% if page.meta %}
|
5 | 81 | {% if page.meta.git_revision_date_localized %}
|
6 | 82 | {% set updated = page.meta.git_revision_date_localized %}
|
|
14 | 90 | {% if updated or created or git_info or committers %}
|
15 | 91 | <aside class="md-source-file">
|
16 | 92 | {% if updated %}
|
17 |
| - <span class="md-source-file__fact"> |
18 |
| - <span class="md-icon" title="{{ lang.t('source.file.date.updated') }}"> |
19 |
| - {% include ".icons/material/clock-edit-outline.svg" %} |
20 |
| - </span> |
21 |
| - {{ updated }} |
22 |
| - </span> |
| 93 | + {{ render_updated(updated) }} |
23 | 94 | {% endif %}
|
24 | 95 | {% if created %}
|
25 |
| - <span class="md-source-file__fact"> |
26 |
| - <span class="md-icon" title="{{ lang.t('source.file.date.created') }}"> |
27 |
| - {% include ".icons/material/clock-plus-outline.svg" %} |
28 |
| - </span> |
29 |
| - {{ created }} |
30 |
| - </span> |
| 96 | + {{ render_created(created) }} |
31 | 97 | {% endif %}
|
32 | 98 | {% if git_info %}
|
33 |
| - {% set authors = git_info.get("page_authors") %} |
34 |
| - <span class="md-source-file__fact"> |
35 |
| - <span class="md-icon" title="{{ lang.t('source.file.contributors') }}"> |
36 |
| - {% if authors | length == 1 %} |
37 |
| - {% include ".icons/material/account.svg" %} |
38 |
| - {% else %} |
39 |
| - {% include ".icons/material/account-group.svg" %} |
40 |
| - {% endif %} |
41 |
| - </span> |
42 |
| - <nav> |
43 |
| - {% for author in authors %} |
44 |
| - <a href="mailto:{{ author.email }}"> |
45 |
| - {{- author.name -}} |
46 |
| - </a> |
47 |
| - {%- if loop.revindex > 1 %}, {% endif -%} |
48 |
| - {% endfor %} |
49 |
| - </nav> |
50 |
| - </span> |
| 99 | + {{ render_authors(git_info.get("page_authors")) }} |
51 | 100 | {% endif %}
|
52 | 101 | {% if committers %}
|
53 |
| - <span class="md-source-file__fact"> |
54 |
| - <span class="md-icon" title="{{ lang.t('source.file.contributors') }}"> |
55 |
| - {% include ".icons/material/github.svg" %} |
56 |
| - </span> |
57 |
| - <span>GitHub</span> |
58 |
| - <nav> |
59 |
| - {% for author in committers[:4] %} |
60 |
| - <a href="{{ author.url }}" class="md-author" title="@{{ author.login }}"> |
61 |
| - {% set separator = "&" if "?" in author.avatar else "?" %} |
62 |
| - <img src="{{ author.avatar }}{{ separator }}size=72" alt="{{ author.name or 'GitHub user' }}"> |
63 |
| - </a> |
64 |
| - {% endfor %} |
65 |
| - {% set more = committers[4:] | length %} |
66 |
| - {% if more > 0 %} |
67 |
| - {% if page.edit_url %} |
68 |
| - <a href="{{ page.edit_url | replace('edit', 'blob') }}" class="md-author md-author--more"> |
69 |
| - +{{ more }} |
70 |
| - </a> |
71 |
| - {% else %} |
72 |
| - <span class="md-author md-author--more"> |
73 |
| - +{{ more }} |
74 |
| - </span> |
75 |
| - {% endif %} |
76 |
| - {% endif %} |
77 |
| - </nav> |
78 |
| - </span> |
| 102 | + {{ render_committers(committers) }} |
79 | 103 | {% endif %}
|
80 | 104 | </aside>
|
81 | 105 | {% endif %}
|
0 commit comments