From a7e05d8587c00c0ee9be12d68ad2f6939abf7291 Mon Sep 17 00:00:00 2001 From: Alena Batitskaia Date: Wed, 7 Aug 2024 20:20:08 +0100 Subject: [PATCH 1/9] =?UTF-8?q?=D0=A7=D0=B5=D0=BD=D0=B4=D0=B6=D0=BB=D0=BE?= =?UTF-8?q?=D0=B3=20=D0=BD=D0=B0=20=D0=B3=D0=BB=D0=B0=D0=B2=D0=BD=D0=BE?= =?UTF-8?q?=D0=B9:=20=D0=BF=D0=B5=D1=80=D0=B2=D0=BE=D0=B5=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=D0=B1=D0=BB=D0=B8=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/includes/blocks/changelog.njk | 55 ++++++++++++++ src/styles/blocks/changelog.css | 116 ++++++++++++++++++++++++++++++ src/styles/index.css | 1 + src/views/index.njk | 2 + 4 files changed, 174 insertions(+) create mode 100644 src/includes/blocks/changelog.njk create mode 100644 src/styles/blocks/changelog.css diff --git a/src/includes/blocks/changelog.njk b/src/includes/blocks/changelog.njk new file mode 100644 index 00000000..cdc2b4a5 --- /dev/null +++ b/src/includes/blocks/changelog.njk @@ -0,0 +1,55 @@ +
+

Новые статьи

