guides_style_mbland 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.md +13 -0
  3. data/README.md +151 -0
  4. data/assets/css/google-fonts.css +58 -0
  5. data/assets/favicons/favicon.ico +0 -0
  6. data/assets/favicons/favicon16.png +0 -0
  7. data/assets/favicons/favicon32.png +0 -0
  8. data/assets/favicons/touch-icon-120.png +0 -0
  9. data/assets/favicons/touch-icon-152.png +0 -0
  10. data/assets/favicons/touch-icon-76.png +0 -0
  11. data/assets/fonts/opensans-1395a31469a458f6e2069017b504be065ff44897.ttf +0 -0
  12. data/assets/fonts/opensans-3e193feab52524db86cd1508693f2e5086102669.ttf +0 -0
  13. data/assets/fonts/opensans-d4d19ed3a763ce10e050662542bc0318bb620096.svg +1637 -0
  14. data/assets/fonts/opensans-dd44beeac9a044f2c478b70838e447f0af077825.ttf +0 -0
  15. data/assets/fonts/opensans-f0cc9c782f41b44a31392230103f5b4e101a944a.eot +0 -0
  16. data/assets/fonts/raleway-0dd0372e5ca423ab45f41c74cb0f8859d0527517.eot +0 -0
  17. data/assets/fonts/raleway-468d063b5293c0f76e63103d04cf547e7837cdd2.ttf +0 -0
  18. data/assets/fonts/raleway-6c44b90a1e166ce0b659df20e8e374b5e9d97329.svg +347 -0
  19. data/assets/fonts/raleway-c34d475f415db5bc71140225a0284159bd3d85f2.ttf +0 -0
  20. data/assets/js/accordion.js +47 -0
  21. data/assets/js/guide.js +5 -0
  22. data/assets/js/vendor/anchor.min.js +6 -0
  23. data/assets/js/vendor/jquery-1.11.2.min.js +4 -0
  24. data/lib/guides_style_mbland.rb +14 -0
  25. data/lib/guides_style_mbland/assets.rb +18 -0
  26. data/lib/guides_style_mbland/breadcrumbs.rb +28 -0
  27. data/lib/guides_style_mbland/generated_nodes.rb +63 -0
  28. data/lib/guides_style_mbland/generated_pages.rb +38 -0
  29. data/lib/guides_style_mbland/generator.rb +21 -0
  30. data/lib/guides_style_mbland/includes.rb +21 -0
  31. data/lib/guides_style_mbland/includes/analytics.html +16 -0
  32. data/lib/guides_style_mbland/includes/breadcrumbs.html +8 -0
  33. data/lib/guides_style_mbland/includes/footer.html +5 -0
  34. data/lib/guides_style_mbland/includes/header.html +29 -0
  35. data/lib/guides_style_mbland/includes/scripts.html +6 -0
  36. data/lib/guides_style_mbland/includes/sidebar-children.html +17 -0
  37. data/lib/guides_style_mbland/includes/sidebar.html +14 -0
  38. data/lib/guides_style_mbland/layouts.rb +51 -0
  39. data/lib/guides_style_mbland/layouts/default.html +45 -0
  40. data/lib/guides_style_mbland/layouts/generated/home-redirect.html +6 -0
  41. data/lib/guides_style_mbland/layouts/search-results.html +4 -0
  42. data/lib/guides_style_mbland/namespace_flattener.rb +39 -0
  43. data/lib/guides_style_mbland/navigation.rb +253 -0
  44. data/lib/guides_style_mbland/repository.rb +73 -0
  45. data/lib/guides_style_mbland/sass.rb +10 -0
  46. data/lib/guides_style_mbland/sass/_guides_style_mbland_custom.scss +50 -0
  47. data/lib/guides_style_mbland/sass/_guides_style_mbland_main.scss +643 -0
  48. data/lib/guides_style_mbland/sass/_guides_style_mbland_syntax.scss +60 -0
  49. data/lib/guides_style_mbland/sass/guides_style_mbland.scss +3 -0
  50. data/lib/guides_style_mbland/tags.rb +51 -0
  51. data/lib/guides_style_mbland/update.rb +6 -0
  52. data/lib/guides_style_mbland/version.rb +3 -0
  53. metadata +264 -0
