/
blog-launch.md
355 lines (246 loc) · 10.6 KB
/
blog-launch.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
---
date: 2022-10-26
tags:
- markdown
authors:
- rdodin
---
# SR Linux Blog Launch
Openness, extensibility, innovation and community focus make a large part of the Nokia SR Linux core. Mix it up with our engineering background and you get a resource where we share technical content in the *engineers-to-engineers* fashion.
Today we would like to take it one step further and augment the **learn.srlinux.dev** portal with a community blog section where Nokia engineers and our community members can post content relevant to modern network technologies.
This blog post explains how to contribute a blog article to our portal and what visual candies you can use to make your post look awesome.
<!-- more -->
!!!question "What should I write about? Or should I even start writing?"
Likely the hardest thing in writing is to start. You may have dozens of doubts preventing you start writing.
*Is this interesting to anyone? Isn't it too obvious? Is it too short/long?*
The best advice here might be just to start writing and reiterate as you go. Nothing is perfect, and we welcome all to embrace the joy of writing, which helps to structure your own thoughts and get a firmer grip on the topic.
SR Linux appreciates modern network architectures, network automation/orchestration and programmability. Anything that falls under and in-between these domains will make a great blog post.
## Creating a blog post
Did you decide to contribute a blog post? That's great. Here is what you need to do.
1. Create a file under `./docs/blog/posts/<year>/<your-filename>.md`. A `<year>` is in the `YYYY` format and stands for the year the post was authored.
The filename you choose for your post is completely up to you and doesn't affect a URL or title of the blog post.
2. Write :smile: Use the classic markdown syntax and optionally apply our [advanced styling](#styling) for visual dominance.
3. Add a [date][date] to the post metadata.
4. Add yourself as a new [author](#authors) if this is your first contribution.
4. Create a new git branch and commit your post.
5. Check how your article looks using the live web server started with the `make serve-insiders` target[^1].
6. If all looks great, raise a PR with your work so we can review and merge it.
7. Profit!
## Authors
We want to give credit to the authors. To make yourself known to the community, please add an entry with your information to the [`.authors.yml`][authors-file] file that lists authors. Once added, you can add yourself to the frontmatter of the blog post:
```yaml
---
authors:
- rdodin #(1)!
---
```
1. `rdodin` is a key used in the `.authors.yml` file for a particular authors. Multiple authors can be added to the list of authors
## Styling
This portal uses the famous [mkdocs-material](https://squidfunk.github.io/mkdocs-material/) documentation theme. This theme packs a lot of UX improvements on top of classic markdown syntax. Knowing how to use those additional elements can make your post look awesome both from visual and user experience angles.
We would like to highlight a few UI elements we use all the time and hope you'll also like them.
!!!tip
Check the [mkdocs-material reference](https://squidfunk.github.io/mkdocs-material/reference/) for a deep dive in the ocean of options and elements mkdocs-material theme provides.
### Tabs
Tabs help to visually organize the content and improve readability an awful lot.
``` title="Content tabs with code blocks"
=== "C"
``` c
#include <stdio.h>
int main(void) {
printf("Hello world!\n");
return 0;
}
```
=== "C++"
``` c++
#include <iostream>
int main(void) {
std::cout << "Hello world!" << std::endl;
return 0;
}
```
```
<div class="result" markdown>
=== "C"
``` c
#include <stdio.h>
int main(void) {
printf("Hello world!\n");
return 0;
}
```
=== "C++"
``` c++
#include <iostream>
int main(void) {
std::cout << "Hello world!" << std::endl;
return 0;
}
```
</div>
### Code
Nowadays, code is everywhere. With a few styling aids you can make your code blocks look shart and expressive.
A regular code block with a syntax highlighting uses code fences style:
```` markdown title="Code block"
``` py
import tensorflow as tf
```
````
<div class="result" markdown>
``` py
import tensorflow as tf
```
</div>
#### Title
To add a title to a code block, use the `title` attribute:
```` markdown title="Code block with title"
``` py title="bubble_sort.py"
def bubble_sort(items):
for i in range(len(items)):
for j in range(len(items) - 1 - i):
if items[j] > items[j + 1]:
items[j], items[j + 1] = items[j + 1], items[j]
```
````
<div class="result" markdown>
``` py title="bubble_sort.py"
def bubble_sort(items):
for i in range(len(items)):
for j in range(len(items) - 1 - i):
if items[j] > items[j + 1]:
items[j], items[j + 1] = items[j + 1], items[j]
```
</div>
#### Line numbers
Line numbers can be added to a code block by using the `linenums="<start>"`
option directly after the shortcode, whereas `<start>` represents the starting
line number. A code block can start from a line number other than `1`, which
allows to split large code blocks for readability:
```` markdown title="Code block with line numbers"
``` py linenums="1"
def bubble_sort(items):
for i in range(len(items)):
for j in range(len(items) - 1 - i):
if items[j] > items[j + 1]:
items[j], items[j + 1] = items[j + 1], items[j]
```
````
<div class="result" markdown>
``` py linenums="1"
def bubble_sort(items):
for i in range(len(items)):
for j in range(len(items) - 1 - i):
if items[j] > items[j + 1]:
items[j], items[j + 1] = items[j + 1], items[j]
```
</div>
#### Highlighting specific lines
Specific lines can be highlighted by passing the line numbers to the `hl_lines`
argument placed right after the language shortcode. Note that line counts start
at `1`, regardless of the starting line number specified:
```` markdown title="Code block with highlighted lines"
``` py hl_lines="2 3"
def bubble_sort(items):
for i in range(len(items)):
for j in range(len(items) - 1 - i):
if items[j] > items[j + 1]:
items[j], items[j + 1] = items[j + 1], items[j]
```
````
<div class="result" markdown>
``` py linenums="1" hl_lines="2 3"
def bubble_sort(items):
for i in range(len(items)):
for j in range(len(items) - 1 - i):
if items[j] > items[j + 1]:
items[j], items[j + 1] = items[j + 1], items[j]
```
</div>
#### Annotations
Code annotations can be placed anywhere in a code block where a comment for the
language of the block can be placed, e.g. for JavaScript in `#!js // ...` and
`#!js /* ... */`, for YAML in `#!yaml # ...`, etc.:
```` markdown title="Code block with annotation"
``` yaml
theme:
features:
- content.code.annotate # (1)!
```
1. :man_raising_hand: I'm a code annotation! I can contain `code`, __formatted
text__, images, ... basically anything that can be written in Markdown.
````
<div class="result" markdown>
``` yaml
theme:
features:
- content.code.annotate # (1)!
```
1. :man_raising_hand: I'm a code annotation! I can contain `code`, __formatted
text__, images, ... basically anything that can be written in Markdown.
</div>
### Admonitions
[Admonitions](https://squidfunk.github.io/mkdocs-material/reference/admonitions/) is a great way to emphasize a piece of information. Check the original documentation for all the customizations available for admonitions.
``` markdown title="Admonition"
!!! note
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.
```
<div class="result" markdown>
!!! note
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.
</div>
### Icons
Our doc theme includes a [gazillion of icons](https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/) and emojis which are super easy to use. Use the [search tool](https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/#search) to find the icon code-block and paste it in your post.
``` title="Emoji"
:smile:
```
<div class="result" markdown>
:smile:
</div>
### Footnotes
Footnotes are a great way to add supplemental or additional information to a
specific word, phrase or sentence without interrupting the flow of a document.
Material for MkDocs provides the ability to define, reference and render
footnotes.
A footnote reference must be enclosed in square brackets and must start with a
caret `^`, directly followed by an arbitrary identifier, which is similar to
the standard Markdown link syntax.
``` title="Text with footnote references"
Lorem ipsum[^1] dolor sit amet, consectetur adipiscing elit.[^2]
```
<div class="result" markdown>
Lorem ipsum[^1] dolor sit amet, consectetur adipiscing elit.[^2]
</div>
The footnote content must be declared with the same identifier as the reference.
It can be inserted at an arbitrary position in the document and is always
rendered at the bottom of the page. Furthermore, a backlink to the footnote
reference is automatically added.
#### on a single line
Short footnotes can be written on the same line:
``` title="Footnote"
[^1]: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
```
<div class="result" markdown>
[:octicons-arrow-down-24: Jump to footnote](#fn:1)
</div>
[^1]: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
#### on multiple lines
Paragraphs can be written on the next line and must be indented by four spaces:
``` title="Footnote"
[^2]:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.
```
<div class="result" markdown>
[:octicons-arrow-down-24: Jump to footnote](#fn:2)
</div>
## Subscribing
Get notified when a new post is published using one of the [subscription options](../../subscribe.md) offered.
[^1]: Our community members who don't have access to the mkdocs-material-insiders version will have to skip this step until the blog feature becomes available in the community version of the mkdocs-material project.
[^2]: Example footnote
[authors-file]: https://github.com/srl-labs/learn-srlinux/blob/main/docs/blog/.authors.yml
[date]: https://github.com/srl-labs/learn-srlinux/blob/main/docs/blog/posts/2022/blog-launch.md?plain=1#L2