-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1049 lines (874 loc) · 45.4 KB
/
index.html
File metadata and controls
1049 lines (874 loc) · 45.4 KB
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
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<!--[if IE 6]><html lang="en" class="preIE7 preIE8 preIE9 preIE10 preIE11"><![endif]-->
<!--[if IE 7]><html lang="en" class="preIE8 preIE9 preIE10 preIE11"><![endif]-->
<!--[if IE 8]><html lang="en" class="preIE9 preIE10 preIE11"><![endif]-->
<!--[if IE 9]><html lang="en" class="preIE10 preIE11"><![endif]-->
<!--[if IE 10]><html lang="en" class="preIE11"><![endif]-->
<!--[if gte IE 11]><!--><html lang="en"><!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="google-site-verification" content="m4drKKqATz7-FORrg-GnxSvKEuTSRqEqNMj2-AhEttY" />
<!-- browser/device compatibility stuff -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="HandheldFriendly" content="True"/>
<meta name="format-detection" content="telephone=no">
<!-- page info -->
<title>Homepage | mdsh a simple static site generator for modern websites, written in Bash.</title>
<meta name="description" content="a simple static site generator for modern websites, written in Bash.">
<meta name="keywords" content="mdsh, static site generator, project page, open source, blog, news, feed">
<meta name="news_keywords" content="mdsh, static site generator, project page, open source, blog, news, feed">
<meta name="subject" content="mdsh, static site generator, project page, open source, blog, news, feed">
<meta name="generator" content="mdsh">
<meta name="medium" content="blog">
<meta name="copyright" content="© mdsh">
<meta name="language" content="en">
<meta name="robots" content="index,follow">
<meta name="topic" content="mdsh, static site generator, project page, open source, blog, news, feed">
<meta name="owner" content="sc0ttj">
<meta name="pagename" content="Homepage">
<!-- Apple -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="mdsh">
<!-- Facebook -->
<meta property="og:title" content="Homepage">
<meta property="og:description" content="a simple static site generator for modern websites, written in Bash.">
<meta property="og:url" content="https://sc0ttj.github.io/mdsh">
<meta property="og:site_name" content="mdsh">
<meta property="og:type" content="article">
<meta property="og:locale" content="en">
<meta property="og:image" content="https://sc0ttj.github.io/mdsh/assets/icons/rss.png">
<meta property="article:author" content="sc0ttj">
<meta property="article:section" content="">
<meta property="article:published_time" content="">
<meta property="article:modified_time" content="2020-08-21T19:08:42Z">
<!-- Twitter -->
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Homepage">
<meta name="twitter:site" content="@foobar">
<meta name="twitter:creator" content="@foobar">
<meta name="twitter:image" content="https://sc0ttj.github.io/mdsh/assets/icons/rss.png">
<meta name="twitter:domain" content="https://sc0ttj.github.io/mdsh">
<!-- Linked data -->
<script id="site-search-ld" type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "WebSite",
"name": "mdsh",
"url": "https://sc0ttj.github.io/mdsh",
"potentialAction": {
"@type": "SearchAction",
"target": "https://sc0ttj.github.io/mdsh/search.html?q={search_term}",
"query-input": "required name=search_term"
}
}</script>
<script id="meta-ld" type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "Article",
"headline": "Homepage",
"datePublished": "",
"dateModified": "2020-08-21T19:08:42Z",
"description": "a simple static site generator for modern websites, written in Bash.",
"keywords": "mdsh, static site generator, project page, open source, blog, news, feed",
"image": {
"@type": "ImageObject",
"height": "512",
"width": "512",
"url": "https://sc0ttj.github.io/mdsh/assets/icons/android-chrome-512x512.png"
},
"author": "sc0ttj",
"publisher": {
"@type": "Organization",
"logo": {
"@type": "ImageObject",
"url": "https://sc0ttj.github.io/mdsh/assets/icons/android-chrome-512x512.png"
},
"name": "mdsh"
},
"mainEntityOfPage": "https://sc0ttj.github.io/mdsh#content",
"articleBody": "a simple static site generator for modern websites, written in Bash."
}
</script>
<script id="breadcrumb-ld" type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement":
[
{
"@type": "ListItem",
"position": 1,
"item":
{
"@id": "https://sc0ttj.github.io/mdsh",
"name": "Mdsh"
}
}
]
}
</script>
<script id="itemlist-ld" type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "ItemList",
"itemListElement":
[
]
}
</script>
<!-- RSS feed -->
<link rel="alternate" type="application/rss+xml" title="Subscribe to mdsh" href="/mdsh/feed.rss">
<!-- SEO stuff -->
<link rel="author" href="/humans.txt">
<link rel="canonical" href="//sc0ttj.github.io/mdsh">
<!-- App icons and favicons -->
<link rel="manifest" href="/mdsh/manifest.webmanifest?v=1598036999">
<link rel="icon" type="image/png" sizes="16x16" href="/mdsh/assets/icons/favicon-16x16.png?v=1598036999">
<link rel="icon" type="image/png" sizes="32x32" href="/mdsh/assets/icons/favicon-32x32.png?v=1598036999">
<link rel="icon" type="image/png" sizes="192x192" href="/mdsh/assets/icons/android-chrome-192x192.png?v=1598036999">
<link rel="icon" type="image/vnd.microsoft.icon" href="/mdsh/assets/icons/favicon.ico?v=1598036999">
<link rel="apple-touch-icon" sizes="180x180" href="/mdsh/assets/icons/apple-touch-icon.png?v=1598036999">
<link rel="shortcut icon" href="/mdsh/assets/icons/favicon.ico?v=1598036999">
<link rel="mask-icon" color="#444444" href="/mdsh/assets/icons/safari-pinned-tab.svg?v=1598036999">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-config" content="/mdsh/assets/icons/browserconfig.xml?v=1598036999">
<meta name="theme-color" content="#101010">
<!-- Fallback app name, for legacy browsers -->
<meta name="application-name" content="mdsh">
<!-- prefetch resources -->
<link rel="dns-prefetch" href="//unpkg.com">
<link rel="preconnect" href="//unpkg.com" crossorigin>
<!-- CSS -->
<style>/* inline styles go here */</style>
<link rel="stylesheet" href="/mdsh/assets/css/main.min.css?v=1598036999">
<!-- pygments (syntax highlighting) -->
<link rel="stylesheet" href="/mdsh/assets/css/pygments-monokai-osx.css?v=1598036999">
<!-- JavaScript -->
<!--[if lt IE 9]>
<script>
// enable styling of HTML5 elements in IE < 9
document.createElement('header');
document.createElement('nav');
document.createElement('main');
document.createElement('section');
document.createElement('article');
document.createElement('aside');
document.createElement('footer');
document.createElement('picture');
document.createElement('time');
document.createElement('site');
document.createElement('data');
document.createElement('figure');
document.createElement('aside');
document.createElement('address');
</script>
<![endif]-->
<!-- load site NPM deps, if any -->
<script class="unpkg" defer src="//unpkg.com/cash-dom@2.3.9/dist/cash.min.js"></script>
<script class="unpkg" defer src="//unpkg.com/jets@0.14.1/jets.min.js"></script>
<!-- load page-specific NPM deps, if any -->
<!-- main javascript app -->
<script id="appjs" defer src="/mdsh/assets/js/app.js?v=1598036999"></script>
</head>
<!-- start body -->
<body class="no-js category-blog homepage">
<div class="main-container">
<div class="site-header">
<h1><a href="/mdsh">mdsh</a></h1>
<input type="search" class="site-search" id="site-search" placeholder="filter.." />
<a class="off-screen skip-to-content" href="#content">Skip to content</a>
<ul>
<li><a href="/mdsh/about.html">about</a></li>
<li><a href="/mdsh/archive.html">archive</a></li>
<li><a href="/mdsh/contact.html">contact</a></li>
<li><a href="/mdsh/search.html">search</a></li> </ul>
</div>
<div class="body-container">
<div id="content" class="main-content">
<h2>Homepage</h2>
<div class="page-preview">
<h2><a href="/mdsh/posts/2020/08/20/google-map-in-your-blog-posts.html">Google map in your blog posts</a></h2>
<time datetime="2020-08-20T21:54:05Z">2020-08-20
</time>
<ul class="page-meta">
<li class="time-to-read">2 mins</li>
<li class="date"><time datetime="2020-08-20T21:54:05Z">2020-08-20
</time></li>
<li class="author">sc0ttj</li>
<li class="twitter">@foobar</li>
<li class="category"><a href="/mdsh/categories/blog.html">blog</a></li>
<li>
<ul class="tags">
<li>
<a href="/mdsh/tags/maps.html">maps</a>
</li>
<li>
<a href="/mdsh/tags/embed.html">embed</a>
</li>
</ul>
</li>
</ul>
<p>Here is an easy way to add Google maps to your blog, using the <a href="https://developers.google.com/maps/documentation/embed">Google Map Embed API</a>.</p>
<p>Run the usual command to create a new post:</p>
<div class="highlight"><pre><span></span>new post
</pre></div>
<p>Add some Google Map Embed API variables to your page front-matter YAML:</p>
<div class="highlight"><pre><span></span><span class="l l-Scalar l-Scalar-Plain">location</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">Buckingham Palace, London, UK</span>
<span class="l l-Scalar l-Scalar-Plain">maptype</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">satellite</span>
<span class="l l-Scalar l-Scalar-Plain">zoom</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">18</span>
</pre></div>
<p>Then add the following template partial to your post/page:</p>
<div class="highlight"><pre><span></span><span class="cp">{{</span><span class="err">></span><span class="nv">.app</span><span class="nf">/templates/html/_google_map</span><span class="cp">}}</span><span class="x"></span>
</pre></div>
<p>Save and build your page, then finally, view your page in a browser. </p>
<p>You should see a "place map", like this one:</p>
<iframe
width="100%"
height="500"
frameborder="0" style="border:0; width:100%;"
src="https://www.google.com/maps/embed/v1/place?key=AIzaSyCkm3CeQpkUNjqxU4L_c1-EVCwIse5-pUg&zoom=18&maptype=satellite&language=en&q=Buckingham%20Palace%2C%20London%2C%20UK" allowfullscreen>
</iframe>
<p>You get a "Place map" by default, but there are different types!</p>
<p><a href="/mdsh/posts/2020/08/20/google-map-in-your-blog-posts.html">Read more about "Google map in your blog posts"...</a></p>
</div><div class="page-preview">
<h2><a href="/mdsh/posts/2019/10/04/how-to-setup-e-commerce-with-mdsh.html">How to setup e-commerce with Mdsh</a></h2>
<time datetime="2019-10-04T06:11:12Z">2019-10-04
</time>
<ul class="page-meta">
<li class="time-to-read">5 mins</li>
<li class="date"><time datetime="2019-10-04T06:11:12Z">2019-10-4
</time></li>
<li class="author">sc0ttj</li>
<li class="twitter">@foobar</li>
<li class="category"><a href="/mdsh/categories/blog.html">blog</a></li>
<li>
<ul class="tags">
<li>
<a href="/mdsh/tags/paypal.html">paypal</a>
</li>
<li>
<a href="/mdsh/tags/ecommerce.html">ecommerce</a>
</li>
</ul>
</li>
</ul>
<p>Adding e-commerce features, such as PayPal payment buttons, as well as managing
your products, is now much easier thanks to the latest updates in <code>mdsh</code>.</p>
<p>You can have an online store up and running in about 5 mins.</p>
<p>But first, here are some example products with PayPal payment buttons.</p>
<h3>Example: List of products</h3>
<p>Here is a list of some of the products defined in <code>assets/data/products.yml</code>:</p>
<div class="products">
<!-- show products from assets/data/products.yml -->
<div class="product">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<h4>Product one</h4>
<ul>
<li>
<span>Price: </span><span>£5.00</span>
</li>
<li><span>Shipping: </span><span>0.50</span></li>
</ul>
<p>Options:</p>
<ul>
<li>
<span class="product-option-label">Colour:</span>
<select name="os0">
<option value="red">Red</option>
<option value="blue">Blue</option>
</select>
<input type="hidden" name="on0" value="Colour">
</li>
<li>
<span class="product-option-label">Size:</span>
<select name="os1">
<option value="small">Small</option>
<option value="medium">Medium</option>
<option value="large">Large</option>
</select>
<input type="hidden" name="on1" value="Size">
</li>
</ul>
<input
class="paypal-btn"
type="submit"
name="submit"
value="Buy Now">
<!-- add the unique product name, from page data -->
<input type="hidden" name="on3" value="name">
<input type="hidden" name="os3" value="Product one">
<!-- hidden values expected by paypal -->
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="U8R375VMEZPNN">
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>
</div>
<!-- show products from assets/data/products.yml -->
<div class="product">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<h4>Product three</h4>
<ul>
<li>
<span>Price: </span><span>£5.00</span>
</li>
<li><span>Shipping: </span><span>0.50</span></li>
</ul>
<p>Options:</p>
<ul>
<li>
<span class="product-option-label">Colour:</span>
<select name="os0">
<option value="red">Red</option>
<option value="blue">Blue</option>
</select>
<input type="hidden" name="on0" value="Colour">
</li>
<li>
<span class="product-option-label">Size:</span>
<select name="os1">
<option value="small">Small</option>
<option value="medium">Medium</option>
<option value="large">Large</option>
</select>
<input type="hidden" name="on1" value="Size">
</li>
</ul>
<input
class="paypal-btn"
type="submit"
name="submit"
value="Buy Now">
<!-- add the unique product name, from page data -->
<input type="hidden" name="on3" value="name">
<input type="hidden" name="os3" value="Product three">
<!-- hidden values expected by paypal -->
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="U8R375VMEZPNN">
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>
</div>
</div>
<h3>Example: Single product</h3>
<p>Here is a single product, defined in the YAML front matter of this page:</p>
<!-- show products from page front matter YAML -->
<div class="product">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<h4>How to setup e-commerce with Mdsh</h4>
<ul>
<li>Price: $5.00</li>
<li>Shipping: $0.50</li>
</ul>
<p>Options:</p>
<ul>
<li>
<p>Colour:</p>
<select name="os0">
<option value="red">Red</option>
<option value="blue">Blue</option>
</select>
<input type="hidden" name="on0" value="Colour">
</li>
<li>
<p>Size:</p>
<select name="os1">
<option value="small">Small</option>
<option value="medium">Medium</option>
<option value="large">Large</option>
</select>
<input type="hidden" name="on1" value="Size">
</li>
</ul>
<input
class="paypal-btn"
type="submit"
name="submit"
value="Add to Cart">
<!-- add the unique product identifier from page data -->
<input type="hidden" name="on2" value="id">
<input type="hidden" name="os2" value="000001">
<!-- hidden values expected by paypal -->
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="8YQ9AA2ZK9VU6">
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>
</div>
<p>You can include your products in your markdown so they appear inline in your blog
posts, or, you can create separate templates specifically for listing your
products - it's up to you!</p>
<p><a href="/mdsh/posts/2019/10/04/how-to-setup-e-commerce-with-mdsh.html">Read more about "How to setup e-commerce with Mdsh"...</a></p>
</div><div class="page-preview">
<h2><a href="/mdsh/posts/2019/09/14/embedding-youtube-videos-tweets-codepens-and-other-third-party-content.html">Embedding Youtube videos, Tweets, Codepens and..</a></h2>
<time datetime="2019-09-14T22:45:54Z">2019-09-14
</time>
<ul class="page-meta">
<li class="time-to-read">2 mins</li>
<li class="date"><time datetime="2019-09-14T22:45:54Z">2019-09-14
</time></li>
<li class="author">sc0ttj</li>
<li class="twitter">@foobar</li>
<li class="category"><a href="/mdsh/categories/blog.html">blog</a></li>
<li>
<ul class="tags">
<li>
<a href="/mdsh/tags/oembed.html">oembed</a>
</li>
<li>
<a href="/mdsh/tags/shell.html">shell</a>
</li>
</ul>
</li>
</ul>
<p>Using embedded content in your posts is easier than ever - just <strong>put the URL to
the content on its own line</strong> in your Markdown and the URL will be
automatically converted to the relevant embedded content at build time.</p>
<p>Supported services so far:</p>
<ul>
<li>youtube</li>
<li>twitter</li>
<li>vimeo</li>
<li>instagram</li>
<li>tumblr</li>
<li>codepen</li>
<li>imgur</li>
<li>soundcloud</li>
</ul>
<p><a href="/mdsh/posts/2019/09/14/embedding-youtube-videos-tweets-codepens-and-other-third-party-content.html">Read more about "Embedding Youtube videos, Tweets, Codepens and other third-party content"...</a></p>
</div><div class="page-preview">
<h2><a href="/mdsh/posts/2019/09/14/easier-stylesheet-selection.html">Easier stylesheet selection</a></h2>
<time datetime="2019-09-14T18:35:35Z">2019-09-14
</time>
<ul class="page-meta">
<li class="time-to-read">3 mins</li>
<li class="date"><time datetime="2019-09-14T18:35:35Z">2019-09-14
</time></li>
<li class="author">sc0ttj</li>
<li class="twitter">@foobar</li>
<li class="category"><a href="/mdsh/categories/blog.html">blog</a></li>
<li>
<ul class="tags">
<li>
<a href="/mdsh/tags/css.html">css</a>
</li>
</ul>
</li>
</ul>
<p>You can now set stylesheets in the front matter of your posts and pages or in
<code>assets/data/site.yml</code> - providing an easy way to style your pages with
default stylesheets, or unique ones per page.</p>
<h3>Settings a default website stylesheet</h3>
<p>Your websites default styles are defined in <code>assets/data/site.yml</code>:</p>
<div class="highlight"><pre><span></span>stylesheet: <name>
code_stylesheet: <name>
</pre></div>
<p>..where <code><name></code> matches a CSS file in <code>assets/css/</code> (without the <code>.css</code>
extension, or <code>pygments-</code> prefix).</p>
<h3>Setting a page stylesheet</h3>
<p>You can override the site defaults by defining stylesheet in your pages front matter
(top of the <code>.mdsh</code> file) in the same way:</p>
<div class="highlight"><pre><span></span>stylesheet: <name>
code_stylesheet: <name>
</pre></div>
<h3>Stylesheet files are in <code>assets/css/</code></h3>
<p>The current stylesheets available are <code>main</code> and <code>simple</code>. Each stylesheet must
have a .css file in <code>assets/css/</code>.</p>
<p>Stylesheets should not start with an underscore or 'pygments' - as these are
"partials" and to be included in other stylesheets.</p>
<h3>Using stylesheets in your templates</h3>
<p>The following variables are available to use in your templates:</p>
<ul>
<li><code>{{page_stylesheet}}</code>: the main stylesheet for your page, falls back to site defaults.</li>
<li><code>{{page_code_stylesheet}}</code>: the stylesheet for any highlighted code blocks on your page, falls back to site defaults.</li>
</ul>
<p>Also available, but you probably won't need to use them:</p>
<ul>
<li><code>{{site_stylesheet}}</code>: the default stylesheet for your site.</li>
<li><code>{{site_code_stylesheet}}</code>: the default stylesheet for any highlighted code blocks on your site.</li>
</ul>
</div><div class="page-preview">
<h2><a href="/mdsh/posts/2019/09/13/easier-layout-selection.html">Easier layout selection</a></h2>
<time datetime="2019-09-13T06:15:27Z">2019-09-13
</time>
<ul class="page-meta">
<li class="time-to-read">2 mins</li>
<li class="date"><time datetime="2019-09-13T06:15:27Z">2019-09-13
</time></li>
<li class="author">sc0ttj</li>
<li class="twitter">@foobar</li>
<li class="category"><a href="/mdsh/categories/blog.html">blog</a></li>
<li>
<ul class="tags">
<li>
<a href="/mdsh/tags/yaml.html">yaml</a>
</li>
</ul>
</li>
</ul>
<p>You can now choose a page layout when creating new posts and pages - this
provides an easy way to render your pages with different mustache templates,
with varying layouts and structure.</p>
<p>The current layouts available are <code>main</code> and <code>simple</code>. Each layout must have a
<code>.mustache</code> template file in <code>.app/templates/[html]/</code>, such as <code>main.mustache</code>
or <code>simple.mustache</code>.</p>
<p>Layouts should not start with an underscore - as templates whose names begin with
an underscore are "partials" and to be included in other templates.</p>
<p>The <code>page_layout</code> variable is available a build time, and taken from your post
or pages front matter. For example, here is the YAML front matter for this post:</p>
<div class="highlight"><pre><span></span><span class="l l-Scalar l-Scalar-Plain">title</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">Easier layout selection</span>
<span class="l l-Scalar l-Scalar-Plain">slug</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">easier-layout-selection</span>
<span class="l l-Scalar l-Scalar-Plain">descr</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">You can now choose a page layout when creating new posts and pages - this provides an easy way to render your pages with different mustache templates, with varying layouts and structure.</span>
<span class="l l-Scalar l-Scalar-Plain">permalink</span><span class="p p-Indicator">:</span>
<span class="l l-Scalar l-Scalar-Plain">time_to_read</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">2 mins</span>
<span class="l l-Scalar l-Scalar-Plain">created</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">2019-09-13T06:15:27Z</span>
<span class="l l-Scalar l-Scalar-Plain">category</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">blog</span>
<span class="l l-Scalar l-Scalar-Plain">tags</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">yaml</span>
<span class="l l-Scalar l-Scalar-Plain">layout</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">main</span>
<span class="l l-Scalar l-Scalar-Plain">author</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">sc0ttj</span>
<span class="l l-Scalar l-Scalar-Plain">email</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">foo@example.com</span>
<span class="l l-Scalar l-Scalar-Plain">twitter</span><span class="p p-Indicator">:</span> <span class="err">@</span><span class="l l-Scalar l-Scalar-Plain">foobar</span>
<span class="l l-Scalar l-Scalar-Plain">language</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">en</span>
<span class="l l-Scalar l-Scalar-Plain">js_deps</span><span class="p p-Indicator">:</span>
<span class="l l-Scalar l-Scalar-Plain">modified</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">2019-09-13T06:15:27Z</span>
<span class="nn">---</span>
</pre></div>
<p>More layouts will be added in the future, to make it even easier to customise
your pages.</p>
</div><div class="page-preview">
<h2><a href="/mdsh/posts/2019/09/13/better-site-rebuilding.html">Better site rebuilding</a></h2>
<time datetime="2019-09-13T21:17:42Z">2019-09-13
</time>
<ul class="page-meta">
<li class="time-to-read">3 mins</li>
<li class="date"><time datetime="2019-09-13T21:17:42Z">2019-09-13
</time></li>
<li class="author">sc0ttj</li>
<li class="twitter">@foobar</li>
<li class="category"><a href="/mdsh/categories/blog.html">blog</a></li>
<li>
<ul class="tags">
<li>
<a href="/mdsh/tags/shell.html">shell</a>
</li>
</ul>
</li>
</ul>
<p>Now it's much easier to update/rebuild only the parts of the site you need to.</p>
<p>The <code>rebuild</code> command has been greatly improved, so you can (re)build specific index pages, and keep your site up-to-date much more easily.</p>
<h3>How it works</h3>
<p>The <code>rebuild</code> command now accepts options in the following format:</p>
<div class="highlight"><pre><span></span>rebuild <index-page><span class="o">[</span>:item1,item2,...<span class="o">]</span>
</pre></div>
<p>Examples:</p>
<div class="highlight"><pre><span></span>rebuild tags:templating,yaml
rebuild authors:sc0ttj categories:games
rebuild search
</pre></div>
<h3>All <code>rebuild</code> options:</h3>
<div class="highlight"><pre><span></span><span class="gp">$</span> rebuild <span class="m">404</span> <span class="c1"># update 404.html</span>
<span class="gp">$</span> rebuild homepage <span class="c1"># update index.html (the homepage)</span>
<span class="gp">$</span> rebuild archive <span class="c1"># update archive.html (lists all blog posts)</span>
<span class="gp">$</span> rebuild search <span class="c1"># update search.html (your website search page)</span>
<span class="gp">$</span> rebuild sitemap <span class="c1"># update sitemap.xml (used by search engines)</span>
<span class="gp">$</span> rebuild rss <span class="c1"># update feed.rss (your RSS new feed)</span>
<span class="gp">$</span> rebuild authors <span class="c1"># update all pages in authors/</span>
<span class="gp">$</span> rebuild authors:foo,bar <span class="c1"># update pages authors/foo.html and tags/bar.html</span>
<span class="gp">$</span> rebuild categories <span class="c1"># update all pages in categories/</span>
<span class="gp">$</span> rebuild categories:foo,bar <span class="c1"># update pages categories/foo.html and tags/bar.html</span>
<span class="gp">$</span> rebuild tags <span class="c1"># update all pages in tags/</span>
<span class="gp">$</span> rebuild tags:foo,bar <span class="c1"># update pages tags/foo.html and tags/bar.html</span>
<span class="gp">$</span> rebuild years <span class="c1"># update all posts/<years>/index.html index pages</span>
<span class="gp">$</span> rebuild years:foo <span class="c1"># update posts/foo/index.html specifically</span>
<span class="gp">$</span> rebuild months <span class="m">2019</span> <span class="c1"># update all monthly index pages in posts/2019/</span>
<span class="gp">$</span> rebuild months:foo <span class="m">2019</span> <span class="c1"># update posts/2019/foo/index.html specifically</span>
</pre></div>
<h3>Chaining commands</h3>
<p>The commands above can also be combined like so:</p>
<div class="highlight"><pre><span></span><span class="gp">$</span> rebuild tags:foo,bar year:2019 authors:someone search
</pre></div>
</div><div class="page-preview">
<h2><a href="/mdsh/posts/2019/09/11/permalinks-for-your-posts.html">Permalinks for your posts</a></h2>
<time datetime="2019-09-11T22:31:21Z">2019-09-11
</time>
<ul class="page-meta">
<li class="time-to-read">3 mins</li>
<li class="date"><time datetime="2019-09-11T22:31:21Z">2019-09-11
</time></li>
<li class="author">sc0ttj</li>
<li class="twitter">@foobar</li>
<li class="category"><a href="/mdsh/categories/blog.html">blog</a></li>
<li>
<ul class="tags">
<li>
<a href="/mdsh/tags/blog.html">blog</a>
</li>
<li>
<a href="/mdsh/tags/seo.html">seo</a>
</li>
</ul>
</li>
</ul>
<p>A new permalinks feature has been added, so you can create shorter, easier, custom URLs for your blog posts.</p>
<p>Simply run the command <code>new post -all</code> and follow the on-screen instructions.</p>
<p>Your page will be available at its normal URL (<code>posts/year/month/day/post-name.html</code>,
as well as the permalink, which can be simply <code>post-name</code>, if you wish.</p>
<p>Example: If the post <code>$site_domain/$site_url/posts/2019/09/07/13/liquid-filters.html</code> had the permalink
<code>docs/liquid-filters</code>, then it would be available at <code>$site_domain/$site_url/docs/liquid-filters</code>.</p>
<p>The permalink is saved in the front matter of your <code>.mdsh</code> files, and (ideally)
should not be changed.</p>
</div><div class="page-preview">
<h2><a href="/mdsh/posts/2019/09/07/better-data-and-template-handling.html">Better data and template handling</a></h2>
<time datetime="2019-09-07T18:29:46Z">2019-09-07
</time>
<ul class="page-meta">
<li class="time-to-read">5 mins</li>
<li class="date"><time datetime="2019-09-07T18:29:46Z">2019-09-7
</time></li>
<li class="author">sc0ttj</li>
<li class="twitter">@foobar</li>
<li class="category"><a href="/mdsh/categories/blog.html">blog</a></li>
<li>
<ul class="tags">
<li>
<a href="/mdsh/tags/csv.html">csv</a>
</li>
<li>
<a href="/mdsh/tags/mustache.html">mustache</a>
</li>
<li>
<a href="/mdsh/tags/shell.html">shell</a>
</li>
<li>
<a href="/mdsh/tags/yaml.html">yaml</a>
</li>
</ul>
</li>
</ul>
<p>Some big improvements have been made to the handling of site and page data,
as well as improvements to the templating system - all of which makes it much
easier to include custom data in your pages.</p>
<h3>The <code>assets/data</code> folder</h3>
<p>A new folder has been created, which serves a special purpose - any data defined
in any <code>.csv</code>, <code>.sh</code> or <code>.yml</code> files found in <code>assets/data</code> will be included
available to your templates. This feature should be familiar to users of
<code>Jekyll</code>, which has a <code>_data</code> folder for the same purpose.</p>
<p>The <em>data is namespaced by the file in which it lives</em> - a file called
<code>products.yml</code> would be available in all your templates as an object called
<code>products</code>, and so on.</p>
<p>Here's an example:</p>
<p><strong>File <code>assets/data/products.yml</code>:</strong></p>
<div class="highlight"><pre><span></span><span class="l l-Scalar l-Scalar-Plain">product1</span><span class="p p-Indicator">:</span>
<span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">Product one</span>
<span class="l l-Scalar l-Scalar-Plain">price</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">1000</span>
<span class="l l-Scalar l-Scalar-Plain">product2</span><span class="p p-Indicator">:</span>
<span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">Product two</span>
<span class="l l-Scalar l-Scalar-Plain">price</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">2000</span>
<span class="l l-Scalar l-Scalar-Plain">product3</span><span class="p p-Indicator">:</span>
<span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">Product three</span>
<span class="l l-Scalar l-Scalar-Plain">price</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">3300</span>
<span class="l l-Scalar l-Scalar-Plain">product4</span><span class="p p-Indicator">:</span>
<span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">Product four</span>
<span class="l l-Scalar l-Scalar-Plain">price</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">4440</span>
<span class="l l-Scalar l-Scalar-Plain">product5</span><span class="p p-Indicator">:</span>
<span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">Product five</span>
<span class="l l-Scalar l-Scalar-Plain">price</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">5555</span>
</pre></div>
<p>can be accessed in your templates with the new <code>foreach</code> iterator:</p>
<div class="highlight"><pre><span></span><span class="cp">{{</span><span class="nf">#foreach</span> <span class="nv">product</span> <span class="k">in</span> <span class="nv">products</span><span class="cp">}}</span><span class="x"></span>
<span class="x"> Product </span><span class="cp">{{</span><span class="nv">product.name</span><span class="cp">}}</span><span class="x"> costs </span><span class="cp">{{</span><span class="nv">product.price</span> <span class="err">|</span> <span class="nv">money</span> <span class="s1">'£'</span><span class="cp">}}</span><span class="x"></span>
<span class="cp">{{</span><span class="nf">/foreach</span><span class="cp">}}</span><span class="x"></span>
</pre></div>
<p>Once you have your templates and data files in place, you can (re)build your
pages as before:</p>
<div class="highlight"><pre><span></span><span class="c1"># rebuild the page from its source file</span>
rebuild path/to/some/file.mdsh > path/to/file.html
<span class="c1"># update the homepage, index pages, etc</span>
rebuild
</pre></div>
<p>That's all there is to it.</p>
<h3>Supported data types:</h3>
<p>The <code>assets/data</code> folder supports CSV files (must contain headers!), a subset of
YAML, and <code>.sh</code> files, which are sourced and in which you can define variables,
arrays and functions as usual.</p>
<p><a href="/mdsh/posts/2019/09/07/better-data-and-template-handling.html">Read more about "Better data and template handling"...</a></p>
</div><div class="page-preview">
<h2><a href="/mdsh/posts/2019/07/13/liquid-filters.html">Liquid Filters</a></h2>
<time datetime="2019-07-13T23:56:01Z">2019-07-13
</time>
<ul class="page-meta">
<li class="time-to-read">8 mins</li>
<li class="date"><time datetime="2019-07-13T23:56:01Z">2019-07-13
</time></li>
<li class="author">sc0ttj</li>
<li class="twitter">@foobar</li>
<li class="category"><a href="/mdsh/categories/blog.html">blog</a></li>
<li>
<ul class="tags">
<li>
<a href="/mdsh/tags/mustache.html">mustache</a>
</li>
<li>
<a href="/mdsh/tags/markdown.html">markdown</a>
</li>
<li>
<a href="/mdsh/tags/liquid-templating.html">liquid-templating</a>
</li>
</ul>
</li>
</ul>
<p><code>mdsh</code> now has a new feature, inspired by <a href="https://help.shopify.com/en/themes/liquid/filters">Liquid filters</a>.</p>
<p>The <a href="https://shopify.github.io/liquid/">Liquid templating</a> system was created by <a href="https://www.shopify.co.uk/">Shopify</a>
and is used in the templating system of <a href="https://jekyllrb.com/">Jekyll</a>.</p>
<p>Here's a description of "liquid filters" from the <a href="https://help.shopify.com/en/themes/liquid/filters">liquid filters documentation</a>:</p>
<blockquote>
<p>Filters are simple methods that modify the output of numbers, strings,
variables and objects. They are placed within an output tag {{ }} and are
denoted by a pipe character |.</p>
</blockquote>
<p>As <code>mdsh</code> is written in shell, and uses <a href="https://github.com/tests-always-included/mo"><code>mo</code></a>
as its <a href="https://mustache.github.io/mustache.5.html">Mustache</a> library, I've
implemented a rip-off version of liquid filters.</p>
<p>You can use the filters in your <code>.mustache</code> templates files, and in your <code>.mdsh</code>
source files. You pass the variables through a filter using the pipe symbol <code>|</code>.</p>
<h3>Usage and examples:</h3>
<h4>1. Template usage</h4>
<p><b>Filtering basic page data (strings):</b></p>
<div class="highlight"><pre><span></span><span class="x"><h2></span><span class="cp">{{</span><span class="nv">page_name</span> <span class="err">|</span> <span class="nv">uppercase</span><span class="cp">}}</span><span class="x"></h2></span>
</pre></div>
<p>^ this will output the page title in upper case.</p>
<p>Here is a more advanced example:</p>
<div class="highlight"><pre><span></span><span class="x"><h2></span><span class="cp">{{</span><span class="nv">page_name</span> <span class="err">|</span> <span class="nv">truncate_words</span> <span class="m">6</span> <span class="s2">".."</span> <span class="err">|</span> <span class="nv">strip_newlines</span><span class="cp">}}</span><span class="x"></h2></span>
</pre></div>
<p>^ this will truncate to 6 words, and append `..` if truncated, and strip new lines.</p>
<p>These filters also can also be applied to whole sections (if you must!):</p>
<div class="highlight"><pre><span></span><span class="cp">{{</span><span class="nv">page_header</span> <span class="err">|</span> <span class="nv">strip_html</span><span class="cp">}}</span><span class="x"></span>
</pre></div>
<p><b>Filtering arrays:</b></p>
<p>In your templates various places use arrays to iterate over lists, such as
recent posts. These lists can also be "filtered", in much the same way as the
page data variables described above.</p>
<p>In your templates, normal `arrays` work as iterators, that can also take filters.</p>
<p>For example:</p>
<div class="highlight"><pre><span></span><span class="cp">{{</span><span class="nf">#someArray</span> <span class="err">|</span> <span class="nv">sort_array</span> <span class="nv">desc</span> <span class="err">|</span> <span class="nv">limit</span> <span class="m">3</span><span class="cp">}}</span><span class="x"></span>
<span class="x"> </span><span class="cp">{{</span><span class="err">.</span> <span class="err">|</span> <span class="nv">titlecase</span><span class="cp">}}</span><span class="x"></span>
<span class="cp">{{</span><span class="nf">/someArray</span><span class="cp">}}</span><span class="x"></span>
</pre></div>
<p>Associative arrays also work nicely with the `foreach` iterator:</p>
<div class="highlight"><pre><span></span><span class="cp">{{</span><span class="nf">#foreach</span> <span class="nv">item</span> <span class="k">in</span> <span class="nv">someAssocArray</span> <span class="err">|</span> <span class="nv">sort_by</span> <span class="s2">"age"</span> <span class="s2">"asc"</span> <span class="err">|</span> <span class="nv">limit</span> <span class="m">3</span><span class="cp">}}</span><span class="x"></span>
<span class="x"> Hi </span><span class="cp">{{</span><span class="nv">item.name</span> <span class="err">|</span> <span class="nv">titlecase</span><span class="cp">}}</span><span class="x">,</span>
<span class="x"> at </span><span class="cp">{{</span><span class="nv">item.address</span> <span class="err">|</span> <span class="nv">uppercase</span> <span class="err">|</span> <span class="nv">newline_to_br</span><span class="cp">}}</span><span class="x"></span>
<span class="cp">{{</span><span class="nf">/foreach</span><span class="cp">}}</span><span class="x"></span>
</pre></div>
<h4>2. Markdown usage</h4>
<p>You can even use them in the sub-shells of your `*.mdsh` source files:</p>
<div class="highlight"><pre><span></span>< ?bash <span class="nb">echo</span> <span class="s2">"</span><span class="nv">$something</span><span class="s2">"</span> <span class="p">|</span> replace_all foo bar <span class="p">;</span>? >
</pre></div>
<p><a href="/mdsh/posts/2019/07/13/liquid-filters.html">Read more about "Liquid Filters"...</a></p>
</div><div class="page-preview">
<h2><a href="/mdsh/posts/2019/07/01/faster-site-rebuilds.html">Faster site rebuilds</a></h2>
<time datetime="2019-07-01T20:20:49Z">2019-07-01
</time>
<ul class="page-meta">
<li class="time-to-read">3 mins</li>
<li class="date"><time datetime="2019-07-01T20:20:49Z">2019-07-1
</time></li>
<li class="author">sc0ttj</li>
<li class="twitter">@foobar</li>
<li class="category"><a href="/mdsh/categories/blog.html">blog</a></li>
<li>
<ul class="tags">
<li>
<a href="/mdsh/tags/shell.html">shell</a>
</li>
</ul>
</li>
</ul>
<p>Re-building your site is now faster than before, thanks to a few improvements
made in the <a href="https://github.com/sc0ttj/mdsh/commit/8d904dff7f5a6829f9db92926d75f1ab4e077fd3">latest commit</a>:</p>
<ul>
<li>rebuild only the relevant index pages after creating a new post</li>
<li>cache parts of the site which dont change during a site build:
<ul>
<li>site header</li>
<li>site navigation</li>
<li>site footer</li>
</ul></li>
</ul>
<p>Other fixes added in this commit include:</p>
<ul>
<li>updated help info in various scripts</li>
<li>keep onwards journeys of all posts up-to-date when adding a new post</li>
</ul>
<p><a href="/mdsh/posts/2019/07/01/faster-site-rebuilds.html">Read more about "Faster site rebuilds"...</a></p>
</div>
</div>
</div>
<ul id="site-navigation" class="site-navigation">
<li class="site-navigation--main-pages">
<h3>Pages</h3>
<ul>
<li><a href="/mdsh/about.html">About</a></li>
<li><a href="/mdsh/archive.html">Archive</a></li>
<li><a href="/mdsh/contact.html">Contact</a></li>
<li><a href="/mdsh/search.html">Search</a></li> </ul>
</li>
<li class="site-navigation--recent-posts">
<h3>Recent posts</h3>
<ul>
<li><a href="/mdsh/posts/2020/08/20/google-map-in-your-blog-posts.html">Google map in your blog posts</a></li>
<li><a href="/mdsh/posts/2019/10/04/how-to-setup-e-commerce-with-mdsh.html">How to setup e-commerce with Mdsh</a></li>
<li><a href="/mdsh/posts/2019/09/14/embedding-youtube-videos-tweets-codepens-and-other-third-party-content.html">Embedding Youtube videos, Tweets, Codepens and other third-party content</a></li>
<li><a href="/mdsh/posts/2019/09/14/easier-stylesheet-selection.html">Easier stylesheet selection</a></li>
<li><a href="/mdsh/posts/2019/09/13/easier-layout-selection.html">Easier layout selection</a></li> </ul>
</li>
<li class="site-navigation--categories">
<h3>Categories</h3>
<ul>
<li>
<a href="/mdsh/categories/blog.html">blog</a>
</li>
<li>
<a href="/mdsh/categories/games.html">games</a>