@@ -0,0 +1,73 @@
1
+ require 'English'
2
+ require 'fileutils'
3
+
4
+ module GuidesStyleMbland
5
+ TEMPLATE_FILES = %w(
6
+ _pages/add-a-new-page/make-a-child-page.md
7
+ _pages/add-a-new-page.md
8
+ _pages/add-images.md
9
+ _pages/advanced-features.md
10
+ _pages/github-setup.md
11
+ _pages/images.png
12
+ _pages/post-your-guide.md
13
+ _pages/update-the-config-file/understanding-baseurl.md
14
+ _pages/update-the-config-file.md
15
+ images/description.png
16
+ images/gh-add-guide.png
17
+ images/gh-branches-link.png
18
+ images/gh-default-branch.png
19
+ images/gh-settings-button.png
20
+ images/gh-webhook.png
21
+ )
22
+
23
+ def self.clear_template_files_and_create_new_repository(
24
+ basedir, outstream = $stdout)
25
+ remove_template_files basedir, outstream
26
+ delete_create_repo_command_from_go_script basedir, outstream
27
+ create_new_git_repository basedir, outstream
28
+ end
29
+
30
+ def self.remove_template_files(basedir, outstream)
31
+ Dir.chdir basedir do
32
+ outstream.puts 'Clearing Guides Template files.'
33
+ files = TEMPLATE_FILES.map { |f| File.join basedir, f }
34
+ .select { |f| File.exist? f }
35
+ File.delete(*files)
36
+ end
37
+ end
38
+
39
+ def self.delete_create_repo_command_from_go_script(basedir, outstream)
40
+ Dir.chdir basedir do
41
+ outstream.puts 'Removing `:create_repo` command from the `./go` script.'
42
+ go_script = File.join basedir, 'go'
43
+ content = File.read go_script
44
+ match = /\ndef_command\(\n :create_repo,.*?end\n/m.match content
45
+ content = "#{match.pre_match}#{match.post_match}" unless match.nil?
46
+ File.write go_script, content
47
+ end
48
+ end
49
+
50
+ GIT_COMMANDS = {
51
+ 'Creating a new git repository.' => 'git init',
52
+ 'Creating mbland-pages branch.' => 'git checkout -b mbland-pages',
53
+ 'Adding files for initial commit.' => 'git add .',
54
+ }
55
+
56
+ def self.create_new_git_repository(basedir, outstream)
57
+ Dir.chdir basedir do
58
+ outstream.puts 'Removing old git repository.'
59
+ FileUtils.rm_rf '.git'
60
+ GIT_COMMANDS.each do |description, command|
61
+ outstream.puts description
62
+ exec_cmd_capture_output command, outstream
63
+ end
64
+ outstream.puts "All done! Run \'git commit\' to create your first commit."
65
+ end
66
+ end
67
+ private_class_method :create_new_git_repository
68
+
69
+ def self.exec_cmd_capture_output(command, outstream)
70
+ opts = { out: outstream, err: outstream }
71
+ exit $CHILD_STATUS.exitstatus unless system command, opts
72
+ end
73
+ end
@@ -0,0 +1,10 @@
1
+ require 'sass'
2
+
3
+ module GuidesStyleMbland
4
+ class Sass
5
+ DIR = File.join File.dirname(__FILE__), 'sass'
6
+ GUIDES_STYLES_FILE = File.join DIR, 'guides_style_mbland.scss'
7
+ end
8
+ end
9
+
10
+ Sass.load_paths << ::GuidesStyleMbland::Sass::DIR
@@ -0,0 +1,50 @@
1
+ /*
2
+ This is where custom styles for your guide should live.
3
+ */
4
+
5
+ div.skip-nav a {
6
+ position: absolute;
7
+ left: -10000;
8
+ top: 0;
9
+ width: 1px;
10
+ height: auto;
11
+ overflow: hidden;
12
+ }
13
+ div.skip-nav a:focus {
14
+ position: absolute;
15
+ top: 5px;
16
+ left: 5px;
17
+ width: auto;
18
+ height: auto;
19
+ z-index: 999999;
20
+ background-color: white;
21
+ padding-left: 2px;
22
+ padding-right: 2px;
23
+ overflow: visible;
24
+ }
25
+
26
+ .mainContent:focus {
27
+ outline: none;
28
+ }
29
+
30
+ table, th, td {
31
+ border: 1px solid black;
32
+ padding: 5px;
33
+ margin:5px;
34
+ }
35
+ th {
36
+ background: #767576;
37
+ color:white;
38
+ }
39
+ li.active > a{
40
+ background-color: #317ab9;
41
+ }
42
+
43
+ div.back-link {
44
+ display: block;
45
+ padding-top: .5em;
46
+ }
47
+
48
+ header {
49
+ padding-bottom: 1.5em;
50
+ }
@@ -0,0 +1,643 @@
1
+ @import "jekyll_pages_api_search";
2
+
3
+ /*
4
+ Main.css
5
+ ==================================
6
+ Begin with generic 'mobile first' styles
7
+ */
8
+
9
+ /*
10
+ Normalize the box model
11
+ ==================================
12
+ */
13
+
14
+ *,
15
+ *:before,
16
+ *:after {
17
+ -webkit-box-sizing: border-box;
18
+ -moz-box-sizing: border-box;
19
+ box-sizing: border-box;
20
+ }
21
+
22
+ /*
23
+ global styles
24
+ ==================================
25
+ */
26
+
27
+ html, body {
28
+ height: 100%;
29
+ }
30
+
31
+ /*
32
+ Typography
33
+ ==================================
34
+ */
35
+
36
+ body {
37
+ font-family: "Open Sans", Arial, sans-serif;
38
+ font-weight: 400;
39
+ font-style: normal;
40
+ line-height: 1.466666667;
41
+ margin: 0;
42
+ }
43
+
44
+ h1,
45
+ h2,
46
+ h3,
47
+ h4,
48
+ h5 {
49
+ font-family: "Raleway", Arial, sans-serif;
50
+ font-weight: 600;
51
+ }
52
+
53
+ .site-title {
54
+ font-size: 1.9em;
55
+ color: #919395;
56
+ margin: 0;
57
+ line-height: 1.2941176470588236;
58
+ display: inline-block;
59
+ }
60
+
61
+ h2 {
62
+ font-size: 1.375em;
63
+ margin: 1.4em 0 0 0;
64
+ }
65
+
66
+ h3 {
67
+ margin-top: 30px;
68
+ a {
69
+ border-bottom: 1px dotted #0072ce;
70
+ }
71
+ }
72
+
73
+ h4 {
74
+ font-size: 1em;
75
+ text-transform: uppercase;
76
+ }
77
+
78
+ .page-title {
79
+ margin-top: .727272727em; /* 16/22 */
80
+ }
81
+
82
+ /*
83
+ Lists
84
+ --------------------------------
85
+ */
86
+
87
+ .main-content ul {
88
+ padding-left: 1.1em;
89
+ }
90
+
91
+ .main-content li {
92
+ margin-bottom: 1em;
93
+ }
94
+
95
+ li h3,
96
+ li h4 {
97
+ margin: 0;
98
+ }
99
+
100
+ li p {
101
+ margin-top: 0;
102
+ }
103
+
104
+ /*
105
+ Links
106
+ ==================================
107
+ */
108
+
109
+ a {
110
+ -webkit-transition: .2s;
111
+ -moz-transition: .2s;
112
+ transition: .2s;
113
+ }
114
+
115
+ a,
116
+ a:link,
117
+ a:visited {
118
+ color: #006FC9;
119
+ text-decoration: none;
120
+ }
121
+
122
+ a:hover {
123
+ color: #7eb8dd;
124
+ text-decoration: none;
125
+ }
126
+
127
+ a:active {
128
+ color: #002d72;
129
+ text-decoration: none;
130
+ }
131
+
132
+ a:focus {
133
+ color: #006FC9;
134
+ outline: thin dotted;
135
+ text-decoration: none;
136
+ }
137
+
138
+ a.title-link {
139
+ color: #75787B;
140
+ }
141
+
142
+ a.title-link:hover,
143
+ a.title-link:active,
144
+ a.title-link:focus {
145
+ color: #7eb8dd;
146
+ }
147
+
148
+ a.skip-link {
149
+ color: #fff;
150
+ padding: .25em;
151
+ }
152
+
153
+ a.skip-link:hover,
154
+ a.skip-link:active,
155
+ a.skip-link:focus {
156
+ background-color: #006FC9;
157
+ color: #fff;
158
+ }
159
+
160
+ p {
161
+ a,
162
+ a:link,
163
+ a:visited {
164
+ border-bottom: 1px dotted #0072ce;
165
+
166
+ }
167
+ }
168
+
169
+ /*
170
+ Navigation
171
+ ==================================
172
+ */
173
+
174
+ .sidebar-nav a {
175
+ display: block;
176
+ padding: 10px;
177
+ -webkit-transition: .4s;
178
+ transition: .4s;
179
+ width: 80%;
180
+ float: left;
181
+ }
182
+
183
+ .sidebar-nav a,
184
+ .sidebar-nav a:link,
185
+ .sidebar-nav a:visited {
186
+ border-bottom: none;
187
+ color: #74767B;
188
+ }
189
+
190
+ .sidebar-nav a:hover,
191
+ .sidebar-nav a:focus,
192
+ .sidebar-nav a:active,
193
+ .sidebar-nav .sidebar-nav-active > a {
194
+ color: #74767B;
195
+ border-left: 4px solid #7401DF;
196
+ background-color: transparent;
197
+ }
198
+
199
+ .sidebar-nav ul {
200
+ margin: 0;
201
+ padding: 0;
202
+ }
203
+
204
+ .sidebar-nav li {
205
+ list-style: none;
206
+ border-bottom: 1px solid #babbbd;
207
+ font-size: 1.125em;
208
+ overflow: hidden;
209
+ }
210
+
211
+ .sidebar-nav li:last-child {
212
+ border-bottom: none;
213
+ }
214
+
215
+ .nav-children[aria-hidden=true] {
216
+ max-height: 0;
217
+ }
218
+
219
+ .nav-children {
220
+ clear: both;
221
+ display: block;
222
+ font-size: 14px;
223
+ max-height: initial;
224
+ max-height: 4000px;
225
+ overflow: auto;
226
+ opacity: 1;
227
+ position: relative;
228
+ -webkit-transition: max-height .2s, opacity .2s;
229
+ -moz-transition: max-height .2s, opacity .2s;
230
+ -o-transition: max-height .2s, opacity .2s;
231
+ transition: max-height .2s, opacity .2s;
232
+ }
233
+
234
+ .nav-children li {
235
+ border-bottom: none;
236
+ padding-left: 0;
237
+ }
238
+
239
+ .nav-children a {
240
+ padding: 5px 5px 5px 20px;
241
+ }
242
+
243
+ .nav-children li:last-child a {
244
+ padding-bottom: 10px;
245
+ }
246
+
247
+ .expand-subnav {
248
+ background: none;
249
+ border: none;
250
+ border-radius: 30px;
251
+ color: #0072ce;
252
+ cursor: pointer;
253
+ display: block;
254
+ float: right;
255
+ font-size: 20px;
256
+ height: 30px;
257
+ line-height: 1;
258
+ margin: 8px;
259
+ padding-bottom: 5px;
260
+ position: relative;
261
+ width: 30px;
262
+ -webkit-appearance: none;
263
+ -moz-appearance: none;
264
+ -o-appearance: none;
265
+ appearance: none;
266
+ -webkit-transition: -webkit-transform .2s;
267
+ -moz-transition: -moz-transform .2s;
268
+ -o-transition: -o-transform .2s;
269
+ transition: transform .2s;
270
+ }
271
+
272
+ .expand-subnav:hover,
273
+ .expand-subnav:focus {
274
+ background-color: #0072ce;
275
+ color: #fff;
276
+ outline: none;
277
+ }
278
+
279
+ .expand-subnav[aria-expanded=true] {
280
+ -webkit-transform: rotate(45deg);
281
+ -moz-transform: rotate(45deg);
282
+ -o-transform: rotate(45deg);
283
+ transform: rotate(45deg);
284
+ }
285
+
286
+ /*
287
+ Layout
288
+ ==================================
289
+ */
290
+
291
+ .logo {
292
+ display: block;
293
+ }
294
+
295
+ .content {
296
+ padding-top: 2em;
297
+ padding-bottom: 2em;
298
+ }
299
+
300
+ /* offset the fixed position header for jump links */
301
+ section:before {
302
+ display: block;
303
+ content: "";
304
+ height: 60px;
305
+ margin: -60px 0 0;
306
+ }
307
+
308
+ .wrap {
309
+ max-width: 1200px;
310
+ margin: 0 auto;
311
+ padding-left: 20px;
312
+ padding-right: 20px;
313
+ }
314
+
315
+ header {
316
+ border-bottom: 4px solid #7401DF;
317
+ background-color: #fff;
318
+ padding: 2em 0;
319
+ }
320
+
321
+ header div.wrap{
322
+ position: relative;
323
+ padding-top: 2.4em;
324
+ }
325
+
326
+ header div.wrap::after{
327
+ content: "";
328
+ display: table;
329
+ clear: both;
330
+ }
331
+
332
+ header h1.site-title{
333
+ margin-bottom: 0.4em;
334
+ }
335
+
336
+ header div.wrap div.back-link{
337
+ position: absolute;
338
+ left: 20px;
339
+ top: -1em;
340
+ font-size: 14px;
341
+ color: #555;
342
+ }
343
+
344
+ header div.wrap div.back-link a{
345
+ color: inherit;
346
+ text-decoration: underline;
347
+ }
348
+
349
+ header div.wrap div.back-link a:hover{ text-decoration: none; }
350
+
351
+ @media screen and (min-width: 45em){
352
+ header h1.site-title{
353
+ float: left;
354
+ width: 67%;
355
+ text-overflow: ellipsis;
356
+ overflow: hidden;
357
+ white-space: nowrap;
358
+ }
359
+ }
360
+
361
+ .main-content img {
362
+ max-width: 100%;
363
+ }
364
+
365
+ /*
366
+ Footer
367
+ ==================================
368
+ */
369
+
370
+ /* for sticky footer */
371
+ .container {
372
+ display: table;
373
+ height: 100%;
374
+ width: 100%;
375
+ }
376
+
377
+ footer {
378
+ display: table-row; /* for sticky footer */
379
+ height: 1px; /* for sticky footer */
380
+ border-top: 2px solid #babbbd;
381
+ background: #f1f2f2;
382
+ width: 100%;
383
+ font-size: 0.875em;
384
+ }
385
+
386
+ footer .wrap {
387
+ padding-top: 2em;
388
+ padding-bottom: 2em;
389
+ }
390
+
391
+
392
+ /*
393
+ Helpers
394
+ ==================================
395
+ */
396
+
397
+ /* Hide from both screenreaders and browsers: h5bp.com/u */
398
+ .hidden {
399
+ display: none !important;
400
+ visibility: hidden;
401
+ }
402
+
403
+ /* Hide only visually, but have it available for screenreaders: h5bp.com/v */
404
+ .visuallyhidden {
405
+ border: 0;
406
+ clip: rect(0 0 0 0);
407
+ height: 1px;
408
+ margin: -1px;
409
+ overflow: hidden;
410
+ padding: 0;
411
+ position: absolute;
412
+ width: 1px;
413
+ }
414
+
415
+ /* Extends the .visuallyhidden class to allow the element to be focusable
416
+ * when navigated to via the keyboard: h5bp.com/p */
417
+ .visuallyhidden.focusable:active,
418
+ .visuallyhidden.focusable:focus {
419
+ clip: auto;
420
+ height: auto;
421
+ margin: 0;
422
+ overflow: visible;
423
+ position: static;
424
+ width: auto;
425
+ }
426
+
427
+ /* Hide visually and from screenreaders, but maintain layout */
428
+ .invisible {
429
+ visibility: hidden;
430
+ }
431
+
432
+
433
+ /*
434
+ Style
435
+ ==================================
436
+ */
437
+
438
+ .intro {
439
+ color: #75787B;
440
+ }
441
+
442
+ li h4 {
443
+ margin: 0;
444
+ }
445
+
446
+ .license {
447
+ font-family: "Avenir Next Demi", Arial, sans-serif;
448
+ font-weight: normal;
449
+ font-style: normal;
450
+ }
451
+
452
+ pre {
453
+ max-width: 100%;
454
+ font-size: 0.875em;
455
+ overflow-y: scroll;
456
+ background-color: #f1f2f2;
457
+ padding: 10px;
458
+ }
459
+
460
+ /*
461
+ Post list
462
+ ----------------------------------
463
+ */
464
+
465
+ ul.posts {
466
+ padding: 0;
467
+ }
468
+
469
+ .posts li {
470
+ list-style: none;
471
+ }
472
+
473
+ .post-date {
474
+ color: #75787B;
475
+ }
476
+
477
+ /*
478
+ Repo list
479
+ ----------------------------------
480
+ */
481
+
482
+ ul.repo-list {
483
+ margin: .5em 0 1em 0;
484
+ padding: 0;
485
+ }
486
+
487
+ .repo-list li {
488
+ list-style: none;
489
+ }
490
+
491
+ .repo-list p {
492
+ margin: 0;
493
+ font-size: 0.875em;
494
+ }
495
+
496
+ .repo-list h4 {
497
+ text-transform: none;
498
+ }
499
+
500
+ /*
501
+ Helper Classes
502
+ ==================================
503
+ */
504
+
505
+ /*
506
+ Clearfix list
507
+ ----------------------------------
508
+ */
509
+
510
+ .group:before,
511
+ .group:after {
512
+ content: " ";
513
+ display: table;
514
+ }
515
+
516
+ .group:after {
517
+ clear: both;
518
+ }
519
+
520
+ .group {
521
+ *zoom: 1;
522
+ }
523
+
524
+ /*
525
+ Desktop Styles
526
+ ==================================
527
+ */
528
+
529
+ @media screen and (min-width: 45em) {
530
+
531
+ /*
532
+ Typography
533
+ ==============================
534
+ */
535
+
536
+ /*
537
+ Layout
538
+ ==============================
539
+ */
540
+
541
+ .logo {
542
+ max-width: 30%;
543
+ padding-right: 20px;
544
+ margin-top: -12px;
545
+ float: right;
546
+ }
547
+
548
+ aside {
549
+ width: 30%;
550
+ float: left;
551
+ }
552
+
553
+ .main-content {
554
+ width: 67%;
555
+ float: right;
556
+ margin-bottom: 120px;
557
+ }
558
+
559
+ .main-content img {
560
+ max-width: 100%;
561
+ }
562
+
563
+ /*
564
+ Navigation
565
+ ==============================
566
+ */
567
+
568
+ .anchorjs-link {
569
+ border: none;
570
+ }
571
+
572
+ /*
573
+ Style
574
+ ==============================
575
+ */
576
+
577
+ /*
578
+ Repo list
579
+ ------------------------------
580
+ */
581
+
582
+ .repo-list li {
583
+ list-style: none;
584
+ display: block;
585
+ float: left;
586
+ height: 4.0625em;
587
+ max-height: 4.0625em;
588
+ background-color: #E7E7E6;
589
+ border-left: 1px solid #BABBBD;
590
+ width: 30%;
591
+ }
592
+
593
+ .repo-list a:link,
594
+ .repo-list a:visited {
595
+ display: block;
596
+ max-height: 4.0625em;
597
+ background-color: #E7E7E6;
598
+ border-bottom: none;
599
+ padding: .625em 1em 1em 1em;
600
+ }
601
+
602
+ .repo-list a:hover {
603
+ color: #4D5F87;
604
+ background-color: #CDE3F1;
605
+ }
606
+
607
+ .repo-list li:first-child {
608
+ text-align: center;
609
+ border-left: none;
610
+ line-height: 60px;
611
+ padding: .625em 1em;
612
+ width: 10%;
613
+ }
614
+
615
+ }
616
+
617
+ @media screen and (max-width: 54.375em) {
618
+
619
+ /* keep the repo list containers the same height, but account for the need for more height */
620
+
621
+ .repo-list li {
622
+ height: 6em;
623
+ max-height: 6em;
624
+ }
625
+
626
+ .repo-list a:link,
627
+ .repo-list a:visited {
628
+ max-height: 6em;
629
+ }
630
+ }
631
+
632
+ /*
633
+ Mobile Styles
634
+ ==================================
635
+ */
636
+
637
+ @media screen and (max-width: 40.5em) {
638
+
639
+ .main-content {
640
+ margin-top: 1.5em;
641
+ }
642
+
643
+ }