jekyll-koziolekweb-tags 0.1.0 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce633e08c9c757a2af4a2f8058620ffc3f91c896097297046d6f40ce5b065e83
4
- data.tar.gz: b3b81fe9441a1cfe89acd189a0b6e4c831b9a16d09c19abf9fe1ed7c6a5cfe41
3
+ metadata.gz: ed61d38c76920fab927651b97700c9f928937bc3fb5de4670b527b4a017dac07
4
+ data.tar.gz: 9bb5a329d41433716cd0c69e4d27dd3957e2a23351f909867f3fa5dafd1274f0
5
5
  SHA512:
6
- metadata.gz: 6dba95f4e83f2fb79caddcc5f716133bd84f00f1279cb3f0bb97ffa58b1957613284e159214b90c20edfd40240bce1eebd4a83eb3ca664ffe874aeec91ae87ae
7
- data.tar.gz: 22b37801ec6c35b3b07457e34cbff6b9ce2a85e846bc437401094fcd54e5c7b1ec655a91c5750f171fac0f47cf20d6fb7a4d62258d00e96b31b05d956258b25c
6
+ metadata.gz: 10f070571ea4cc21926a7010ab24d89013117190b98de610fbbbe2b5c547a5c5eade5c3bf1350b3e86d2249bfa298ab7bf1d4150d1380758a8e4be9e2899fab8
7
+ data.tar.gz: df3080ae27c1f76239feafcbd56aaf3835e57f5a50428d26c1ea9c070f021c0891e259b6265d289032b7c977c2f4937efb33d3ee727bbf54630e819550c15785
data/README.md CHANGED
@@ -54,13 +54,29 @@ in md file, then it will generate:
54
54
 
55
55
  ```html
56
56
  <p class="listing">Listing X. TITLE</p>
57
- \`\`\`LANG
57
+ \```LANG
58
58
  Your code goes here
59
- \`\`\`
59
+ \```
60
60
  ```
61
61
 
62
62
  and finally it will be processed by markdown engine to final form. `X` is an number of listing, starts from 1 and work in post context.
63
63
 
64
+ ### yt_video
65
+
66
+ This tag helps to embed youtube video:
67
+
68
+ ```
69
+ {% yt_video VIDEO_ID %}
70
+ ```
71
+
72
+ will generate
73
+
74
+ ```html
75
+ <div class="video">
76
+ <iframe src="https://www.youtube-nocookie.com/embed/VIDEO_ID" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
77
+ </div>
78
+ ```
79
+
64
80
  ## Development
65
81
 
66
82
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to
@@ -3,7 +3,7 @@
3
3
  module Jekyll
4
4
  module Koziolekweb
5
5
  module Tags
6
- VERSION = "0.1.0"
6
+ VERSION = "0.2.0"
7
7
  end
8
8
  end
9
9
  end
@@ -49,8 +49,24 @@ module Koziolekweb
49
49
  "<aside class=\"offtopic f-#{@direction}\">#{content}</aside>"
50
50
  end
51
51
  end
52
+
53
+ class YtVideo < Liquid::Tag
54
+ def initialize(tag_name, video_id, tokens)
55
+ super
56
+ @video_id = video_id.strip
57
+ end
58
+
59
+ def render(_context)
60
+ <<~HTML
61
+ <div class="video">
62
+ <iframe src="https://www.youtube-nocookie.com/embed/#{@video_id}" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
63
+ </div>
64
+ HTML
65
+ end
66
+ end
52
67
  end
53
68
  end
54
69
 
55
70
  Liquid::Template.register_tag('listing', Koziolekweb::Tags::Listing)
56
- Liquid::Template.register_tag('offtop', Koziolekweb::Tags::Offtop)
71
+ Liquid::Template.register_tag('offtop', Koziolekweb::Tags::Offtop)
72
+ Liquid::Template.register_tag('yt_video', Koziolekweb::Tags::YtVideo)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-koziolekweb-tags
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koziolek
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-14 00:00:00.000000000 Z
11
+ date: 2024-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll