Welcome to mirror list, hosted at ThFree Co, Russian Federation.

index.html « goisforlovers « posts - github.com/surajmandalcell/potato-dark.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1ad09fe79a6f470d8fc66434be6ada321301e877 (plain)
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
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
<!DOCTYPE html>
<html lang="en-us">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1" />
  
  <title>(Hu)go Template Primer</title>
  <meta property="og:title" content="(Hu)go Template Primer" />
  <meta name="twitter:title" content="(Hu)go Template Primer" />
  

  

  <meta name="author" content=""/>
  <meta property="og:site_name" content="Your site title" />
  <meta property="og:url" content="https://surajmandalcell.github.io/potato-dark/posts/goisforlovers/" />

  
  <meta name="twitter:card" content="summary" />

  
  <meta name="twitter:site" content="@Your Twitter username" />
  <meta name="twitter:creator" content="@Your Twitter username" />
  

  
  <meta property="og:type" content="article" />
  
  <meta property="og:article:author" content="https://facebook.com/Your Facebook username" />
  
  
  
  <meta name="generator" content="Hugo 0.63.2" /><link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600" rel="stylesheet">
  <link rel="stylesheet" href="https://surajmandalcell.github.io/potato-dark//css/style.css" />
  <link rel='icon' type='image/x-icon' href="https://surajmandalcell.github.io/path/to/favicon" />
  <script type="text/javascript" src="https://surajmandalcell.github.io/potato-dark//js/bundle.js"></script>
  
<link rel="canonical" href="https://surajmandalcell.github.io/potato-dark/posts/goisforlovers/">
</head>

