From 3b72433d94319518d8cfb281a332a4dd7ff3befe Mon Sep 17 00:00:00 2001 From: Alena Batitskaia Date: Fri, 21 Feb 2025 20:07:38 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D1=8F?= =?UTF-8?q?=D0=B5=D1=82=20=D1=80=D0=B5=D0=B3=D1=83=D0=BB=D1=8F=D1=80=D0=BA?= =?UTF-8?q?=D1=83=20=D0=B4=D0=BB=D1=8F=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1?= =?UTF-8?q?=D0=BE=D1=82=D0=BA=D0=B8=20=D0=B2=D0=BD=D0=B5=D1=88=D0=BD=D0=B8?= =?UTF-8?q?=D0=B7=20=D1=81=D1=81=D1=8B=D0=BB=D0=BE=D0=BA=20=D0=B2=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D1=84=D0=B8=D0=BB=D0=B5=20=D1=83=D1=87=D0=B0=D1=81?= =?UTF-8?q?=D1=82=D0=BD=D0=B8=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/person.11tydata.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/person.11tydata.js b/src/views/person.11tydata.js index 88b18004..4c13e49e 100644 --- a/src/views/person.11tydata.js +++ b/src/views/person.11tydata.js @@ -33,7 +33,8 @@ module.exports = { url: function (data) { const { person } = data - return person.data.url + const pattern = new RegExp('^(http|https)://(www.)?(.*?)(?:\/)?$') + return person.data.url?.replace(pattern, '') }, behanceId: function (data) { @@ -44,7 +45,7 @@ module.exports = { twitterId: function (data) { const { person } = data - const pattern = new RegExp('^(http|https)://(www.)?twitter.com/') + const pattern = new RegExp('^(http|https)://(www.)?twitter.com|x.com/') return person.data.url?.replace(pattern, '') }, From 4ae466fd00a0595a46fc33b2eb814d23a9673a2a Mon Sep 17 00:00:00 2001 From: Alena Batitskaia Date: Fri, 21 Feb 2025 22:09:58 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=D0=92=D1=8B=D0=B2=D0=BE=D0=B4=D0=B8=D1=82?= =?UTF-8?q?=20=D0=BE=D0=B1=D1=80=D0=B5=D0=B7=D0=B0=D0=BD=D0=BD=D1=83=D1=8E?= =?UTF-8?q?=20=D1=81=D1=81=D1=8B=D0=BB=D0=BA=D1=83,=20=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D0=BB=D1=8C=D0=BD=D0=BE=20=D0=BF=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=D1=81=D0=B8=D1=82,=20=D0=BC=D0=B5=D0=BD=D1=8F?= =?UTF-8?q?=D0=B5=D1=82=20=D0=B8=D0=BA=D0=BE=D0=BD=D0=BA=D1=83=20=D0=A5=20?= =?UTF-8?q?=D0=B8=20=D0=BF=D0=BE=D0=B4=D1=87=D1=91=D1=80=D0=BA=D0=B8=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/styles/blocks/person-links-list.css | 20 +++++--------------- src/views/person.11tydata.js | 13 ++++++++++--- src/views/person.njk | 10 +++++----- 3 files changed, 20 insertions(+), 23 deletions(-) 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 4c13e49e..4b6fec06 100644 --- a/src/views/person.11tydata.js +++ b/src/views/person.11tydata.js @@ -33,8 +33,7 @@ module.exports = { url: function (data) { const { person } = data - const pattern = new RegExp('^(http|https)://(www.)?(.*?)(?:\/)?$') - return person.data.url?.replace(pattern, '') + return person.data.url }, behanceId: function (data) { @@ -45,7 +44,7 @@ module.exports = { twitterId: function (data) { const { person } = data - const pattern = new RegExp('^(http|https)://(www.)?twitter.com|x.com/') + const pattern = new RegExp('^(http|https)://(www.)?twitter.com/') return person.data.url?.replace(pattern, '') }, @@ -55,6 +54,14 @@ module.exports = { return person.data.url?.replace(pattern, '') }, + cattedLink: 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..73a88156 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 }} + {{ cattedLink }} {% 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 %} From b9ab2830a0202b2d61ad0fb00be8f1e69bf240e8 Mon Sep 17 00:00:00 2001 From: Alena Batitskaia Date: Tue, 11 Mar 2025 17:36:28 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=D0=9C=D0=B5=D0=BD=D1=8F=D0=B5=D1=82=20?= =?UTF-8?q?=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=20=D0=BF=D0=BB=D1=8E=D1=80?= =?UTF-8?q?=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D0=B8,=20=D0=B4?= =?UTF-8?q?=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D1=8F=D0=B5=D1=82=20=D1=84=D0=BE?= =?UTF-8?q?=D1=80=D0=BC=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eleventy.js | 12 +++++++++--- src/views/person.11tydata.js | 2 +- src/views/person.njk | 6 +++--- 3 files changed, 13 insertions(+), 7 deletions(-) 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/views/person.11tydata.js b/src/views/person.11tydata.js index 4b6fec06..30c6a0af 100644 --- a/src/views/person.11tydata.js +++ b/src/views/person.11tydata.js @@ -54,7 +54,7 @@ module.exports = { return person.data.url?.replace(pattern, '') }, - cattedLink: function (data) { + cutLink: function (data) { const { person } = data return person.data.url ?.replace(/\/$/, '') diff --git a/src/views/person.njk b/src/views/person.njk index 73a88156..abd1d251 100644 --- a/src/views/person.njk +++ b/src/views/person.njk @@ -116,7 +116,7 @@ {{ telegramId }} {% else %} {{ linkIcon | safe }} - {{ cattedLink }} + {{ cutLink }} {% endif %} @@ -126,7 +126,7 @@ {{ githubIcon | safe }} {{ issuesIcon | safe }} - {{ contributionStat.issues }} {{ contributionStat.issues | pluralize('ишью', 'ишьюс') }} + {{ contributionStat.issues }} {{ contributionStat.issues | pluralize('ишью', 'ишьюс', 'ишьюсов') }} {% endif %} @@ -135,7 +135,7 @@ {{ githubIcon | safe }} {{ prIcon | safe }} - {{ contributionStat.pr }} {{ contributionStat.pr | pluralize('пулреквест', 'пулреквестов') }} + {{ contributionStat.pr }} {{ contributionStat.pr | pluralize('пулреквест', 'пулреквеста', 'пулреквестов') }} {% endif %}