+ + + +
diff --git a/src/styles/blocks/changelog.css b/src/styles/blocks/changelog.css new file mode 100644 index 00000000..ae9ab873 --- /dev/null +++ b/src/styles/blocks/changelog.css @@ -0,0 +1,116 @@ +.changelog { + padding-block-end: clamp(40px, 4.8%, 80px); +} + +.changelog-list { + margin: 0; + padding: 0; + list-style: none; + line-height: 1.3; +} + +.changelog-list__item:not(:last-child) { + margin-block-end: 20px; +} + +.changelog-item { + display: flex; + justify-content: space-between; + align-items: baseline; + column-gap: 18px; +} + +.changelog-item__time, +.changelog-item__author { + display: flex; + align-items: baseline; + gap: 18px; + font-size: 28px; +} + +.changelog-item__time::after, +.changelog-item__author::before { + content: ''; + flex: 1 1 auto; + border-block-end: 5px dotted var(--color-text); + opacity: 0.3; +} + +.changelog-item__time { + flex-shrink: 0; + inline-size: 30%; + font-family: var(--font-family); +} + +.changelog-item__title { + margin: 0; + font-weight: normal; + font-size: 24px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.changelog-item__author { + flex: 1 0 25%; + justify-content: end; + font-family: var(--font-family) +} + +.changelog-footer { + display: flex; + justify-content: space-between; + gap: 18px; + margin-block-start: 46px; +} + +.changelog-footer::before { + content: ""; + flex-basis: 30%; +} + +.changelog-footer__item { + margin: 0; +} + +.changelog-footer__item:last-child { + flex-grow: 1; + text-align: end; +} + +@media (width <= 1024px) { + .changelog-item { + flex-wrap: wrap; + } + + .changelog-item__time { + inline-size: 100%; + justify-content: end; + } + + .changelog-item__time::after { + display: none; + } + + .changelog-item__title { + max-inline-size: 55%; + } + + .changelog-footer { + flex-direction: column; + } + + .changelog-footer::before { + display: none; + } + + .changelog-footer__item:last-child { + text-align: start; + } +} + +@media (width <= 768px) { + .changelog-item__author::before { + display: none; + } +} diff --git a/src/styles/index.css b/src/styles/index.css index b633d054..10d0dd90 100644 --- a/src/styles/index.css +++ b/src/styles/index.css @@ -88,3 +88,4 @@ @import url("blocks/subscribe-popup.css"); @import url("blocks/subscribe-page.css"); @import url("blocks/baseline.css"); +@import url("blocks/changelog.css"); diff --git a/src/views/index.njk b/src/views/index.njk index 2460dacb..0de4a555 100644 --- a/src/views/index.njk +++ b/src/views/index.njk @@ -29,6 +29,8 @@ + {% include "blocks/changelog.njk" %} + {% include "articles-gallery.njk" %}
From 9b5b11e7e46930f8688bf9d84264215c100bb6f1 Mon Sep 17 00:00:00 2001 From: Alena Batitskaia Date: Thu, 8 Aug 2024 10:41:03 +0100 Subject: [PATCH 2/9] =?UTF-8?q?=D0=A1=D1=82=D0=B8=D0=BB=D0=B8=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=BC=D0=BE=D0=B1=D0=B8=D0=BB=D1=8C=D0=BD=D1=8B?= =?UTF-8?q?=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/styles/blocks/changelog.css | 42 ++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/src/styles/blocks/changelog.css b/src/styles/blocks/changelog.css index ae9ab873..1db2ad56 100644 --- a/src/styles/blocks/changelog.css +++ b/src/styles/blocks/changelog.css @@ -61,7 +61,7 @@ display: flex; justify-content: space-between; gap: 18px; - margin-block-start: 46px; + margin-block-start: 45px; } .changelog-footer::before { @@ -94,10 +94,21 @@ .changelog-item__title { max-inline-size: 55%; + font-size: 18px; + } + + .changelog-item__author::before { + border-block-end-width: 3px; + } + + .changelog-item__time, + .changelog-item__author { + font-size: 22px; } .changelog-footer { flex-direction: column; + font-size: 18px; } .changelog-footer::before { @@ -110,7 +121,36 @@ } @media (width <= 768px) { + .changelog-item { + flex-direction: column; + justify-content: start; + } + + .changelog-item__time { + inline-size: fit-content; + justify-content: start; + } + + .changelog-item__title { + max-inline-size: 90dvw; + font-size: 20px; + } + + .changelog-item__author { + flex: 0 0 auto; + } + .changelog-item__author::before { display: none; } + + .changelog-item__time, + .changelog-item__author { + font-size: 20px; + } + + .changelog-footer { + margin-block-start: 30px; + font-size: 17px; + } } From 7a866c84be856a595db5732cc93c536bbc1fb0c2 Mon Sep 17 00:00:00 2001 From: Alena Batitskaia Date: Fri, 9 Aug 2024 11:34:14 +0100 Subject: [PATCH 3/9] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D1=8F?= =?UTF-8?q?=D0=B5=D1=82=20=D1=80=D0=B0=D0=B7=D0=BC=D0=B5=D1=82=D0=BA=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/includes/blocks/changelog.njk | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/src/includes/blocks/changelog.njk b/src/includes/blocks/changelog.njk index cdc2b4a5..599eb05a 100644 --- a/src/includes/blocks/changelog.njk +++ b/src/includes/blocks/changelog.njk @@ -4,46 +4,36 @@ diff --git a/src/styles/blocks/changelog.css b/src/styles/blocks/changelog.css index 1db2ad56..5512aba2 100644 --- a/src/styles/blocks/changelog.css +++ b/src/styles/blocks/changelog.css @@ -17,14 +17,12 @@ display: flex; justify-content: space-between; align-items: baseline; - column-gap: 18px; } .changelog-item__time, .changelog-item__author { display: flex; align-items: baseline; - gap: 18px; font-size: 28px; } @@ -34,9 +32,11 @@ flex: 1 1 auto; border-block-end: 5px dotted var(--color-text); opacity: 0.3; + margin-inline: 18px; } .changelog-item__time { + gap: 18px; flex-shrink: 0; inline-size: 30%; font-family: var(--font-family); @@ -52,15 +52,22 @@ } .changelog-item__author { + flex-wrap: wrap; flex: 1 0 25%; justify-content: end; - font-family: var(--font-family) +} + +.changelog-item__author-link { + font-family: var(--font-family); +} + +.changelog-item__author-link:not(:first-child) { + margin-inline-start: 1ch; } .changelog-footer { display: flex; justify-content: space-between; - gap: 18px; margin-block-start: 45px; } @@ -138,6 +145,7 @@ .changelog-item__author { flex: 0 0 auto; + justify-content: start; } .changelog-item__author::before { From 14aee60146aea5f86dd2f9de9e727e925fb85633 Mon Sep 17 00:00:00 2001 From: Igor Korovchenko Date: Fri, 9 Aug 2024 18:15:58 +0300 Subject: [PATCH 5/9] =?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=D0=BD=D0=B5=D0=BE=D0=B1=D1=85=D0=BE=D0=B4=D0=B8?= =?UTF-8?q?=D0=BC=D1=8B=D0=B5=20=D0=BF=D0=BE=D0=BB=D1=8F=20=D0=B2=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BB=D0=BB=D0=B5=D0=BA=D1=86=D0=B8=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eleventy.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.eleventy.js b/.eleventy.js index 18ca7b03..9be8cc4e 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -131,8 +131,10 @@ module.exports = function (config) { const currentMonth = months.indexOf(date[1]) const titledLink = stringParts[1].split('](') post['date'] = new Date(Date.parse(`${currentYear}-${currentMonth + 1}-${currentDay}`)).toISOString() + post['shortDate'] = `${date[0]} ${date[1]}` post['title'] = titledLink[0].replace(/^\[/, '') post['url'] = titledLink[1].replace(/\/[^/]+$/, '/') + post['authors'] = stringParts[1].split('), ')[1].split(', ') const rawArticle = collectionApi.getFilteredByGlob( `src${post['url'].replace('https://doka.guide', '')}*.md`, )[0] From 999bf0bd861a844ef7968a2c50a95525bd2ddfb5 Mon Sep 17 00:00:00 2001 From: Igor Korovchenko Date: Fri, 9 Aug 2024 18:16:29 +0300 Subject: [PATCH 6/9] =?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=D0=BE=D0=B1=D1=8A=D0=B5=D0=BA=D1=82=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20=D1=81=20?= =?UTF-8?q?=D1=87=D0=B5=D0=BD=D0=B4=D0=B6=D0=BB=D0=BE=D0=B3=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/index.11tydata.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/views/index.11tydata.js b/src/views/index.11tydata.js index 36caf997..ff331c2c 100644 --- a/src/views/index.11tydata.js +++ b/src/views/index.11tydata.js @@ -38,6 +38,32 @@ module.exports = { documentDescription: 'Документация для разработчиков на понятном языке', eleventyComputed: { + changeLog: async function (data) { + const { collections } = data + const { posts, peopleById } = collections + const peopleIds = Object.keys(peopleById) + + return posts + ? posts + .filter((p) => typeof p !== 'string') + .slice(0, 5) + .map((p) => { + p['title'] = p['title'].replace(/^`/, '').replace(/`$/, '') + p['authors'] = p['authors'].map((a) => { + return { + name: a, + url: `/people/${peopleIds.filter((p) => peopleById[p].data.name === a)[0]}`, + } + }) + const date = new Date(p['date']) + const day = String(date.getDate()) + const month = String(date.getMonth() + 1) + p['mobileDate'] = `${day.length > 1 ? day : `0${month}`}.${month.length > 1 ? month : `0${month}`}` + return p + }) + : [] + }, + promoData: async function (data) { const { collections } = data const { promos } = collections From 46f5551f11e05067f14864c0a88fbed46cd15173 Mon Sep 17 00:00:00 2001 From: Igor Korovchenko Date: Fri, 9 Aug 2024 18:16:43 +0300 Subject: [PATCH 7/9] =?UTF-8?q?=D0=9C=D0=B5=D0=BD=D1=8F=D0=B5=D1=82=20?= =?UTF-8?q?=D0=B2=D1=91=D1=80=D1=81=D1=82=D0=BA=D1=83=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D1=86=D0=B8=D0=BA=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/includes/blocks/changelog.njk | 57 +++++++------------------------ 1 file changed, 12 insertions(+), 45 deletions(-) diff --git a/src/includes/blocks/changelog.njk b/src/includes/blocks/changelog.njk index 528ce272..e5f0da3f 100644 --- a/src/includes/blocks/changelog.njk +++ b/src/includes/blocks/changelog.njk @@ -2,52 +2,19 @@

Новые статьи