Skip to content

Commit 6534583

Browse files
Kirill Bolotskyppcano
authored andcommitted
chore(docs): updated contributing file format
- added new section, `ExternalCardLink` usage
1 parent 2f5a55a commit 6534583

File tree

2 files changed

+36
-9
lines changed

2 files changed

+36
-9
lines changed

CONTRIBUTING_FILE_FORMAT.md

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ There are two types of pages: Welcome Pages and Documentation articles.
88

99
Documentation articles are markdown files structured under the [`src/data/markdown/docs`](src/data/markdown/docs) folder.
1010

11-
### Folder structure
11+
## Folder structure
1212

1313
Root folders represent main categories at the top of the page.
1414
Use numbers in front of the folder name to set the order.
@@ -53,7 +53,7 @@ Note, that path begins with `/`, not just `images/`.
5353

5454
Store images relative to a source `.md` file, and access them from `.md` files by using relative path. `image-sharp-plugin` will handle your image: compress, convert and lazy load.
5555

56-
### Example file structure:
56+
### Example file structure
5757

5858
```
5959
.
@@ -201,7 +201,7 @@ We are going to write them a bit differently, half-native md:
201201

202202
```javascript
203203
for (var id = 1; id <= 100; id++) {
204-
http.get(http.url`http://example.com/posts/${id}`)
204+
http.get(http.url`http://example.com/posts/${id}`)
205205
}
206206

207207
// tags.name="http://example.com/posts/${}",
@@ -221,7 +221,7 @@ If we want line numbers to be rendered, we shall add the wrapper and adjust our
221221

222222
```javascript
223223
for (var id = 1; id <= 100; id++) {
224-
http.get(http.url`http://example.com/posts/${id}`)
224+
http.get(http.url`http://example.com/posts/${id}`)
225225
}
226226

227227
// tags.name="http://example.com/posts/${}",
@@ -242,7 +242,7 @@ Pretty much the same routine as with headerless ones, but one difference in data
242242

243243
```javascript
244244
for (var id = 1; id <= 100; id++) {
245-
http.get(http.url`http://example.com/posts/${id}`)
245+
http.get(http.url`http://example.com/posts/${id}`)
246246
}
247247

248248
// tags.name="http://example.com/posts/${}",
@@ -261,7 +261,7 @@ To be able to switch between different code tabs, we have to repeat the headerfu
261261

262262
```javascript
263263
for (var id = 1; id <= 100; id++) {
264-
http.get(http.url`http://example.com/posts/${id}`)
264+
http.get(http.url`http://example.com/posts/${id}`)
265265
}
266266

267267
// tags.name="http://example.com/posts/${}",
@@ -270,7 +270,7 @@ To be able to switch between different code tabs, we have to repeat the headerfu
270270

271271
```javascript
272272
for (var id = 1; id <= 100; id++) {
273-
http.get(http.url`http://example.com/posts/${id}`)
273+
http.get(http.url`http://example.com/posts/${id}`)
274274
}
275275

276276
// tags.name="http://example.com/posts/${}",
@@ -279,7 +279,7 @@ To be able to switch between different code tabs, we have to repeat the headerfu
279279

280280
```javascript
281281
for (var id = 1; id <= 100; id++) {
282-
http.get(http.url`http://example.com/posts/${id}`)
282+
http.get(http.url`http://example.com/posts/${id}`)
283283
}
284284

285285
// tags.name="http://example.com/posts/${}",
@@ -307,7 +307,7 @@ See _'Then do this?'_ text line between tabs? **You can not do that**. Put nothi
307307

308308
```javascript
309309
for (var id = 1; id <= 100; id++) {
310-
http.get(http.url`http://example.com/posts/${id}`)
310+
http.get(http.url`http://example.com/posts/${id}`)
311311
}
312312

313313
```
@@ -352,6 +352,33 @@ Result:
352352

353353
As you can see, the `LdScript` expects a sole prop `script` of type string of JSON-LD data, which it will render appropriately on its own.
354354

355+
## External Link Card (Blog only)
356+
357+
This is a component that represents a common pattern of external link decoration. Here is how you would use it:
358+
359+
1. Find a place in your article where you'd like to see the card
360+
2. Write down the following snippet:
361+
362+
```md
363+
<!-- other content -->
364+
365+
<ExternalCardLink title="Card title" description="Card description" link="https://card-link.com">
366+
<!-- note empty line -->
367+
![image](./path/to-image.png)
368+
<!-- note empty line -->
369+
</ExternalCardLink>
370+
371+
<!-- other content -->
372+
```
373+
374+
3. Replace `title`, `description`, `link` and image inside with your data. Note, that `title` and `link` are **required**, while `description` field and image inside are **optional**, though without an image it will look much less appealing.
375+
376+
4. Result will be something like that:
377+
378+
![external-card-result](./internal-images/external-link-card-sample.png)
379+
380+
Currently, this component is absent in k6-docs repo, though could be added anytime the need arises.
381+
355382
## Custom
356383

357384
It is also possible that you want to use a custom UI block in a certain `.md` document, not defined in this guide, like CTA button, or really any other piece of content from normal react page. By no means _do not copypast generated html into md file_: we are using `gatsby-plugin-mdx`, so please, just import the component you need right into `md` exactly the way you would import it on any react page and provide necessary props.
85.6 KB
Loading

0 commit comments

Comments
 (0)