<body>
  <a href="#main" class="skip-link p-screen-reader-text">Skip to content</a>
  <svg xmlns="http://www.w3.org/2000/svg" style="display: none;" aria-hidden="true"> <symbol id="icon-500px" viewBox="0 0 16 16"><g> <path d="M3.953 10.512a5.24 5.24 0 0 0 6.996 3.141c.625-.262 1.184-.641 1.666-1.122s.859-1.041 1.122-1.666c.272-.647.412-1.331.412-2.037s-.137-1.394-.412-2.037c-.262-.625-.641-1.184-1.122-1.666s-1.041-.859-1.666-1.122a5.226 5.226 0 0 0-2.037-.413c-.716 0-1.431.144-2.066.413-.509.216-1.372.769-1.875 1.291l-.003.003V.984h7.241c.262-.003.262-.372.262-.491 0-.122 0-.487-.266-.491H4.377a.343.343 0 0 0-.344.341v6.066c0 .197.244.338.472.384.444.094.544-.047.653-.197l.016-.019c.166-.247.681-.766.688-.772a4.262 4.262 0 0 1 3.037-1.25c1.147 0 2.222.444 3.028 1.25a4.245 4.245 0 0 1 1.256 3.019 4.236 4.236 0 0 1-1.25 3.019 4.336 4.336 0 0 1-3.047 1.25 4.136 4.136 0 0 1-2.159-.597l.003-3.688c0-.491.213-1.028.572-1.431a2.09 2.09 0 0 1 1.588-.716c.594 0 1.15.225 1.566.634.409.406.637.95.637 1.528a2.179 2.179 0 0 1-2.206 2.197c-.238 0-.672-.106-.691-.109-.25-.075-.356.272-.391.387-.134.441.069.528.109.541.397.125.659.147 1.003.147a3.173 3.173 0 0 0 3.169-3.169c0-1.734-1.422-3.144-3.166-3.144-.856 0-1.659.328-2.263.919-.575.566-.903 1.319-.903 2.069v.019c-.003.094-.003 2.306-.006 3.031l-.003-.003c-.328-.363-.653-.919-.869-1.488-.084-.222-.275-.184-.534-.103-.125.034-.469.141-.391.394zm3.722-.865c0 .106.097.2.156.253l.019.019c.1.097.194.147.281.147a.181.181 0 0 0 .131-.05c.044-.041.537-.544.588-.591l.553.55c.05.056.106.088.172.088.088 0 .184-.053.284-.156.238-.244.119-.375.063-.438l-.559-.559.584-.588c.128-.137.016-.284-.097-.397-.162-.162-.322-.206-.422-.112l-.581.581-.588-.588a.16.16 0 0 0-.113-.047c-.078 0-.172.053-.275.156-.181.181-.219.306-.125.406l.588.584-.584.584c-.053.05-.078.103-.075.156zm1.278-7.931c-.938 0-1.938.191-2.669.506a.207.207 0 0 0-.134.181.753.753 0 0 0 .069.337c.047.116.166.425.4.334a6.689 6.689 0 0 1 2.334-.444 6.35 6.35 0 0 1 2.469.497c.622.263 1.206.644 1.844 1.194a.22.22 0 0 0 .147.059c.125 0 .244-.122.347-.237.169-.191.287-.35.119-.509a6.858 6.858 0 0 0-2.1-1.356 7.326 7.326 0 0 0-2.825-.563zM14.006 13.3c-.113-.113-.209-.178-.294-.203s-.162-.006-.222.053l-.056.056a6.32 6.32 0 0 1-6.938 1.356 6.336 6.336 0 0 1-2.013-1.356 6.046 6.046 0 0 1-1.356-2.012c-.288-.713-.381-1.247-.413-1.422-.003-.016-.006-.028-.006-.037-.041-.206-.231-.222-.503-.178-.112.019-.459.072-.428.319v.006a7.261 7.261 0 0 0 2.04 3.994 7.266 7.266 0 0 0 10.288 0l.059-.059c.069-.084.134-.225-.159-.516z"/> </g></symbol> <symbol id="icon-codepen" viewBox="0 0 16 16"><g> <path d="M14.777 5.751l-7-4.667a.5.5 0 0 0-.555 0l-7 4.667a.501.501 0 0 0-.223.416v4.667c0 .167.084.323.223.416l7 4.667a.5.5 0 0 0 .554 0l7-4.667a.501.501 0 0 0 .223-.416V6.167a.501.501 0 0 0-.223-.416zM7.5 10.232L4.901 8.5 7.5 6.768 10.099 8.5 7.5 10.232zM8 5.899V2.434l5.599 3.732L11 7.898l-3-2zm-1 0l-3 2-2.599-1.732L7 2.435V5.9zM3.099 8.5L1 9.899V7.101L3.099 8.5zM4 9.101l3 2v3.465l-5.599-3.732L4 9.102zm4 2l3-2 2.599 1.732L8 14.565V11.1zM11.901 8.5L14 7.101v2.798L11.901 8.5z"/> </g></symbol> <symbol id="icon-dribbble" viewBox="0 0 16 16"><g> <path d="M8 16c-4.412 0-8-3.588-8-8s3.587-8 8-8c4.412 0 8 3.587 8 8s-3.588 8-8 8zm6.747-6.906c-.234-.075-2.116-.634-4.256-.291a29.7 29.7 0 0 1 1.328 4.872 6.845 6.845 0 0 0 2.928-4.581zM10.669 14.3c-.103-.6-.497-2.688-1.456-5.181-.016.006-.031.009-.044.016-3.856 1.344-5.241 4.016-5.362 4.266a6.807 6.807 0 0 0 6.863.9zm-7.747-1.722c.156-.266 2.031-3.369 5.553-4.509a7.04 7.04 0 0 1 .269-.081 24.04 24.04 0 0 0-.553-1.159c-3.409 1.022-6.722.978-7.022.975-.003.069-.003.138-.003.209 0 1.753.666 3.356 1.756 4.566zM1.313 6.609c.306.003 3.122.016 6.319-.831a43.092 43.092 0 0 0-2.534-3.953 6.854 6.854 0 0 0-3.784 4.784zM6.4 1.366a36.612 36.612 0 0 1 2.55 4c2.431-.909 3.459-2.294 3.581-2.469A6.799 6.799 0 0 0 6.4 1.366zm6.891 2.325c-.144.194-1.291 1.663-3.816 2.694.159.325.313.656.453.991.05.119.1.234.147.353 2.275-.284 4.534.172 4.759.219a6.816 6.816 0 0 0-1.544-4.256z"/> </g></symbol> <symbol id="icon-facebook" viewBox="0 0 16 16"><g> <path d="M9.5 3H12V0H9.5C7.57 0 6 1.57 6 3.5V5H4v3h2v8h3V8h2.5l.5-3H9V3.5c0-.271.229-.5.5-.5z"/> </g></symbol> <symbol id="icon-feed" viewBox="0 0 16 16"><g> <path d="M2.13 11.733c-1.175 0-2.13.958-2.13 2.126 0 1.174.955 2.122 2.13 2.122a2.126 2.126 0 0 0 2.133-2.122 2.133 2.133 0 0 0-2.133-2.126zM.002 5.436v3.067c1.997 0 3.874.781 5.288 2.196a7.45 7.45 0 0 1 2.192 5.302h3.08c0-5.825-4.739-10.564-10.56-10.564zM.006 0v3.068C7.128 3.068 12.924 8.87 12.924 16H16C16 7.18 8.824 0 .006 0z"/> </g></symbol> <symbol id="icon-flickr" viewBox="0 0 16 16"><g> <path d="M0 8.5a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0zm9 0a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/> </g></symbol> <symbol id="icon-github" viewBox="0 0 16 16"><g> <path d="M8 .198a8 8 0 0 0-2.529 15.591c.4.074.547-.174.547-.385 0-.191-.008-.821-.011-1.489-2.226.484-2.695-.944-2.695-.944-.364-.925-.888-1.171-.888-1.171-.726-.497.055-.486.055-.486.803.056 1.226.824 1.226.824.714 1.223 1.872.869 2.328.665.072-.517.279-.87.508-1.07-1.777-.202-3.645-.888-3.645-3.954 0-.873.313-1.587.824-2.147-.083-.202-.357-1.015.077-2.117 0 0 .672-.215 2.201.82A7.672 7.672 0 0 1 8 4.066c.68.003 1.365.092 2.004.269 1.527-1.035 2.198-.82 2.198-.82.435 1.102.162 1.916.079 2.117.513.56.823 1.274.823 2.147 0 3.073-1.872 3.749-3.653 3.947.287.248.543.735.543 1.481 0 1.07-.009 1.932-.009 2.195 0 .213.144.462.55.384A8 8 0 0 0 8.001.196z"/> </g></symbol> <symbol id="icon-gitlab" viewBox="0 0 28 28"><g> <path d="M1.625 11.031L14 26.89.437 17.046a1.092 1.092 0 0 1-.391-1.203l1.578-4.813zm7.219 0h10.313L14.001 26.89zM5.75 1.469l3.094 9.562H1.625l3.094-9.562a.548.548 0 0 1 1.031 0zm20.625 9.562l1.578 4.813a1.09 1.09 0 0 1-.391 1.203l-13.563 9.844 12.375-15.859zm0 0h-7.219l3.094-9.562a.548.548 0 0 1 1.031 0z"/> </g></symbol> <symbol id="icon-google-plus" viewBox="0 0 16 16"><g> <path d="M5.091 7.147v1.747h2.888c-.116.75-.872 2.197-2.888 2.197-1.737 0-3.156-1.441-3.156-3.216s1.419-3.216 3.156-3.216c.991 0 1.65.422 2.028.784L8.5 4.112c-.888-.828-2.037-1.331-3.409-1.331C2.275 2.784 0 5.059 0 7.875s2.275 5.091 5.091 5.091c2.937 0 4.888-2.066 4.888-4.975 0-.334-.037-.591-.081-.844H5.092zM16 7h-1.5V5.5H13V7h-1.5v1.5H13V10h1.5V8.5H16z"/> </g></symbol> <symbol id="icon-google" viewBox="0 0 16 16"><g> <path d="M8.159 6.856V9.6h4.537c-.184 1.178-1.372 3.45-4.537 3.45C5.428 13.05 3.2 10.788 3.2 8s2.228-5.05 4.959-5.05c1.553 0 2.594.663 3.188 1.234l2.172-2.091C12.125.787 10.319-.001 8.16-.001c-4.422 0-8 3.578-8 8s3.578 8 8 8c4.616 0 7.681-3.247 7.681-7.816 0-.525-.056-.925-.125-1.325L8.16 6.855z"/> </g></symbol> <symbol id="icon-instagram" viewBox="0 0 22 22"><g> <path d="M15.445 0H6.554A6.559 6.559 0 0 0 0 6.554v8.891A6.559 6.559 0 0 0 6.554 22h8.891a6.56 6.56 0 0 0 6.554-6.555V6.554A6.557 6.557 0 0 0 15.445 0zm4.342 15.445a4.343 4.343 0 0 1-4.342 4.342H6.554a4.341 4.341 0 0 1-4.341-4.342V6.554a4.34 4.34 0 0 1 4.341-4.341h8.891a4.342 4.342 0 0 1 4.341 4.341l.001 8.891z"/> <path d="M11 5.312A5.693 5.693 0 0 0 5.312 11 5.694 5.694 0 0 0 11 16.688 5.694 5.694 0 0 0 16.688 11 5.693 5.693 0 0 0 11 5.312zm0 9.163a3.475 3.475 0 1 1-.001-6.95 3.475 3.475 0 0 1 .001 6.95zm5.7-10.484a1.363 1.363 0 1 1-1.364 1.364c0-.752.51-1.364 1.364-1.364z"/> </g></symbol> <symbol id="icon-linkedin" viewBox="0 0 16 16"><g> <path d="M6 6h2.767v1.418h.04C9.192 6.727 10.134 6 11.539 6 14.46 6 15 7.818 15 10.183V15h-2.885v-4.27c0-1.018-.021-2.329-1.5-2.329-1.502 0-1.732 1.109-1.732 2.255V15H6V6zM1 6h3v9H1V6zM4 3.5a1.5 1.5 0 1 1-3.001-.001A1.5 1.5 0 0 1 4 3.5z"/> </g></symbol> <symbol id="icon-mail" viewBox="0 0 22 18"><g> <path fill="#000" d="M0 17.225V.776h22v16.447H0v.002zm3.011-1.815h15.978l-5.111-5.115L11 13.179l-2.877-2.883-5.112 5.114zm-1.216-1.275l5.077-5.09L1.795 3.98v10.155zm13.332-5.09l5.079 5.09V3.979l-5.079 5.066zm-4.126 1.588l8.022-8.027-16.045-.001 8.023 8.028z"/> </g></symbol> <symbol id="icon-npm" viewBox="0 0 16 16"><g> <path d="M0 0v16h16V0H0zm13 13h-2V5H8v8H3V3h10v10z"/> </g></symbol> <symbol id="icon-pinterest" viewBox="0 0 16 16"><g> <path d="M8 1.069a6.93 6.93 0 0 0-2.525 13.384c-.059-.547-.116-1.391.025-1.988.125-.541.813-3.444.813-3.444s-.206-.416-.206-1.028c0-.963.559-1.684 1.253-1.684.591 0 .878.444.878.975 0 .594-.378 1.484-.575 2.306-.166.691.344 1.253 1.025 1.253 1.231 0 2.178-1.3 2.178-3.175 0-1.659-1.194-2.819-2.894-2.819-1.972 0-3.128 1.478-3.128 3.009 0 .597.228 1.234.516 1.581.056.069.066.128.047.2a95.89 95.89 0 0 1-.194.787c-.031.128-.1.153-.231.094-.866-.403-1.406-1.669-1.406-2.684 0-2.188 1.587-4.194 4.578-4.194 2.403 0 4.272 1.712 4.272 4.003 0 2.388-1.506 4.313-3.597 4.313-.703 0-1.362-.366-1.588-.797 0 0-.347 1.322-.431 1.647-.156.603-.578 1.356-.862 1.816a6.93 6.93 0 0 0 8.984-6.622 6.931 6.931 0 0 0-6.931-6.934z"/> </g></symbol> <symbol id="icon-pushpin" viewBox="0 0 16 16"><g> <path d="M8.5 0L7 1.5 8.5 3 5 7H1.5l2.75 2.75L0 15.385V16h.615l5.635-4.25L9 14.5V11l4-3.5L14.5 9 16 7.5 8.5 0zM7 8.5l-1-1L9.5 4l1 1L7 8.5z"/> </g></symbol> <symbol id="icon-search" viewBox="0 0 16 16"><g> <path d="M15.504 13.616l-3.79-3.223c-.392-.353-.811-.514-1.149-.499a6 6 0 1 0-.672.672c-.016.338.146.757.499 1.149l3.223 3.79c.552.613 1.453.665 2.003.115s.498-1.452-.115-2.003zM6 10a4 4 0 1 1 0-8 4 4 0 0 1 0 8z"/> </g></symbol> <symbol id="icon-tumblr" viewBox="0 0 16 16"><g> <path d="M9.001 7v3.659c0 .928-.012 1.463.086 1.727.098.262.342.534.609.691.354.212.758.318 1.214.318.81 0 1.289-.107 2.09-.633v2.405a9.089 9.089 0 0 1-1.833.639A7.93 7.93 0 0 1 9.369 16a4.9 4.9 0 0 1-1.725-.276 4.195 4.195 0 0 1-1.438-.79c-.398-.343-.672-.706-.826-1.091s-.23-.944-.23-1.676V6.556H3.003V4.29c.628-.204 1.331-.497 1.778-.877a4.386 4.386 0 0 0 1.08-1.374C6.133 1.505 6.32.825 6.422 0h2.579v4H13v3H9.001z"/> </g></symbol> <symbol id="icon-twitter" viewBox="0 0 16 16"><g> <path d="M16 3.538a6.461 6.461 0 0 1-1.884.516 3.301 3.301 0 0 0 1.444-1.816 6.607 6.607 0 0 1-2.084.797 3.28 3.28 0 0 0-2.397-1.034 3.28 3.28 0 0 0-3.197 4.028 9.321 9.321 0 0 1-6.766-3.431 3.284 3.284 0 0 0 1.015 4.381A3.301 3.301 0 0 1 .643 6.57v.041A3.283 3.283 0 0 0 3.277 9.83a3.291 3.291 0 0 1-1.485.057 3.293 3.293 0 0 0 3.066 2.281 6.586 6.586 0 0 1-4.862 1.359 9.286 9.286 0 0 0 5.034 1.475c6.037 0 9.341-5.003 9.341-9.341 0-.144-.003-.284-.009-.425a6.59 6.59 0 0 0 1.637-1.697z"/> </g></symbol> <symbol id="icon-vimeo" viewBox="0 0 16 16"><g> <path d="M15.994 4.281c-.072 1.556-1.159 3.691-3.263 6.397-2.175 2.825-4.016 4.241-5.522 4.241-.931 0-1.722-.859-2.366-2.581-.431-1.578-.859-3.156-1.291-4.734-.478-1.722-.991-2.581-1.541-2.581-.119 0-.538.253-1.256.753l-.753-.969c.791-.694 1.569-1.388 2.334-2.081 1.053-.909 1.844-1.387 2.372-1.438 1.244-.119 2.013.731 2.3 2.553.309 1.966.525 3.188.647 3.666.359 1.631.753 2.447 1.184 2.447.334 0 .838-.528 1.509-1.588.669-1.056 1.028-1.862 1.078-2.416.097-.912-.262-1.372-1.078-1.372a2.98 2.98 0 0 0-1.184.263c.787-2.575 2.287-3.825 4.506-3.753 1.641.044 2.416 1.109 2.322 3.194z"/> </g></symbol> <symbol id="icon-wordpress" viewBox="0 0 16 16"><g> <path d="M2 8c0 2.313 1.38 4.312 3.382 5.259L2.52 5.622A5.693 5.693 0 0 0 2 8zm10.05-.295c0-.722-.266-1.222-.495-1.612-.304-.482-.589-.889-.589-1.371 0-.537.418-1.037 1.008-1.037.027 0 .052.003.078.005A6.064 6.064 0 0 0 8 2.156 6.036 6.036 0 0 0 2.987 4.79c.141.004.274.007.386.007.627 0 1.599-.074 1.599-.074.323-.018.361.444.038.482 0 0-.325.037-.687.055l2.185 6.33 1.313-3.835-.935-2.495a12.304 12.304 0 0 1-.629-.055c-.323-.019-.285-.5.038-.482 0 0 .991.074 1.58.074.627 0 1.599-.074 1.599-.074.323-.018.362.444.038.482 0 0-.326.037-.687.055l2.168 6.282.599-1.947c.259-.809.457-1.389.457-1.889zm-3.945.806l-1.8 5.095a6.148 6.148 0 0 0 3.687-.093.52.52 0 0 1-.043-.081L8.105 8.511zm5.16-3.315c.026.186.04.386.04.601 0 .593-.114 1.259-.456 2.093l-1.833 5.16c1.784-1.013 2.983-2.895 2.983-5.051a5.697 5.697 0 0 0-.735-2.803zM8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm0 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14z"/> </g></symbol> <symbol id="icon-youtube" viewBox="0 0 16 16"><g> <path d="M15.841 4.8s-.156-1.103-.637-1.587c-.609-.637-1.291-.641-1.603-.678-2.237-.163-5.597-.163-5.597-.163h-.006s-3.359 0-5.597.163c-.313.038-.994.041-1.603.678C.317 3.697.164 4.8.164 4.8S.005 6.094.005 7.391v1.213c0 1.294.159 2.591.159 2.591s.156 1.103.634 1.588c.609.637 1.409.616 1.766.684 1.281.122 5.441.159 5.441.159s3.363-.006 5.6-.166c.313-.037.994-.041 1.603-.678.481-.484.637-1.588.637-1.588s.159-1.294.159-2.591V7.39c-.003-1.294-.162-2.591-.162-2.591zm-9.494 5.275V5.578l4.322 2.256-4.322 2.241z"/> </g></symbol></svg>
  <header class="l-header">
    
