Skip to content

Commit 0dbb08d

Browse files
committed
feat: COM-3646 Edit docs and fix articleTemplate
1 parent d81988d commit 0dbb08d

File tree

13 files changed

+28
-37
lines changed

13 files changed

+28
-37
lines changed

components/main/Posts/PostCard/PostCard.styles.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ const base = ({ breakpoints: { mobile }, colors }) => css`
1212
border-top: 1px solid rgba(155, 155, 155, 0.5);
1313
}
1414
15-
&:first-of-type .wrap {
16-
border-top: 1px solid rgba(241, 242, 247, 0.5);
17-
}
18-
1915
.picture {
2016
grid-column: 1 / span 3;
2117
width: ${calcRem(216)};

docs/en/NEW_ARTICLE.md

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
11
# Creating a new article
22

33
## Article template generator
4+
45
To create a new article use the command `yarn article en my-article-name`,
56
where en is the language (possible choices are en or ru) and `my-article-name` is the name of the new article.
67
This command will create a new template article and pictures for it and add it to the home page.
78

89
## Article files
10+
911
All articles you can find in the [`_posts`](../_posts) folder.
1012
The name of the file corresponds to the `url` of the article, i.e. if you create a file named `new-awesome-post.md` in `_posts/en`,
1113
then be sure to find it at `http://localhost:3000/en/article/new-awesome-post`.
1214

1315
### Images
16+
1417
Images for articles are in the [`public/images`](../public/images/) folder. We can insert images into articles in several ways:
1518
``jsx
1619
<Img src='/foo.png' alt='Description of what's shown in foo.png' withOutProcessing>
20+
1721
```
1822
or
1923
``jsx
2024
<Img imageName='foo' alt='Description of what's shown in foo.png'/>
2125
```
22-
In the first case, the image will not go through any processing and will be the same at all resolutions. This is best choice for images that were originally of poor quality or small size, and there is nothing you can do about it.
23-
In the second case you have the possibility to specify different versions of the image for different breakpoints. We recommend always using the second syntax and preparing different versions of images for different breakpoints. We have the following breakpoints:
26+
27+
In the first case, the image will not go through any processing and will be the same at all resolutions. This is best choice for images that were originally of poor quality or small size, and there is nothing you can do about it.
28+
In the second case you have the possibility to specify different versions of the image for different breakpoints. We recommend always using the second syntax and preparing different versions of images for different breakpoints. We have the following breakpoints:
2429

2530
| breakpoint name | breakpoint boundaries |
2631
| --------------- | --------------------- |
@@ -35,6 +40,7 @@ In the second case you have the possibility to specify different versions of the
3540
| all | 0 - ∞ |
3641

3742
Different versions of the same image for different breakpoints should be put in the same folder and named according to the breakpoints on which you want to display them. For example, you have an image `foo` and it looks slightly different on desktop, tablet and mobile, then you need to create a folder `foo` and put in it 3 images, each with the same name as the breakpoint on which it will be used:
43+
3844
```
3945
└─ foo
4046
├─ mobile.all.png
@@ -46,22 +52,12 @@ We also have the ability to prepare different images for screens with different
4652

4753
If you don't want to resize images when processing, then place the original image 1x the size of its size in the article in the [`public/images/dont-resize`](../public/images/dont-resize) folder. This can come in handy when you don't have the ability to get a source image 3x the size of its size in the article.
4854

49-
We recommend always resizing images.
55+
We recommend always resizing images.
5056

5157
SVG and GIF images are always placed in the [`public/images/dont-resize`](../public/images/dont-resize) folder and are connected using the syntax `<Img src='/foo.gif' alt='Description of what's shown in foo.gif' withOutProcessing>`.
5258

