jekyll-koziolekweb-tags 0.4.1 → 0.4.3
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 +4 -4
- data/CHANGELOG.md +37 -1
- data/Gemfile +1 -0
- data/Rakefile +94 -1
- data/lib/jekyll/koziolekweb/tags/version.rb +1 -1
- data/lib/jekyll/koziolekweb/tags.rb +24 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68be660e0e952fcf86e2b702d84f26c8c9e3cbfba90580a34eb108540ac8d52c
|
4
|
+
data.tar.gz: 510e07d20ac6f9f9be165ada31ad563ba936adab949738ab6dce861ad15c209b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee37cbb3a2abd8ba746aa44d5297750c26485ef2cd49bba993c5c2f6eca2b91931f42efab42652cdc910632bc3b8537c86e687fcb479af7d7da81ffcbeb36291
|
7
|
+
data.tar.gz: d4df007d493c1c405cdeedbc5927546831646f824d5b391d5704d9109d5a4b9cca8d5aef982e45942d6af1fe9ff041502c551b46f6925f043dfa680cf30587af
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,39 @@
|
|
1
|
+
## 0.4.1
|
2
|
+
|
3
|
+
* Fixed listing counter
|
4
|
+
|
5
|
+
## 0.4.0
|
6
|
+
|
7
|
+
* deep refactoring
|
8
|
+
* tests
|
9
|
+
|
10
|
+
## 0.3.0
|
11
|
+
|
12
|
+
* fixed title in listing.
|
13
|
+
|
14
|
+
## 0.2.0
|
15
|
+
|
16
|
+
yt_video
|
17
|
+
|
1
18
|
## 0.1.0
|
2
19
|
|
3
|
-
New project were born…
|
20
|
+
New project were born…
|
21
|
+
## 2025-05-17
|
22
|
+
- 0e89167 [2025-05-17] update rake stuff (Koziolek)
|
23
|
+
- 67f3ca1 [2025-05-17] update rake stuff (Koziolek)
|
24
|
+
- 2492798 [2025-05-17] release v.0.4.1 (Koziolek)
|
25
|
+
- 732616c [2025-05-16] release v.0.4.0 (Koziolek)
|
26
|
+
- 8dfc876 [2025-05-16] Refactor and tests (Koziolek)
|
27
|
+
- 4822571 [2025-05-15] fix title (Koziolek)
|
28
|
+
- 4aa037f [2024-10-14] yt_video (Koziolek)
|
29
|
+
- cab336e [2024-10-11] init (Koziolek)
|
30
|
+
|
31
|
+
## 2025-05-17
|
32
|
+
- 0e89167 [2025-05-17] update rake stuff (Koziolek)
|
33
|
+
- 67f3ca1 [2025-05-17] update rake stuff (Koziolek)
|
34
|
+
- 2492798 [2025-05-17] release v.0.4.1 (Koziolek)
|
35
|
+
- 732616c [2025-05-16] release v.0.4.0 (Koziolek)
|
36
|
+
- 8dfc876 [2025-05-16] Refactor and tests (Koziolek)
|
37
|
+
- 4822571 [2025-05-15] fix title (Koziolek)
|
38
|
+
- 4aa037f [2024-10-14] yt_video (Koziolek)
|
39
|
+
- cab336e [2024-10-11] init (Koziolek)
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
require "rubygems/tasks"
|
3
3
|
require "bundler/gem_tasks"
|
4
4
|
require "rake/testtask"
|
5
5
|
|
@@ -10,6 +10,99 @@ Rake::TestTask.new do |t|
|
|
10
10
|
t.warning = true
|
11
11
|
end
|
12
12
|
|
13
|
+
desc "Stwórz gem, wygeneruj changelog, utwórz tag i wypchnij"
|
14
|
+
task :myrelease do
|
15
|
+
# Sprawdzenie obecności pliku .gemspec
|
16
|
+
gemspec_filename = Dir.glob("*.gemspec").first
|
17
|
+
abort("Brak pliku .gemspec!") unless gemspec_filename
|
18
|
+
|
19
|
+
# Pobierz dane gemspec (np. wersję)
|
20
|
+
gemspec = Gem::Specification.load(gemspec_filename)
|
21
|
+
gem_name = gemspec.name
|
22
|
+
gem_version = gemspec.version.to_s
|
23
|
+
|
24
|
+
# 1. Wygeneruj gem
|
25
|
+
Rake::Task[:build_gem].invoke
|
26
|
+
|
27
|
+
# 2. Wygeneruj changelog
|
28
|
+
Rake::Task[:generate_changelog].invoke
|
29
|
+
|
30
|
+
# 3. Utwórz tag gita
|
31
|
+
Rake::Task[:create_git_tag].invoke
|
32
|
+
|
33
|
+
# 4. Wypchnij tag na zdalny repozytorium
|
34
|
+
Rake::Task[:push_git_tag].invoke
|
35
|
+
|
36
|
+
# 5. Wypchnij gem na RubyGems
|
37
|
+
Rake::Task[:push_gem].invoke
|
38
|
+
|
39
|
+
# 6. Zwiększ wersję w pliku VERSION
|
40
|
+
Rake::Task[:bump_version].invoke
|
41
|
+
|
42
|
+
puts "Wersja #{gem_name} #{gem_version} została zbudowana i wydana!"
|
43
|
+
end
|
44
|
+
|
45
|
+
desc "Zbuduj gem"
|
46
|
+
task :build_gem do
|
47
|
+
puts "Tworzenie gema..."
|
48
|
+
sh "gem build #{Dir.glob("*.gemspec").first}"
|
49
|
+
end
|
50
|
+
|
51
|
+
desc "Wygeneruj changelog z git log"
|
52
|
+
task :generate_changelog do
|
53
|
+
puts "Generowanie changelog..."
|
54
|
+
changelog_content = `git log --pretty=format:"- %h [%ad] %s (%an)" --date=short`
|
55
|
+
File.open("CHANGELOG.md", "a") do |file|
|
56
|
+
file.puts "\n## #{Time.now.strftime('%Y-%m-%d')}\n"
|
57
|
+
file.puts changelog_content
|
58
|
+
end
|
59
|
+
puts "Changelog został uaktualniony."
|
60
|
+
end
|
61
|
+
|
62
|
+
desc "Utwórz tag gita z odpowiednią wersją"
|
63
|
+
task :create_git_tag do
|
64
|
+
gemspec_filename = Dir.glob("*.gemspec").first
|
65
|
+
gemspec = Gem::Specification.load(gemspec_filename)
|
66
|
+
version = gemspec.version.to_s
|
67
|
+
|
68
|
+
sh "git tag -a v#{version} -m 'Release v#{version}'"
|
69
|
+
puts "Utworzono tag v#{version}."
|
70
|
+
end
|
71
|
+
|
72
|
+
desc "Wypchnij tag na zdalny repozytorium"
|
73
|
+
task :push_git_tag do
|
74
|
+
sh "git push origin --tags"
|
75
|
+
puts "Tagi zostały wypchnięte."
|
76
|
+
end
|
77
|
+
|
78
|
+
desc "Wypchnij gem na RubyGems"
|
79
|
+
task :push_gem do
|
80
|
+
gem_file = Dir.glob("*.gem").last
|
81
|
+
abort("Brak pliku gema!") unless gem_file
|
82
|
+
|
83
|
+
sh "gem push #{gem_file}"
|
84
|
+
puts "#{gem_file} został wypchnięty na RubyGems."
|
85
|
+
end
|
86
|
+
|
87
|
+
desc "Zwiększ wersję w pliku VERSION"
|
88
|
+
task :bump_version do
|
89
|
+
version_file = "VERSION"
|
90
|
+
abort("Brak pliku VERSION!") unless File.exist?(version_file)
|
91
|
+
|
92
|
+
current_version = File.read(version_file).strip
|
93
|
+
major, minor, patch = current_version.split(".").map(&:to_i)
|
94
|
+
new_version = "#{major}.#{minor}.#{patch + 1}"
|
95
|
+
|
96
|
+
# Zapisz nową wersję do pliku
|
97
|
+
File.open(version_file, "w") { |file| file.puts new_version }
|
98
|
+
|
99
|
+
puts "Wersja została podniesiona do: #{new_version}"
|
100
|
+
|
101
|
+
# Dodaj zmiany do gita
|
102
|
+
sh "git add #{version_file}"
|
103
|
+
sh "git commit -m 'Podniesiono wersję do #{new_version}'"
|
104
|
+
end
|
105
|
+
|
13
106
|
# Domyślne zadanie: uruchom testy
|
14
107
|
task default: :test
|
15
108
|
|
@@ -45,9 +45,9 @@ module Koziolekweb
|
|
45
45
|
code_html = markdown_converter.convert(markdown_code).strip
|
46
46
|
|
47
47
|
<<~HTML
|
48
|
-
|
49
|
-
|
50
|
-
|
48
|
+
<p class='listing'> Listing #{listing_number}. #{title_html}</p>
|
49
|
+
#{code_html}
|
50
|
+
HTML
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
@@ -109,14 +109,34 @@ module Koziolekweb
|
|
109
109
|
|
110
110
|
end
|
111
111
|
|
112
|
+
# A tag that displays book information with cover image in a structured format.
|
113
|
+
#
|
114
|
+
# Usage:
|
115
|
+
# {% book "Title" "Author" "2024" "1234567890" "https://example.com/cover.jpg" %}
|
116
|
+
#
|
117
|
+
# Optional language parameter:
|
118
|
+
# {% book "Title" "Author" "2024" "1234567890" "https://example.com/cover.jpg" lang:pl %}
|
119
|
+
#
|
120
|
+
# The tag requires:
|
121
|
+
# - Title (in quotes)
|
122
|
+
# - Author (in quotes)
|
123
|
+
# - Publication year (4 digits)
|
124
|
+
# - ISBN (can be empty string)
|
125
|
+
# - Cover image URL
|
126
|
+
#
|
127
|
+
# Language support:
|
128
|
+
# - Default language is 'en'
|
129
|
+
# - Language files should be in _data/lang/[lang_code].yml
|
130
|
+
# - Language codes must be 2 letters (e.g. en, pl, de)
|
112
131
|
class Book < Liquid::Tag
|
132
|
+
# Minimum number of required arguments (title, author, year, isbn, cover_url)
|
113
133
|
MIN_ARGS = 5
|
114
134
|
|
115
135
|
def initialize(tag_name, markup, tokens)
|
116
136
|
super
|
117
137
|
|
118
138
|
args = Shellwords.split(markup)
|
119
|
-
raise Liquid::SyntaxError, "Invalid usage" if args.size <
|
139
|
+
raise Liquid::SyntaxError, "Invalid usage" if args.size < MIN_ARGS
|
120
140
|
|
121
141
|
@title, @author, @year, @isbn, @cover_url = args[0..4].map { _1.delete('"') }
|
122
142
|
|