j1-template 2023.10.0 → 2023.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/themes/j1/adapter/js/gallery.js +78 -23
- data/assets/themes/j1/core/css/themes/unolight/bootstrap.css +11 -11
- data/assets/themes/j1/modules/lightGallery/js/plugins/j1/lg-video.1.js +585 -0
- data/assets/themes/j1/modules/lightGallery/js/plugins/lg-fullscreen.min.js +26 -26
- data/assets/themes/j1/modules/lightGallery/js/plugins/lg-thumbnail.min.js +26 -26
- data/assets/themes/j1/modules/lightGallery/js/plugins/lg-video.js +14 -5
- data/assets/themes/j1/modules/lightGallery/js/plugins/lg-video.min.js +1 -2
- data/assets/themes/j1/modules/videojs/js/plugins/vm/examples/index.html +33 -33
- data/assets/themes/j1/modules/videojs/js/plugins/wt/api/Readme.txt +20 -20
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +2 -2
- data/lib/starter_web/README.md +5 -5
- data/lib/starter_web/_config.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/gallery.yml +1 -1
- data/lib/starter_web/_data/modules/gallery.yml +94 -28
- data/lib/starter_web/_data/templates/feed.xml +1 -1
- data/lib/starter_web/_plugins/asciidoctor/gallery-block.rb +50 -50
- data/lib/starter_web/_plugins/asciidoctor/gist-block.rb +56 -56
- data/lib/starter_web/_plugins/asciidoctor/google-ad-block.rb +52 -52
- data/lib/starter_web/_plugins/asciidoctor/lightbox-block.rb +88 -88
- data/lib/starter_web/_plugins/asciidoctor/masterslider-block.rb +54 -54
- data/lib/starter_web/_plugins/asciidoctor/range-slider-block.rb +49 -49
- data/lib/starter_web/_plugins/index/lunr.rb +1 -1
- data/lib/starter_web/assets/images/modules/attics/1920x1280/isaac-davis.jpg +0 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/2023-10-18-url-types.adoc +98 -0
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/present_images.adoc +3 -3
- data/lib/starter_web/pages/public/learn/roundtrip/present_videos.adoc +3 -2
- data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +595 -595
- data/lib/starter_web/pages/public/tools/previewer/preview_bootstrap_theme.adoc +3093 -3093
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +5 -2
@@ -50,7 +50,7 @@ settings:
|
|
50
50
|
# ------------------------------------------------------------------------
|
51
51
|
#
|
52
52
|
gallery_options:
|
53
|
-
rowHeight:
|
53
|
+
rowHeight: 250
|
54
54
|
gutters: 3
|
55
55
|
|
56
56
|
# ------------------------------------------------------------------------
|
@@ -203,6 +203,7 @@ settings:
|
|
203
203
|
file: oskars-sylwan_b.jpg
|
204
204
|
caption: New York City, United States
|
205
205
|
|
206
|
+
|
206
207
|
# ==========================================================================
|
207
208
|
# Video Galleries
|
208
209
|
# ==========================================================================
|
@@ -215,6 +216,7 @@ settings:
|
|
215
216
|
|
216
217
|
id: jg_video_html5
|
217
218
|
type: video
|
219
|
+
video: html5
|
218
220
|
video_base_path: /assets/videos/gallery/html5
|
219
221
|
image_base_path: /assets/videos/gallery
|
220
222
|
thumb_base_path: /assets/videos/gallery
|
@@ -224,7 +226,7 @@ settings:
|
|
224
226
|
# ------------------------------------------------------------------------
|
225
227
|
#
|
226
228
|
gallery_options:
|
227
|
-
rowHeight:
|
229
|
+
rowHeight: 250
|
228
230
|
gutters: 3
|
229
231
|
|
230
232
|
# ------------------------------------------------------------------------
|
@@ -245,9 +247,10 @@ settings:
|
|
245
247
|
animateThumb: true
|
246
248
|
autoplayFirstVideo: true
|
247
249
|
videojs: true
|
248
|
-
videojsTheme:
|
250
|
+
videojsTheme: vjs-theme-uno
|
249
251
|
|
250
252
|
videojsOptions:
|
253
|
+
enabled: true
|
251
254
|
controls: true
|
252
255
|
muted: false
|
253
256
|
preload: true
|
@@ -321,6 +324,7 @@ settings:
|
|
321
324
|
|
322
325
|
id: jg_video_online_youtube
|
323
326
|
type: video
|
327
|
+
video: youtube
|
324
328
|
image_base_path: /assets/videos/gallery
|
325
329
|
thumb_base_path: /assets/videos/gallery
|
326
330
|
|
@@ -351,7 +355,19 @@ settings:
|
|
351
355
|
autoplayFirstVideo: true
|
352
356
|
videojs: false
|
353
357
|
|
354
|
-
videojsOptions:
|
358
|
+
videojsOptions:
|
359
|
+
enabled: false
|
360
|
+
|
361
|
+
playerParams:
|
362
|
+
enabled: true
|
363
|
+
autoplay: 0
|
364
|
+
controls: 0
|
365
|
+
enablejsapi: 1
|
366
|
+
hl: en
|
367
|
+
loop: 0
|
368
|
+
mute: 0
|
369
|
+
playsinline: 1
|
370
|
+
wmode: opaque
|
355
371
|
|
356
372
|
# ------------------------------------------------------------------------
|
357
373
|
# CSS filter options
|
@@ -374,7 +390,7 @@ settings:
|
|
374
390
|
name: Carpool Karaoke Lady Gaga
|
375
391
|
type: youtube
|
376
392
|
size: "1280-720"
|
377
|
-
source: "
|
393
|
+
source: "//youtube.com/watch?v=X5Cfi7U4eL4"
|
378
394
|
pinterest_prefix: Pin video
|
379
395
|
tweet_prefix: Try video
|
380
396
|
description: >
|
@@ -388,13 +404,16 @@ settings:
|
|
388
404
|
caption:
|
389
405
|
text: "YouTube · Carpool Karaoke Lady Gaga"
|
390
406
|
|
407
|
+
playerParams:
|
408
|
+
enabled: false
|
409
|
+
|
391
410
|
- video: # video 2
|
392
411
|
enabled: true
|
393
412
|
|
394
413
|
name: Carpool Karaoke Adele
|
395
414
|
type: youtube
|
396
415
|
size: "1280-720"
|
397
|
-
source: "
|
416
|
+
source: "//youtube.com/watch?v=Nck6BZga7TQ"
|
398
417
|
pinterest_prefix: Pin video
|
399
418
|
tweet_prefix: Try video
|
400
419
|
description: >
|
@@ -409,13 +428,16 @@ settings:
|
|
409
428
|
caption:
|
410
429
|
text: "YouTube · Carpool Karaoke Adele"
|
411
430
|
|
431
|
+
playerParams:
|
432
|
+
enabled: false
|
433
|
+
|
412
434
|
- video: # video 3
|
413
435
|
enabled: true
|
414
436
|
|
415
437
|
name: Carpool Karaoke Gwen Stefani
|
416
438
|
type: youtube
|
417
439
|
size: "1280-720"
|
418
|
-
source: "
|
440
|
+
source: "//youtube.com/watch?v=F2SXmzk8ve4"
|
419
441
|
pinterest_prefix: Pin video
|
420
442
|
tweet_prefix: Try video
|
421
443
|
description: >
|
@@ -429,13 +451,15 @@ settings:
|
|
429
451
|
caption:
|
430
452
|
text: "YouTube · Carpool Karaoke Gwen Stefani"
|
431
453
|
|
454
|
+
playerParams: false
|
455
|
+
|
432
456
|
- video: # video 4
|
433
457
|
enabled: true
|
434
458
|
|
435
459
|
name: Carpool Karaoke Michelle Obama
|
436
460
|
type: youtube
|
437
461
|
size: "1280-720"
|
438
|
-
source: "
|
462
|
+
source: "//youtube.com/watch?v=ln3wAdRAim4"
|
439
463
|
pinterest_prefix: Pin video
|
440
464
|
tweet_prefix: Try video
|
441
465
|
description: >
|
@@ -450,6 +474,8 @@ settings:
|
|
450
474
|
caption:
|
451
475
|
text: "YouTube · Carpool Karaoke Michelle Obama"
|
452
476
|
|
477
|
+
playerParams:
|
478
|
+
enabled: false
|
453
479
|
|
454
480
|
# --------------------------------------------------------------------------
|
455
481
|
# Online VIDEO (YouTube)
|
@@ -459,6 +485,7 @@ settings:
|
|
459
485
|
|
460
486
|
id: jg_video_online_youtube_james_and_adele
|
461
487
|
type: video
|
488
|
+
video: youtube
|
462
489
|
image_base_path: /assets/videos/gallery
|
463
490
|
thumb_base_path: /assets/videos/gallery
|
464
491
|
|
@@ -467,7 +494,7 @@ settings:
|
|
467
494
|
# ------------------------------------------------------------------------
|
468
495
|
#
|
469
496
|
gallery_options:
|
470
|
-
rowHeight:
|
497
|
+
rowHeight: 250
|
471
498
|
gutters: 3
|
472
499
|
|
473
500
|
# ------------------------------------------------------------------------
|
@@ -489,7 +516,20 @@ settings:
|
|
489
516
|
autoplayFirstVideo: true
|
490
517
|
videojs: false
|
491
518
|
|
492
|
-
videojsOptions:
|
519
|
+
videojsOptions:
|
520
|
+
enabled: false
|
521
|
+
|
522
|
+
# See: https://stackoverflow.com/questions/40685142/youtube-autoplay-does-not-work-with-iframe
|
523
|
+
playerParams:
|
524
|
+
enabled: true
|
525
|
+
autoplay: 1 # autoplay = 1 only available for YouTube when muted.
|
526
|
+
# controls: 1 # default = 0
|
527
|
+
# enablejsapi: 1 # default = 1
|
528
|
+
# hl: en # default = en
|
529
|
+
# loop: 0 # default = 0
|
530
|
+
mute: 0 # default = 1
|
531
|
+
# playsinline: 1 # for mobile|iOS only
|
532
|
+
# wmode: opaque # default = opaque
|
493
533
|
|
494
534
|
# ------------------------------------------------------------------------
|
495
535
|
# CSS filter options
|
@@ -512,7 +552,7 @@ settings:
|
|
512
552
|
name: Carpool Karaoke Lady Gaga
|
513
553
|
type: youtube
|
514
554
|
size: "1280-720"
|
515
|
-
source: "
|
555
|
+
source: "//youtube.com/watch?v=Nck6BZga7TQ"
|
516
556
|
pinterest_prefix: Pin video
|
517
557
|
tweet_prefix: Try video
|
518
558
|
description: >
|
@@ -533,7 +573,7 @@ settings:
|
|
533
573
|
name: Last Carpool Karaoke
|
534
574
|
type: youtube
|
535
575
|
size: "1280-720"
|
536
|
-
source: "
|
576
|
+
source: "//youtube.com/watch?v=nV8UZJNBY6Y"
|
537
577
|
pinterest_prefix: Pin video
|
538
578
|
tweet_prefix: Try video
|
539
579
|
description: >
|
@@ -547,8 +587,6 @@ settings:
|
|
547
587
|
caption:
|
548
588
|
text: "YouTube · Last Carpool Karaoke"
|
549
589
|
|
550
|
-
|
551
|
-
|
552
590
|
# --------------------------------------------------------------------------
|
553
591
|
# Online VIDEO 2 (YouTube)
|
554
592
|
#
|
@@ -557,6 +595,7 @@ settings:
|
|
557
595
|
|
558
596
|
id: jg_video_online_youtube_voice_kids
|
559
597
|
type: video
|
598
|
+
video: youtube
|
560
599
|
image_base_path: /assets/videos/gallery/voice_kids_de_2021
|
561
600
|
thumb_base_path: /assets/videos/gallery/voice_kids_de_2021
|
562
601
|
|
@@ -587,7 +626,20 @@ settings:
|
|
587
626
|
autoplayFirstVideo: true
|
588
627
|
videojs: false
|
589
628
|
|
590
|
-
videojsOptions:
|
629
|
+
videojsOptions:
|
630
|
+
enabled: false
|
631
|
+
|
632
|
+
# See: https://stackoverflow.com/questions/40685142/youtube-autoplay-does-not-work-with-iframe
|
633
|
+
playerParams:
|
634
|
+
enabled: true
|
635
|
+
autoplay: 1 # autoplay = 1 only available for YouTube when muted.
|
636
|
+
# controls: 1 # default = 0
|
637
|
+
# enablejsapi: 1 # default = 1
|
638
|
+
# hl: en # default = en
|
639
|
+
# loop: 0 # default = 0
|
640
|
+
mute: 0 # default = 1
|
641
|
+
# playsinline: 1 # for mobile|iOS only
|
642
|
+
# wmode: opaque # default = opaque
|
591
643
|
|
592
644
|
# ------------------------------------------------------------------------
|
593
645
|
# CSS filter options
|
@@ -610,7 +662,7 @@ settings:
|
|
610
662
|
name: Voice Kids - Constance
|
611
663
|
type: youtube
|
612
664
|
size: "1280-720"
|
613
|
-
source: "
|
665
|
+
source: "//youtube.com/watch?v=aQqPgLMgO-I"
|
614
666
|
pinterest_prefix: Pin video
|
615
667
|
tweet_prefix: Try video
|
616
668
|
description: >
|
@@ -631,7 +683,7 @@ settings:
|
|
631
683
|
name: Voice Kids - Elisa
|
632
684
|
type: youtube
|
633
685
|
size: "1280-720"
|
634
|
-
source: "
|
686
|
+
source: "//youtube.com/watch?v=Bl6tkAgaP1g"
|
635
687
|
pinterest_prefix: Pin video
|
636
688
|
tweet_prefix: Try video
|
637
689
|
description: >
|
@@ -651,7 +703,7 @@ settings:
|
|
651
703
|
name: Voice Kids - Ben
|
652
704
|
type: youtube
|
653
705
|
size: "1280-720"
|
654
|
-
source: "
|
706
|
+
source: "//youtube.com/watch?v=GuiOYCv9NTI"
|
655
707
|
pinterest_prefix: Pin video
|
656
708
|
tweet_prefix: Try video
|
657
709
|
description: >
|
@@ -671,7 +723,7 @@ settings:
|
|
671
723
|
name: Voice Kids - The Battle
|
672
724
|
type: youtube
|
673
725
|
size: "1280-720"
|
674
|
-
source: "
|
726
|
+
source: "//youtube.com/watch?v=1bvE2mgJ22I"
|
675
727
|
pinterest_prefix: Pin video
|
676
728
|
tweet_prefix: Try video
|
677
729
|
description: >
|
@@ -694,6 +746,7 @@ settings:
|
|
694
746
|
|
695
747
|
id: jg_video_online_vimeo
|
696
748
|
type: video
|
749
|
+
video: vimeo
|
697
750
|
image_base_path: /assets/videos/gallery
|
698
751
|
thumb_base_path: /assets/videos/gallery
|
699
752
|
|
@@ -702,7 +755,7 @@ settings:
|
|
702
755
|
# ------------------------------------------------------------------------
|
703
756
|
#
|
704
757
|
gallery_options:
|
705
|
-
rowHeight:
|
758
|
+
rowHeight: 250
|
706
759
|
gutters: 3
|
707
760
|
|
708
761
|
# ------------------------------------------------------------------------
|
@@ -724,7 +777,16 @@ settings:
|
|
724
777
|
autoplayFirstVideo: true
|
725
778
|
videojs: false
|
726
779
|
|
727
|
-
videojsOptions:
|
780
|
+
videojsOptions:
|
781
|
+
enabled: false
|
782
|
+
|
783
|
+
playerParams:
|
784
|
+
enabled: false
|
785
|
+
autoplay: 0
|
786
|
+
byline: 0
|
787
|
+
portrait: 0
|
788
|
+
color: CCCCCC
|
789
|
+
muted: 0
|
728
790
|
|
729
791
|
# ------------------------------------------------------------------------
|
730
792
|
# CSS filter options
|
@@ -747,7 +809,7 @@ settings:
|
|
747
809
|
name: Forever 21
|
748
810
|
type: vimeo
|
749
811
|
size: "1280-720"
|
750
|
-
source: "
|
812
|
+
source: "//vimeo.com/179528528"
|
751
813
|
pinterest_prefix: Pin video
|
752
814
|
tweet_prefix: Try video
|
753
815
|
description: >
|
@@ -766,7 +828,7 @@ settings:
|
|
766
828
|
name: Forever 21
|
767
829
|
type: vimeo
|
768
830
|
size: "1280-720"
|
769
|
-
source: "
|
831
|
+
source: "//vimeo.com/202117650"
|
770
832
|
pinterest_prefix: Pin video
|
771
833
|
tweet_prefix: Try video
|
772
834
|
description: >
|
@@ -779,7 +841,6 @@ settings:
|
|
779
841
|
caption:
|
780
842
|
text: "Vimeo · Forever 21 - Stay Colorful, Babe!"
|
781
843
|
|
782
|
-
|
783
844
|
# --------------------------------------------------------------------------
|
784
845
|
# Online VIDEO (DailyMotion)
|
785
846
|
#
|
@@ -788,6 +849,7 @@ settings:
|
|
788
849
|
|
789
850
|
id: jg_video_online_dailymotion
|
790
851
|
type: video
|
852
|
+
video: dailymotion
|
791
853
|
image_base_path: /assets/videos/gallery/dailymotion
|
792
854
|
thumb_base_path: /assets/videos/gallery/dailymotion
|
793
855
|
|
@@ -796,7 +858,7 @@ settings:
|
|
796
858
|
# ------------------------------------------------------------------------
|
797
859
|
#
|
798
860
|
gallery_options:
|
799
|
-
rowHeight:
|
861
|
+
rowHeight: 250
|
800
862
|
gutters: 3
|
801
863
|
|
802
864
|
# ------------------------------------------------------------------------
|
@@ -818,7 +880,11 @@ settings:
|
|
818
880
|
autoplayFirstVideo: true
|
819
881
|
videojs: false
|
820
882
|
|
821
|
-
videojsOptions:
|
883
|
+
videojsOptions:
|
884
|
+
enabled: false
|
885
|
+
|
886
|
+
playerParams:
|
887
|
+
enabled: false
|
822
888
|
|
823
889
|
# ------------------------------------------------------------------------
|
824
890
|
# CSS filter options
|
@@ -841,7 +907,7 @@ settings:
|
|
841
907
|
name: SELF Channel
|
842
908
|
type: dailymotion
|
843
909
|
size: "1280-720"
|
844
|
-
source: "
|
910
|
+
source: "//dai.ly/x887s09"
|
845
911
|
pinterest_prefix: Pin video
|
846
912
|
tweet_prefix: Try video
|
847
913
|
description: >
|
@@ -860,7 +926,7 @@ settings:
|
|
860
926
|
name: SELF Channel
|
861
927
|
type: dailymotion
|
862
928
|
size: "1280-720"
|
863
|
-
source: "
|
929
|
+
source: "//dai.ly/x87ycik"
|
864
930
|
pinterest_prefix: Pin video
|
865
931
|
tweet_prefix: Try video
|
866
932
|
description: >
|
@@ -57,7 +57,7 @@
|
|
57
57
|
<id>{{ page.url | absolute_url | xml_escape }}</id>
|
58
58
|
<post_limited>{{ limit_posts }}</post_limited>
|
59
59
|
<template_name>J1 Theme</template_name>
|
60
|
-
<template_version>2023.10.
|
60
|
+
<template_version>2023.10.2</template_version>
|
61
61
|
|
62
62
|
{% assign title = site.title | default: site.name %}
|
63
63
|
{% if page.collection != "posts" %}
|
@@ -1,50 +1,50 @@
|
|
1
|
-
# ------------------------------------------------------------------------------
|
2
|
-
# ~/_plugins/asciidoctor-extensions/gallery-block.rb
|
3
|
-
# Asciidoctor extension for J1 Galleries
|
4
|
-
#
|
5
|
-
# Product/Info:
|
6
|
-
# https://jekyll.one
|
7
|
-
#
|
8
|
-
# Copyright (C) 2023 Juergen Adams
|
9
|
-
#
|
10
|
-
# J1 Template is licensed under the MIT License.
|
11
|
-
# See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE.md
|
12
|
-
# ------------------------------------------------------------------------------
|
13
|
-
require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal'
|
14
|
-
include Asciidoctor
|
15
|
-
|
16
|
-
# A block macro that embeds a Gallery block into the output document
|
17
|
-
#
|
18
|
-
# Usage
|
19
|
-
#
|
20
|
-
# gallery::gallery_id[role="additional classes"]
|
21
|
-
#
|
22
|
-
# Example:
|
23
|
-
#
|
24
|
-
# .The gallery title
|
25
|
-
# gallery::jg_live_demo[role="mt-4 mb-5"]
|
26
|
-
#
|
27
|
-
Asciidoctor::Extensions.register do
|
28
|
-
|
29
|
-
class ImageBlockMacro < Extensions::BlockMacroProcessor
|
30
|
-
use_dsl
|
31
|
-
|
32
|
-
named :gallery
|
33
|
-
name_positional_attributes 'role'
|
34
|
-
default_attrs 'role' => 'mt-4 mb-4'
|
35
|
-
|
36
|
-
def process parent, target, attributes
|
37
|
-
title_html = (attributes.has_key? 'title') ? %(<div class="gallery-title">#{attributes['title']}</div>\n) : nil
|
38
|
-
html = %(
|
39
|
-
<div class="#{attributes['role']}">
|
40
|
-
#{title_html}
|
41
|
-
<div id="#{target}_parent" class="gallery"></div>
|
42
|
-
</div>
|
43
|
-
)
|
44
|
-
|
45
|
-
create_pass_block parent, html, attributes, subs: nil
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
block_macro ImageBlockMacro
|
50
|
-
end
|
1
|
+
# ------------------------------------------------------------------------------
|
2
|
+
# ~/_plugins/asciidoctor-extensions/gallery-block.rb
|
3
|
+
# Asciidoctor extension for J1 Galleries
|
4
|
+
#
|
5
|
+
# Product/Info:
|
6
|
+
# https://jekyll.one
|
7
|
+
#
|
8
|
+
# Copyright (C) 2023 Juergen Adams
|
9
|
+
#
|
10
|
+
# J1 Template is licensed under the MIT License.
|
11
|
+
# See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE.md
|
12
|
+
# ------------------------------------------------------------------------------
|
13
|
+
require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal'
|
14
|
+
include Asciidoctor
|
15
|
+
|
16
|
+
# A block macro that embeds a Gallery block into the output document
|
17
|
+
#
|
18
|
+
# Usage
|
19
|
+
#
|
20
|
+
# gallery::gallery_id[role="additional classes"]
|
21
|
+
#
|
22
|
+
# Example:
|
23
|
+
#
|
24
|
+
# .The gallery title
|
25
|
+
# gallery::jg_live_demo[role="mt-4 mb-5"]
|
26
|
+
#
|
27
|
+
Asciidoctor::Extensions.register do
|
28
|
+
|
29
|
+
class ImageBlockMacro < Extensions::BlockMacroProcessor
|
30
|
+
use_dsl
|
31
|
+
|
32
|
+
named :gallery
|
33
|
+
name_positional_attributes 'role'
|
34
|
+
default_attrs 'role' => 'mt-4 mb-4'
|
35
|
+
|
36
|
+
def process parent, target, attributes
|
37
|
+
title_html = (attributes.has_key? 'title') ? %(<div class="gallery-title">#{attributes['title']}</div>\n) : nil
|
38
|
+
html = %(
|
39
|
+
<div class="#{attributes['role']}">
|
40
|
+
#{title_html}
|
41
|
+
<div id="#{target}_parent" class="gallery"></div>
|
42
|
+
</div>
|
43
|
+
)
|
44
|
+
|
45
|
+
create_pass_block parent, html, attributes, subs: nil
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
block_macro ImageBlockMacro
|
50
|
+
end
|
@@ -1,56 +1,56 @@
|
|
1
|
-
# ------------------------------------------------------------------------------
|
2
|
-
# ~/_plugins/asciidoctor-extensions/gist-block.rb
|
3
|
-
# Asciidoctor extension for J1 Theme
|
4
|
-
#
|
5
|
-
# Product/Info:
|
6
|
-
# https://jekyll.one
|
7
|
-
#
|
8
|
-
# Copyright (C) 2023 Juergen Adams
|
9
|
-
#
|
10
|
-
# J1 Template is licensed under the MIT License.
|
11
|
-
# See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE.md
|
12
|
-
#
|
13
|
-
# ------------------------------------------------------------------------------
|
14
|
-
require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal'
|
15
|
-
include Asciidoctor
|
16
|
-
|
17
|
-
# A block macro that embeds a Gist into the output document
|
18
|
-
#
|
19
|
-
# Usage
|
20
|
-
#
|
21
|
-
# gist::12345[]
|
22
|
-
#
|
23
|
-
# Example:
|
24
|
-
#
|
25
|
-
# .Guard setup to live preview AsciiDoc output
|
26
|
-
# gist::mojavelinux/5546622[]
|
27
|
-
#
|
28
|
-
Asciidoctor::Extensions.register do
|
29
|
-
|
30
|
-
class GistBlockMacro < Extensions::BlockMacroProcessor
|
31
|
-
use_dsl
|
32
|
-
|
33
|
-
named :gist
|
34
|
-
name_positional_attributes 'role'
|
35
|
-
default_attrs 'role' => 'mt-3 mb-3'
|
36
|
-
|
37
|
-
def process parent, target, attributes
|
38
|
-
|
39
|
-
title_html = (attributes.has_key? 'title') ? %(<div class="title notranslate">#{attributes['title']}</div>\n) : nil
|
40
|
-
html = %(
|
41
|
-
<div class="#{attributes['role']}">
|
42
|
-
<div class="openblock gist">
|
43
|
-
#{title_html}
|
44
|
-
<div class="content">
|
45
|
-
<script src="https://gist.github.com/#{target}.js"></script>
|
46
|
-
</div>
|
47
|
-
</div>
|
48
|
-
</div>
|
49
|
-
)
|
50
|
-
|
51
|
-
create_pass_block parent, html, attributes, subs: nil
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
block_macro GistBlockMacro
|
56
|
-
end
|
1
|
+
# ------------------------------------------------------------------------------
|
2
|
+
# ~/_plugins/asciidoctor-extensions/gist-block.rb
|
3
|
+
# Asciidoctor extension for J1 Theme
|
4
|
+
#
|
5
|
+
# Product/Info:
|
6
|
+
# https://jekyll.one
|
7
|
+
#
|
8
|
+
# Copyright (C) 2023 Juergen Adams
|
9
|
+
#
|
10
|
+
# J1 Template is licensed under the MIT License.
|
11
|
+
# See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE.md
|
12
|
+
#
|
13
|
+
# ------------------------------------------------------------------------------
|
14
|
+
require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal'
|
15
|
+
include Asciidoctor
|
16
|
+
|
17
|
+
# A block macro that embeds a Gist into the output document
|
18
|
+
#
|
19
|
+
# Usage
|
20
|
+
#
|
21
|
+
# gist::12345[]
|
22
|
+
#
|
23
|
+
# Example:
|
24
|
+
#
|
25
|
+
# .Guard setup to live preview AsciiDoc output
|
26
|
+
# gist::mojavelinux/5546622[]
|
27
|
+
#
|
28
|
+
Asciidoctor::Extensions.register do
|
29
|
+
|
30
|
+
class GistBlockMacro < Extensions::BlockMacroProcessor
|
31
|
+
use_dsl
|
32
|
+
|
33
|
+
named :gist
|
34
|
+
name_positional_attributes 'role'
|
35
|
+
default_attrs 'role' => 'mt-3 mb-3'
|
36
|
+
|
37
|
+
def process parent, target, attributes
|
38
|
+
|
39
|
+
title_html = (attributes.has_key? 'title') ? %(<div class="title notranslate">#{attributes['title']}</div>\n) : nil
|
40
|
+
html = %(
|
41
|
+
<div class="#{attributes['role']}">
|
42
|
+
<div class="openblock gist">
|
43
|
+
#{title_html}
|
44
|
+
<div class="content">
|
45
|
+
<script src="https://gist.github.com/#{target}.js"></script>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
</div>
|
49
|
+
)
|
50
|
+
|
51
|
+
create_pass_block parent, html, attributes, subs: nil
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
block_macro GistBlockMacro
|
56
|
+
end
|