Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,15 @@ module.exports = function (config) {
return five
})

config.addFilter('pluralize', (content, one, many) => {
const number = parseInt(content)
return number === 1 ? one : many
config.addFilter('pluralize', (number, one, few, many) => {
number = Math.abs(number)
if (number % 10 === 1 && number % 100 !== 11) {
return one
} else if (number % 10 >= 2 && number % 10 <= 4 && (number % 100 < 10 || number % 100 >= 20)) {
return few
} else {
return many
}
})

{
Expand Down
20 changes: 5 additions & 15 deletions src/styles/blocks/person-links-list.css
Original file line number Diff line number Diff line change
@@ -1,29 +1,19 @@
.person-links-list {
display: grid;
grid-gap: 10px;
border-top: 1px solid var(--color-text);
border-bottom: 1px solid var(--color-text);
padding: 20px 0;
font-family: var(--font-family);
font-size: var(--font-size-s);
line-height: 1.47;
font-family: var(--font-family);
letter-spacing: var(--letter-spacing);
border-bottom: 1px solid var(--color-text);
border-top: 1px solid var(--color-text);
padding: 20px 0;
grid-gap: 10px;
}

.person-links-list__link {
display: inline-flex;
align-items: baseline;
vertical-align: top;
text-decoration: none;
background-repeat: repeat-x;
background-image:
linear-gradient(
90deg,
hsl(var(--color-base-text) / var(--stroke-opacity)),
hsl(var(--color-base-text) / var(--stroke-opacity))
);
background-size: 100% var(--stroke-width, 1px);
background-position: 0 100%;
word-break: break-word;
}

Expand Down
8 changes: 8 additions & 0 deletions src/views/person.11tydata.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ module.exports = {
return person.data.url?.replace(pattern, '')
},

cutLink: function (data) {
const { person } = data
return person.data.url
?.replace(/\/$/, '')
.replace(/^(http|https):\/\/(www\.)?/, '')
.replace(/([/.])/g, '$1\u200B')
},

badges: function (data) {
const { person } = data
return person.data.badges?.map(getBadge)
Expand Down
10 changes: 5 additions & 5 deletions src/views/person.njk
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
{% endset %}

{% set twitterIcon %}
<svg class="person-links-list__icon" width="13" height="11" viewBox="0 0 13 11" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.6691 2.62971C11.677 2.74432 11.677 2.85892 11.677 2.97459C11.677 6.49882 8.99411 10.5633 4.08828 10.5633V10.5612C2.63908 10.5633 1.21999 10.1482 0 9.36553C0.210725 9.39088 0.422507 9.40355 0.634816 9.40408C1.83579 9.40514 3.00244 9.00217 3.94727 8.26014C2.80597 8.23849 1.80516 7.49435 1.45554 6.40798C1.85533 6.48509 2.26728 6.46924 2.65968 6.36203C1.4154 6.11064 0.520211 5.0174 0.520211 3.74777C0.520211 3.73615 0.520211 3.72506 0.520211 3.71397C0.890961 3.92047 1.30607 4.03508 1.73069 4.04775C0.558765 3.26453 0.197522 1.70548 0.90522 0.486549C2.25935 2.15281 4.25728 3.16577 6.40203 3.27298C6.18708 2.34663 6.48072 1.37593 7.17363 0.724737C8.24786 -0.285053 9.93736 -0.233296 10.9471 0.840399C11.5445 0.722625 12.117 0.50345 12.6409 0.192907C12.4418 0.810295 12.0251 1.33473 11.4684 1.66798C11.9971 1.60566 12.5136 1.46412 13 1.24812C12.6419 1.7847 12.1909 2.2521 11.6691 2.62971Z" fill="#1D9BF0"/>
<svg class="person-links-list__icon" width="11" height="11" viewBox="0 0 1200 1227" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill="currentColor" d="M714.163 519.284 1160.89 0h-105.86L667.137 450.887 357.328 0H0l468.492 681.821L0 1226.37h105.866l409.625-476.152 327.181 476.152H1200L714.137 519.284h.026ZM569.165 687.828l-47.468-67.894-377.686-540.24h162.604l304.797 435.991 47.468 67.894 396.2 566.721H892.476L569.165 687.854v-.026Z"/>
</svg>
{% endset %}

Expand Down Expand Up @@ -116,7 +116,7 @@
<span>{{ telegramId }}</span>
{% else %}
{{ linkIcon | safe }}
<span>{{ url }}</span>
<span>{{ cutLink }}</span>
{% endif %}
</a>
</li>
Expand All @@ -126,7 +126,7 @@
<a class="person-links-list__link link" href="{{ issuesLink }}">
{{ githubIcon | safe }}
{{ issuesIcon | safe }}
<span>{{ contributionStat.issues }} {{ contributionStat.issues | pluralize('issue', 'issues') }}</span>
<span>{{ contributionStat.issues }} {{ contributionStat.issues | pluralize('ишью', 'ишьюс', 'ишьюсов') }}</span>
</a>
</li>
{% endif %}
Expand All @@ -135,7 +135,7 @@
<a class="person-links-list__link link" href="{{ pullRequestsLink }}">
{{ githubIcon | safe }}
{{ prIcon | safe }}
<span>{{ contributionStat.pr }} {{ contributionStat.pr | pluralize('pull request', 'pull requests') }}</span>
<span>{{ contributionStat.pr }} {{ contributionStat.pr | pluralize('пулреквест', 'пулреквеста', 'пулреквестов') }}</span>
</a>
</li>
{% endif %}
Expand Down
Loading