<nav class="l-nav p-menu">
  <ul class="p-menu__lists">
    
      
      <li class="p-menu__listitem">
        <a href="/potato-dark/">Blog</a>
      </li>
      
    
      
      <li class="p-menu__listitem">
        <a href="/potato-dark/about">About</a>
      </li>
      
    
      
      <li class="p-menu__listitem">
        <a href="">Theme</a>
      </li>
      
    
  </ul>
</nav>


    
    <p class="c-title p-title"><a href="https://surajmandalcell.github.io/potato-dark/" class="p-title__link">Your site title</a></p>
    
    
  </header>
  <main id="main" class="l-main">


<article class="p-article">
  <header>
    <h1>(Hu)go Template Primer</h1>
    <div>
      <div class="c-time">
        Posted on
        <time datetime="2014-04-02T00:00:00Z">
          Apr 2, 2014
        </time>
      </div>
      
      <a href="https://surajmandalcell.github.io/potato-dark/tags/go" class="c-tag">go</a>
      
      <a href="https://surajmandalcell.github.io/potato-dark/tags/golang" class="c-tag">golang</a>
      
      <a href="https://surajmandalcell.github.io/potato-dark/tags/templates" class="c-tag">templates</a>
      
      <a href="https://surajmandalcell.github.io/potato-dark/tags/themes" class="c-tag">themes</a>
      
      <a href="https://surajmandalcell.github.io/potato-dark/tags/development" class="c-tag">development</a>
      
    </div>
  </header>
  
  <section id="js-article" class="p-article__body">
    <p>Hugo uses the excellent <a href="http://golang.org/">go</a> <a href="http://golang.org/pkg/html/template/">html/template</a> library for
