diff --git a/.eleventy.js b/.eleventy.js index 18ca7b03..09935425 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -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 + } }) { diff --git a/src/styles/blocks/person-links-list.css b/src/styles/blocks/person-links-list.css index d2eeace7..1428700f 100644 --- a/src/styles/blocks/person-links-list.css +++ b/src/styles/blocks/person-links-list.css @@ -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; } diff --git a/src/views/person.11tydata.js b/src/views/person.11tydata.js index 88b18004..30c6a0af 100644 --- a/src/views/person.11tydata.js +++ b/src/views/person.11tydata.js @@ -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) diff --git a/src/views/person.njk b/src/views/person.njk index e9c9e4d0..abd1d251 100644 --- a/src/views/person.njk +++ b/src/views/person.njk @@ -27,8 +27,8 @@ {% endset %} {% set twitterIcon %} - - + + {% endset %} @@ -116,7 +116,7 @@ {{ telegramId }} {% else %} {{ linkIcon | safe }} - {{ url }} + {{ cutLink }} {% endif %} @@ -126,7 +126,7 @@ {{ githubIcon | safe }} {{ issuesIcon | safe }} - {{ contributionStat.issues }} {{ contributionStat.issues | pluralize('issue', 'issues') }} + {{ contributionStat.issues }} {{ contributionStat.issues | pluralize('ишью', 'ишьюс', 'ишьюсов') }} {% endif %} @@ -135,7 +135,7 @@ {{ githubIcon | safe }} {{ prIcon | safe }} - {{ contributionStat.pr }} {{ contributionStat.pr | pluralize('pull request', 'pull requests') }} + {{ contributionStat.pr }} {{ contributionStat.pr | pluralize('пулреквест', 'пулреквеста', 'пулреквестов') }} {% endif %}