53-
For each article it is obligatory to create images
54-
mainCoverL - big tile, mainCoverS - small tile ([Screenshot of "mainCoverS" image for the main page](http://s.csssr.ru/U31J879TR/20200527101534.jpg)) and
55-
postCover ([Screenshot of the "postCover" image for article header](http://s.csssr.ru/U31J879TR/20200527101626.jpg)).
59+
For each article it is obligatory to create images postCover ([Screenshot of the "postCover" image for article header](http://s.csssr.ru/U31J879TR/20200527101626.jpg)).
5660

5761
## Article order
58-
The order of the articles on the main page is set in [postsOrderEn.json](../postsOrderEn.json) and [postsOrderRu.json](../postsOrderRu.json). This file presents a schematic representation of the articles on the main page.
59-
```json
60-
[
61-
["offshore-web-development", "augmented-and-virtual-reality"],
62-
["html-or-cms-or-custom-development", "eight-ways-to-Improve-staff-motivation"],
63-
["creative-and-web-development," "tips-for-task-estimating"],
64-
["the-baltic-e-success"]
65-
]
66-
```
67-
The presence and order of articles in this object determines the presence and order of articles on the homepage. When you create a new article using the `yarn article en my-article-name` command, your article name `my-article-name` will automatically be added first in order.
62+
63+
Articles are sorted by date of publication. From the earliest to the latest.

docs/ru/NEW_ARTICLE.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,27 @@
77
Эта команда создаст новую шаблонную статью, картинки для неё и добавит её на главную.
88

99
## Файлы статьи
10+
1011
Статьи находятся в папке [`_posts`](../_posts).
1112
Название файла соответствует `url` статьи, т.e. если создать файл с именем `new-awesome-post.md` в `_posts/ru`,
1213
то будьте уверены что сможете найти его по адресу `http://localhost:3000/ru/article/new-awesome-post`.
1314

1415
### Изображения
16+
1517
Картинки для статей находятся в папке [public/images](../public/images/). Мы можете вставлять изображения в статьи несколькими способами:
18+
1619
```jsx
1720
<Img src='/foo.png' alt='Описание того что изображено на foo.png' withOutProcessing>
1821
```
22+
1923
или же
24+
2025
```jsx
21-
<Img imageName='foo' alt='Описание того что изображено на foo.png'/>
26+
<Img imageName="foo" alt="Описание того что изображено на foo.png" />
2227
```
23-
В первом случае изображение не будет проходить никакую обработку и будет одинаковым на всех разрешениях. Такой вариант подходит для картинок, которые изначально были плохого качества или маленького размера и вы на это никак не можете повлиять.
24-
Во втором случае у вас появляется возможность указать разные версии изображения для разных брейкпоинтов. Мы рекомендуем всегда использовать второй вариант синтаксиса и подготавливать разные версии изображений для разных брейкпоинтов. У нас есть следующие брейкпоинты:
28+
29+
В первом случае изображение не будет проходить никакую обработку и будет одинаковым на всех разрешениях. Такой вариант подходит для картинок, которые изначально были плохого качества или маленького размера и вы на это никак не можете повлиять.
30+
Во втором случае у вас появляется возможность указать разные версии изображения для разных брейкпоинтов. Мы рекомендуем всегда использовать второй вариант синтаксиса и подготавливать разные версии изображений для разных брейкпоинтов. У нас есть следующие брейкпоинты:
2531

2632
| Название брейкпоинта | Границы брейкпоинта |
2733
| -------------------- | ------------------- |
@@ -36,6 +42,7 @@
3642
| all | 0 - ∞ |
3743

3844
Разные версии одного и того же изображения для разных брейкпоинтов следуют складывать в одну папку и называть согласно брейкпоинтам, на которых вы хотите их отображать. Например, у вас есть изображении `foo` и у оно у вас выглядит немного по разному на десктопе, таблете и мобилке, тогда вам нужно создать папку `foo` и положить в неё 3 изображения, каждое из которых будет названо так же как и брейкпоинт, на котором оно будет использоваться:
45+
3946
```
4047
└─ foo
4148
├─ mobile.all.png
@@ -47,22 +54,12 @@
4754

4855
Если не хотите ресайзить изображения при обработке, то разместите исходное изображение 1x размера его следует в папке [public/images/dont-resize](../public/images/dont-resize). Это может пригодится, когда у вас нет возможности получить исходное изображение 3x размера от его размера в статье.
4956

50-
Мы рекомендуем всегда ресайзить изображения.
57+
Мы рекомендуем всегда ресайзить изображения.
5158

5259
SVG и GIF изображения всегда размещаются в папке [public/images/dont-resize](../public/images/dont-resize) и подключаются с помощью синтаксиса `<Img src='/foo.gif' alt='Описание того что изображено на foo.gif' withOutProcessing>`.
5360

54-
Для каждой статьи обязательно должны быть созданы картинки
55-
mainCoverL - большая плитка, mainCoverS - маленькая плитка ([Скриншот изображения «mainCoverS» для главной страницы](http://s.csssr.ru/U31J879TR/20200527101534.jpg)) и
56-
postCover ([Скриншот изображения «postCover» в заголовке статьи](http://s.csssr.ru/U31J879TR/20200527101626.jpg)).
61+
Для каждой статьи обязательно должны быть созданы картинки postCover ([Скриншот изображения «postCover» в заголовке статьи](http://s.csssr.ru/U31J879TR/20200527101626.jpg)).
5762

5863
## Порядок статей
59-
Порядок статей на главной задаётся в файлах [postsOrderEn.json](../postsOrderEn.json) и [postsOrderRu.json](../postsOrderRu.json). В этом файле представлено схематическое отображение статей на главной странице.
60-
```json
61-
[
62-
["offshore-web-development", "augmented-and-virtual-reality"],
63-
["html-or-cms-or-custom-development", "eight-ways-to-Improve-staff-motivation"],
64-
["creative-and-web-development", "tips-for-task-estimating"],
65-
["the-baltic-e-success"]
66-
]
67-
```
68-
Наличие и порядок статей в этом объекте определяет наличие и порядок статей на главной странице. При создании новой статьи с помощью команды `yarn article ru my-article-name` ваше название статьи `my-article-name` будет автоматически добавлено первым в порядке.
64+
65+
Статьи сортируются по дате публикации. От ранней к поздней.

pages/[language]/[category]/[page].js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export async function getStaticProps({ params }) {
3333
'date',
3434
'slug',
3535
'author',
36+
'content',
3637
'coverImageAlt',
3738
'tag',
3839
'images',

pages/[language]/[category]/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export async function getStaticProps({ params }) {
2525
'date',
2626
'slug',
2727
'author',
28+
'content',
2829
'coverImageAlt',
2930
'tag',
3031
'images',
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)