its template engine. It is an extremely lightweight engine that provides a very
small amount of logic. In our experience that it is just the right amount of
logic to be able to create a good static website. If you have used other
template systems from different languages or frameworks you will find a lot of
similarities in go templates.</p>
<p>This document is a brief primer on using go templates. The <a href="http://golang.org/pkg/html/template/">go docs</a>
provide more details.</p>
<h2 id="introduction-to-go-templates">Introduction to Go Templates</h2>
<p>Go templates provide an extremely simple template language. It adheres to the
belief that only the most basic of logic belongs in the template or view layer.
One consequence of this simplicity is that go templates parse very quickly.</p>
<p>A unique characteristic of go templates is they are content aware. Variables and
content will be sanitized depending on the context of where they are used. More
details can be found in the <a href="http://golang.org/pkg/html/template/">go docs</a>.</p>
<h2 id="basic-syntax">Basic Syntax</h2>
<p>Go lang templates are html files with the addition of variables and
functions.</p>
<p><strong>Go variables and functions are accessible within {{ }}</strong></p>
<p>Accessing a predefined variable &ldquo;foo&rdquo;:</p>
<pre><code>{{ foo }}
</code></pre>
<p><strong>Parameters are separated using spaces</strong></p>
<p>Calling the add function with input of 1, 2:</p>
<pre><code>{{ add 1 2 }}
</code></pre>
<p><strong>Methods and fields are accessed via dot notation</strong></p>
<p>Accessing the Page Parameter &ldquo;bar&rdquo;</p>
<pre><code>{{ .Params.bar }}
</code></pre>
<p><strong>Parentheses can be used to group items together</strong></p>
<pre><code>{{ if or (isset .Params &quot;alt&quot;) (isset .Params &quot;caption&quot;) }} Caption {{ end }}
</code></pre>
<h2 id="variables">Variables</h2>
<p>Each go template has a struct (object) made available to it. In hugo each
template is passed either a page or a node struct depending on which type of
page you are rendering. More details are available on the
<a href="/layout/variables">variables</a> page.</p>
<p>A variable is accessed by referencing the variable name.</p>
<pre><code>&lt;title&gt;{{ .Title }}&lt;/title&gt;
</code></pre>
<p>Variables can also be defined and referenced.</p>
<pre><code>{{ $address := &quot;123 Main St.&quot;}}
{{ $address }}
</code></pre>
<h2 id="functions">Functions</h2>
<p>Go template ship with a few functions which provide basic functionality. The go
template system also provides a mechanism for applications to extend the
available functions with their own. <a href="/layout/functions">Hugo template
functions</a> provide some additional functionality we believe
are useful for building websites. Functions are called by using their name
followed by the required parameters separated by spaces. Template
functions cannot be added without recompiling hugo.</p>
<p><strong>Example:</strong></p>
<pre><code>{{ add 1 2 }}
</code></pre>
<h2 id="includes">Includes</h2>
<p>When including another template you will pass to it the data it will be
able to access. To pass along the current context please remember to
include a trailing dot. The templates location will always be starting at
the /layout/ directory within Hugo.</p>
<p><strong>Example:</strong></p>
<pre><code>{{ template &quot;chrome/header.html&quot; . }}
</code></pre>
<h2 id="logic">Logic</h2>
<p>Go templates provide the most basic iteration and conditional logic.</p>
<h3 id="iteration">Iteration</h3>
<p>Just like in go, the go templates make heavy use of range to iterate over
a map, array or slice. The following are different examples of how to use
range.</p>
<p><strong>Example 1: Using Context</strong></p>
<pre><code>{{ range array }}
    {{ . }}
{{ end }}
</code></pre>
<p><strong>Example 2: Declaring value variable name</strong></p>
<pre><code>{{range $element := array}}
    {{ $element }}
{{ end }}
</code></pre>
<p><strong>Example 2: Declaring key and value variable name</strong></p>
<pre><code>{{range $index, $element := array}}
    {{ $index }}
    {{ $element }}
{{ end }}
</code></pre>
<h3 id="conditionals">Conditionals</h3>
<p>If, else, with, or, &amp; and provide the framework for handling conditional
logic in Go Templates. Like range, each statement is closed with <code>end</code>.</p>
<p>Go Templates treat the following values as false:</p>
<ul>
<li>false</li>
<li>0</li>
<li>any array, slice, map, or string of length zero</li>
</ul>
<p><strong>Example 1: If</strong></p>
<pre><code>{{ if isset .Params &quot;title&quot; }}&lt;h4&gt;{{ index .Params &quot;title&quot; }}&lt;/h4&gt;{{ end }}
</code></pre>
<p><strong>Example 2: If -&gt; Else</strong></p>
<pre><code>{{ if isset .Params &quot;alt&quot; }}
    {{ index .Params &quot;alt&quot; }}
{{else}}
    {{ index .Params &quot;caption&quot; }}
{{ end }}
</code></pre>
<p><strong>Example 3: And &amp; Or</strong></p>
<pre><code>{{ if and (or (isset .Params &quot;title&quot;) (isset .Params &quot;caption&quot;)) (isset .Params &quot;attr&quot;)}}
</code></pre>
<p><strong>Example 4: With</strong></p>
<p>An alternative way of writing &ldquo;if&rdquo; and then referencing the same value
is to use &ldquo;with&rdquo; instead. With rebinds the context <code>.</code> within its scope,
and skips the block if the variable is absent.</p>
<p>The first example above could be simplified as:</p>
<pre><code>{{ with .Params.title }}&lt;h4&gt;{{ . }}&lt;/h4&gt;{{ end }}
</code></pre>
<p><strong>Example 5: If -&gt; Else If</strong></p>
<pre><code>{{ if isset .Params &quot;alt&quot; }}
    {{ index .Params &quot;alt&quot; }}
{{ else if isset .Params &quot;caption&quot; }}
    {{ index .Params &quot;caption&quot; }}
{{ end }}
</code></pre>
<h2 id="pipes">Pipes</h2>
<p>One of the most powerful components of go templates is the ability to
stack actions one after another. This is done by using pipes. Borrowed
from unix pipes, the concept is simple, each pipeline&rsquo;s output becomes the
input of the following pipe.</p>
<p>Because of the very simple syntax of go templates, the pipe is essential
to being able to chain together function calls. One limitation of the
pipes is that they only can work with a single value and that value
becomes the last parameter of the next pipeline.</p>
<p>A few simple examples should help convey how to use the pipe.</p>
<p><strong>Example 1 :</strong></p>
<pre><code>{{ if eq 1 1 }} Same {{ end }}
</code></pre>
<p>is the same as</p>
<pre><code>{{ eq 1 1 | if }} Same {{ end }}
</code></pre>
<p>It does look odd to place the if at the end, but it does provide a good
illustration of how to use the pipes.</p>
<p><strong>Example 2 :</strong></p>
<pre><code>{{ index .Params &quot;disqus_url&quot; | html }}
</code></pre>
<p>Access the page parameter called &ldquo;disqus_url&rdquo; and escape the HTML.</p>
<p><strong>Example 3 :</strong></p>
<pre><code>{{ if or (or (isset .Params &quot;title&quot;) (isset .Params &quot;caption&quot;)) (isset .Params &quot;attr&quot;)}}
Stuff Here
{{ end }}
</code></pre>
<p>Could be rewritten as</p>
<pre><code>{{  isset .Params &quot;caption&quot; | or isset .Params &quot;title&quot; | or isset .Params &quot;attr&quot; | if }}
Stuff Here
{{ end }}
</code></pre>
<h2 id="context-aka-the-dot">Context (aka. the dot)</h2>
<p>The most easily overlooked concept to understand about go templates is that {{ . }}
always refers to the current context. In the top level of your template this
will be the data set made available to it. Inside of a iteration it will have
the value of the current item. When inside of a loop the context has changed. .
will no longer refer to the data available to the entire page. If you need to
access this from within the loop you will likely want to set it to a variable
instead of depending on the context.</p>
<p><strong>Example:</strong></p>
<pre><code>  {{ $title := .Site.Title }}
  {{ range .Params.tags }}
    &lt;li&gt; &lt;a href=&quot;{{ $baseurl }}/tags/{{ . | urlize }}&quot;&gt;{{ . }}&lt;/a&gt; - {{ $title }} &lt;/li&gt;
  {{ end }}
