jekyll-koziolekweb-tags 0.1.0 → 0.3.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: 43266d61852a499977df46bd3d4626c0368b121dc1d962857c41b0308470bf20
4
+ data.tar.gz: f5f7fcdcade5cdead24b51f2cf2cd46a06cf3d71f42c0d9cdfb37ff441ba9749
5
5
  SHA512:
6
- metadata.gz: 6dba95f4e83f2fb79caddcc5f716133bd84f00f1279cb3f0bb97ffa58b1957613284e159214b90c20edfd40240bce1eebd4a83eb3ca664ffe874aeec91ae87ae
7
- data.tar.gz: 22b37801ec6c35b3b07457e34cbff6b9ce2a85e846bc437401094fcd54e5c7b1ec655a91c5750f171fac0f47cf20d6fb7a4d62258d00e96b31b05d956258b25c
6
+ metadata.gz: 5f8d6d2baee780bcfdc57cb95a4daea148c5a3650a309f0842fdee46b9bbf8179732685ea9fe3e8a97576ef22593851f1a2044a187e20754229f20ca0230536f
7
+ data.tar.gz: 31c0a52191c88d868658edecfb63432844f9953609bcacdc6df4c25419d3a71dd85a80cfabb070125ba49228b6b2d6a119780e452aae0e77054b7aa877e2c543
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
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/jekyll/koziolekweb/tags/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "jekyll-koziolekweb-tags"
7
+ spec.version = Jekyll::Koziolekweb::Tags::VERSION
8
+ spec.authors = ["Koziolek"]
9
+ spec.email = ["bjkuczynski@gmail.com"]
10
+
11
+ spec.summary = "Set of structural tags that helps to organise article."
12
+ spec.description = "Here you will find a set of tags that allow you to create code listings with numbering, notes using the <aside> element and more."
13
+ spec.homepage = "https://github.com/Koziolek/jekyll-koziolekweb-tags"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 2.4.0"
16
+ spec.add_dependency "jekyll", ">= 3.7", "< 5.0"
17
+
18
+ # Specify which files should be added to the gem when it is released.
19
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
+ spec.files = Dir.chdir(__dir__) do
21
+ `git ls-files -z`.split("\x0").reject do |f|
22
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
23
+ end
24
+ end
25
+ spec.bindir = "exe"
26
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
27
+
28
+ spec.metadata["source_code_uri"] = "https://github.com/Koziolek/jekyll-koziolekweb-tags"
29
+ spec.metadata["changelog_uri"] = "https://github.com/Koziolek/jekyll-koziolekweb-tags/CHANGELOG.md"
30
+
31
+
32
+ spec.require_paths = ["lib"]
33
+
34
+ # Uncomment to register a new dependency of your gem
35
+ # spec.add_dependency "example-gem", "~> 1.0"
36
+
37
+ # For more information and examples about making a new gem, check out our
38
+ # guide at: https://bundler.io/guides/creating_gem.html
39
+ end
@@ -3,7 +3,7 @@
3
3
  module Jekyll
4
4
  module Koziolekweb
5
5
  module Tags
6
- VERSION = "0.1.0"
6
+ VERSION = "0.3.0"
7
7
  end
8
8
  end
9
9
  end
@@ -32,8 +32,9 @@ module Koziolekweb
32
32
  @@file_state[current_file] += 1
33
33
  content = super
34
34
  content_with_code_fence = "```#{@lang} #{content}```"
35
+ title_with_parese = "#{@title}"
35
36
 
36
- "<p class='listing'> Listing #{@@file_state[current_file]}. #{@title}</p>#{content_with_code_fence}"
37
+ "<p class='listing'> Listing #{@@file_state[current_file]}. #{@title_with_parese}</p>#{content_with_code_fence}"
37
38
  end
38
39
  end
39
40
 
@@ -49,8 +50,24 @@ module Koziolekweb
49
50
  "<aside class=\"offtopic f-#{@direction}\">#{content}</aside>"
50
51
  end
51
52
  end
53
+
54
+ class YtVideo < Liquid::Tag
55
+ def initialize(tag_name, video_id, tokens)
56
+ super
57
+ @video_id = video_id.strip
58
+ end
59
+
60
+ def render(_context)
61
+ <<~HTML
62
+ <div class="video">
63
+ <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>
64
+ </div>
65
+ HTML
66
+ end
67
+ end
52
68
  end
53
69
  end
54
70
 
55
71
  Liquid::Template.register_tag('listing', Koziolekweb::Tags::Listing)
56
- Liquid::Template.register_tag('offtop', Koziolekweb::Tags::Offtop)
72
+ Liquid::Template.register_tag('offtop', Koziolekweb::Tags::Offtop)
73
+ 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.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koziolek
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-14 00:00:00.000000000 Z
11
+ date: 2025-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -42,6 +42,7 @@ files:
42
42
  - Gemfile
43
43
  - README.md
44
44
  - Rakefile
45
+ - jekyll-koziolekweb-tags.gemspec
45
46
  - lib/jekyll/koziolekweb/tags.rb
46
47
  - lib/jekyll/koziolekweb/tags/version.rb
47
48
  - sig/jekyll/koziolekweb/tags.rbs
@@ -51,7 +52,7 @@ licenses:
51
52
  metadata:
52
53
  source_code_uri: https://github.com/Koziolek/jekyll-koziolekweb-tags
53
54
  changelog_uri: https://github.com/Koziolek/jekyll-koziolekweb-tags/CHANGELOG.md
54
- post_install_message:
55
+ post_install_message:
55
56
  rdoc_options: []
56
57
  require_paths:
57
58
  - lib
@@ -66,8 +67,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
67
  - !ruby/object:Gem::Version
67
68
  version: '0'
68
69
  requirements: []
69
- rubygems_version: 3.3.4
70
- signing_key:
70
+ rubygems_version: 3.4.10
71
+ signing_key:
71
72
  specification_version: 4
72
73
  summary: Set of structural tags that helps to organise article.
73
74
  test_files: []