</code></pre>
<p>Notice how once we have entered the loop the value of {{ . }} has changed. We
have defined a variable outside of the loop so we have access to it from within
the loop.</p>
<h1 id="hugo-parameters">Hugo Parameters</h1>
<p>Hugo provides the option of passing values to the template language
through the site configuration (for sitewide values), or through the meta
data of each specific piece of content. You can define any values of any
type (supported by your front matter/config format) and use them however
you want to inside of your templates.</p>
<h2 id="using-content-page-parameters">Using Content (page) Parameters</h2>
<p>In each piece of content you can provide variables to be used by the
templates. This happens in the <a href="/content/front-matter">front matter</a>.</p>
<p>An example of this is used in this documentation site. Most of the pages
benefit from having the table of contents provided. Sometimes the TOC just
doesn&rsquo;t make a lot of sense. We&rsquo;ve defined a variable in our front matter
of some pages to turn off the TOC from being displayed.</p>
<p>Here is the example front matter:</p>
<pre><code>---
title: &quot;Permalinks&quot;
date: &quot;2013-11-18&quot;
aliases:
  - &quot;/doc/permalinks/&quot;
groups: [&quot;extras&quot;]
groups_weight: 30
notoc: true
---
</code></pre><p>Here is the corresponding code inside of the template:</p>
<pre><code>  {{ if not .Params.notoc }}
    &lt;div id=&quot;toc&quot; class=&quot;well col-md-4 col-sm-6&quot;&gt;
    {{ .TableOfContents }}
    &lt;/div&gt;
  {{ end }}
</code></pre>
<h2 id="using-site-config-parameters">Using Site (config) Parameters</h2>
<p>In your top-level configuration file (eg, <code>config.yaml</code>) you can define site
parameters, which are values which will be available to you in chrome.</p>
<p>For instance, you might declare:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml">params:
  <span style="color:#66d9ef">CopyrightHTML</span>: <span style="color:#e6db74">&#34;Copyright &amp;#xA9; 2013 John Doe. All Rights Reserved.&#34;</span>
  <span style="color:#66d9ef">TwitterUser</span>: <span style="color:#e6db74">&#34;spf13&#34;</span>
  <span style="color:#66d9ef">SidebarRecentLimit</span>: <span style="color:#ae81ff">5</span>
</code></pre></div><p>Within a footer layout, you might then declare a <code>&lt;footer&gt;</code> which is only
provided if the <code>CopyrightHTML</code> parameter is provided, and if it is given,
you would declare it to be HTML-safe, so that the HTML entity is not escaped
again.  This would let you easily update just your top-level config file each
January 1st, instead of hunting through your templates.</p>
<pre><code>{{if .Site.Params.CopyrightHTML}}&lt;footer&gt;
&lt;div class=&quot;text-center&quot;&gt;{{.Site.Params.CopyrightHTML | safeHtml}}&lt;/div&gt;
&lt;/footer&gt;{{end}}
</code></pre><p>An alternative way of writing the &ldquo;if&rdquo; and then referencing the same value
is to use &ldquo;with&rdquo; instead. With rebinds the context <code>.</code> within its scope,
and skips the block if the variable is absent:</p>
<pre><code>{{with .Site.Params.TwitterUser}}&lt;span class=&quot;twitter&quot;&gt;
&lt;a href=&quot;https://twitter.com/{{.}}&quot; rel=&quot;author&quot;&gt;
&lt;img src=&quot;/images/twitter.png&quot; width=&quot;48&quot; height=&quot;48&quot; title=&quot;Twitter: {{.}}&quot;
 alt=&quot;Twitter&quot;&gt;&lt;/a&gt;
&lt;/span&gt;{{end}}
</code></pre><p>Finally, if you want to pull &ldquo;magic constants&rdquo; out of your layouts, you can do
so, such as in this example:</p>
<pre><code>&lt;nav class=&quot;recent&quot;&gt;
  &lt;h1&gt;Recent Posts&lt;/h1&gt;
  &lt;ul&gt;{{range first .Site.Params.SidebarRecentLimit .Site.Recent}}
    &lt;li&gt;&lt;a href=&quot;{{.RelPermalink}}&quot;&gt;{{.Title}}&lt;/a&gt;&lt;/li&gt;
  {{end}}&lt;/ul&gt;
&lt;/nav&gt;
</code></pre>
  </section>
  <footer>
    
    
    
    <nav class="p-pagination c-pagination">
      <div class="c-pagination__ctrl">
        <div class="c-pagination__newer">
          
          <a href="https://surajmandalcell.github.io/potato-dark/posts/hugoisforlovers/">Newer</a>
          
        </div>
        <div class="c-pagination__older">
          
          <a href="https://surajmandalcell.github.io/potato-dark/about/">Older</a>
          
        </div>
      </div>
    </nav>
    

<section class="p-related">
  <h3>See Also</h3>
  <ul id="slider" class="p-related__list">
    
    <li class="p-related__item js-related__item">
      <a href="/potato-dark/posts/hugoisforlovers/"
        >
        <span>Getting Started with Hugo</span>
      </a>
    </li>
    
  </ul>
</section>


  </footer>
</article>
  </main>
  <footer class="l-footer">
    
<ul class="c-links">
  
  <li class="c-links__item">
    <a href="https://twitter.com/Your%20Twitter%20username" target="_blank">
      <svg viewBox="0 0 64 64" class="c-links__icon">
        <title>twitter</title>
        <use xlink:href="#icon-twitter"></use>
      </svg>
    </a>
  </li>
  
  
  <li class="c-links__item">
    <a href="https://facebook.com/Your%20Facebook%20username" target="_blank">
      <svg viewBox="0 0 64 64" class="c-links__icon">
        <title>facebook</title>
        <use xlink:href="#icon-facebook"></use>
      </svg>
    </a>
  </li>
  
  
  <li class="c-links__item">
    <a href="https://instagram.com/Your%20Instagram%20username" target="_blank">
      <svg viewBox="0 0 64 64" class="c-links__icon">
        <title>instagram</title>
        <use xlink:href="#icon-instagram"></use>
      </svg>
    </a>
  </li>
  
  
  
  <li class="c-links__item">
    <a href="https://github.com/Your%20GitHub%20username" target="_blank">
      <svg viewBox="0 0 64 64" class="c-links__icon">
        <title>github</title>
        <use xlink:href="#icon-github"></use>
      </svg>
    </a>
  </li>
  
  
  <li class="c-links__item">
    <a href="https://gitlab.com/Your%20GitLab%20username" target="_blank">
      <svg viewBox="0 0 64 64" class="c-links__icon">
        <title>gitlab</title>
        <use xlink:href="#icon-gitlab"></use>
      </svg>
    </a>
  </li>
  
  
  <li class="c-links__item">
    <a href="https://www.npmjs.com/Your%20npm%20username" target="_blank">
      <svg viewBox="0 0 64 64" class="c-links__icon">
        <title>npm</title>
        <use xlink:href="#icon-npm"></use>
      </svg>
    </a>
  </li>
  
  
  <li class="c-links__item">
    <a href="https://codepen.io/Your%20CodePen%20username" target="_blank">
      <svg viewBox="0 0 64 64" class="c-links__icon">
        <title>codepen</title>
        <use xlink:href="#icon-codepen"></use>
      </svg>
    </a>
  </li>
  
  
  <li class="c-links__item">
    <a href="https://dribbble.com/Your%20Dribbble%20username" target="_blank">
      <svg viewBox="0 0 64 64" class="c-links__icon">
        <title>dribbble</title>
        <use xlink:href="#icon-dribbble"></use>
      </svg>
    </a>
  </li>
  
  
  <li class="c-links__item">
    <a href="https://500px.com/Your%20500px%20username" target="_blank">
      <svg viewBox="0 0 64 64" class="c-links__icon">
        <title>500px</title>
        <use xlink:href="#icon-500px"></use>
      </svg>
    </a>
  </li>
  
  
  <li class="c-links__item">
    <a href="https://www.flickr.com/photos/Your%20Flickr%20username" target="_blank">
      <svg viewBox="0 0 64 64" class="c-links__icon">
        <title>flickr</title>
        <use xlink:href="#icon-flickr"></use>
      </svg>
    </a>
  </li>
  
  
  <li class="c-links__item">
    <a href="https://www.pinterest.jp/Your%20Pinterest%20username" target="_blank">
      <svg viewBox="0 0 64 64" class="c-links__icon">
        <title>pinterest</title>
        <use xlink:href="#icon-pinterest"></use>
      </svg>
    </a>
  </li>
  
  
  <li class="c-links__item">
    <a href="https://www.tumblr.com/blog/Your%20Tumblr%20username" target="_blank">
      <svg viewBox="0 0 64 64" class="c-links__icon">
        <title>tumblr</title>
        <use xlink:href="#icon-tumblr"></use>
      </svg>
    </a>
  </li>
  
  
  <li class="c-links__item">
    <a href="https://vimeo.com/Your%20Vimeo%20username" target="_blank">
      <svg viewBox="0 0 64 64" class="c-links__icon">
        <title>vimeo</title>
        <use xlink:href="#icon-vimeo"></use>
      </svg>
    </a>
  </li>
  
  
  <li class="c-links__item">
    <a href="https://www.youtube.com/user/Your%20YouTube%20username" target="_blank">
      <svg viewBox="0 0 64 64" class="c-links__icon">
        <title>youtube</title>
        <use xlink:href="#icon-youtube"></use>
      </svg>
    </a>
  </li>
  
  
  <li class="c-links__item">
    <a href="https://linkedin.com/in/Your%20LinkedIn%20username" target="_blank">
      <svg viewBox="0 0 64 64" class="c-links__icon">
        <title>linkedin</title>
        <use xlink:href="#icon-linkedin"></use>
      </svg>
    </a>
  </li>
  
</ul>



    <p class="p-copyright">
      
        &copy; Copyright notice
      
    </p>
  </footer>

  
  <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
    ga('create', 'Your Google Analytics tracking id', 'auto');
    ga('send', 'pageview');
  </script>
  

</body>
</html>