jektify 1.0.7 → 1.0.8
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/.bundle/config +3 -0
- data/.github/workflows/ruby.yml +10 -21
- data/.gitignore +10 -28
- data/CHANGELOG.md +10 -1
- data/Gemfile.lock +198 -0
- data/LICENSE +1 -1
- data/README.md +2 -32
- data/_config.yml +315 -0
- data/assets/vendor/jektify/js/jektify.min.js +1 -1
- data/assets/vendor/jektify/sass/_jektify.scss +5 -19
- data/bin/setup +3 -0
- data/bin/tests +9 -79
- data/example/.bundle/config +3 -0
- data/example/.gitignore +5 -0
- data/example/Gemfile +11 -0
- data/example/Gemfile.lock +181 -0
- data/example/_config.yml +43 -0
- data/example/_includes/head.html +6 -0
- data/example/_layouts/default.html +22 -0
- data/example/_layouts/home.html +36 -0
- data/example/_layouts/post.html +27 -0
- data/example/_posts/2025-09-19-welcome-to-jektify.markdown +12 -0
- data/example/_sass/_reset.scss +24 -0
- data/example/_sass/main.scss +2 -0
- data/example/assets/jquery.min.js +2 -0
- data/example/assets/style.scss +4 -0
- data/example/index.markdown +3 -0
- data/gulpfile.js +11 -17
- data/jektify.gemspec +6 -6
- data/lib/jektify/engine.rb +24 -26
- data/lib/jektify/main.rb +61 -86
- data/lib/jektify/render.rb +50 -76
- data/lib/jektify/version.rb +1 -1
- data/package-lock.json +2057 -0
- data/src/js/jektify.js +30 -6
- metadata +37 -36
- data/.travis.yml +0 -12
data/lib/jektify/render.rb
CHANGED
|
@@ -1,85 +1,59 @@
|
|
|
1
1
|
module Jektify
|
|
2
|
-
|
|
3
2
|
class Render
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
jektify__toggle_button = "" if !app_root_config["toggle"].nil? && app_root_config["toggle"]["enable"] == false
|
|
35
|
-
|
|
36
|
-
# This is a feature for adding a Spotify user link. Version 3.0.1
|
|
37
|
-
# NOTe: If the user uses the previous version of the "_config.yml" file, there will be no conflict.
|
|
38
|
-
if app_root_config["spotify"].nil?
|
|
39
|
-
jektify__spotify_user = ""
|
|
40
|
-
else
|
|
41
|
-
jektify__spotify_user = "<div class=\"jektify__user\"><a href=\"https://open.spotify.com/user/#{app_root_config["spotify"]["user"]}\" target=\"_blank\" class=\"jektify__user-link jektify__user-link--#{spotify_embed_theme} jektify__user-link--custom\" title=\"#{app_root_config["spotify"]["text"]}\"><span class=\"jektify__user-text jektify__user-text--#{spotify_embed_theme} jektify__user-text--custom\">#{app_root_config["spotify"]["text"]}</span></a></div>" if !app_root_config["spotify"]["user"].nil? && !app_root_config["spotify"]["text"].nil?
|
|
3
|
+
$DATETIME = Time.now
|
|
4
|
+
|
|
5
|
+
def rendering(app_name, app_root_config, category, url, theme)
|
|
6
|
+
jektify_title = app_root_config.dig("title", "enable") ? "block" : "none"
|
|
7
|
+
jektify_description = app_root_config.dig("description", "enable") ? "block" : "none"
|
|
8
|
+
box_height = %w[album playlist artist].include?(category) ? 380 : 80
|
|
9
|
+
open_track = app_root_config["open"] ? "block" : "none"
|
|
10
|
+
button_action = app_root_config["open"] ? "jektify__button--open" : "jektify__button--closed"
|
|
11
|
+
|
|
12
|
+
toggle_button = if app_root_config.dig("toggle", "enable").nil? || app_root_config.dig("toggle", "enable")
|
|
13
|
+
"<span class=\"jektify__button jektify__button--#{theme} jektify__button--custom #{button_action}\">+</span>"
|
|
14
|
+
else
|
|
15
|
+
""
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
open_track = "block" if app_root_config.dig("toggle", "enable") == false
|
|
19
|
+
|
|
20
|
+
spotify_user_html = ""
|
|
21
|
+
if app_root_config["spotify"]
|
|
22
|
+
user = app_root_config["spotify"]["user"]
|
|
23
|
+
text = app_root_config["spotify"]["text"]
|
|
24
|
+
if user && text
|
|
25
|
+
spotify_user_html = <<~HTML
|
|
26
|
+
<div class="jektify__user">
|
|
27
|
+
<a href="https://open.spotify.com/user/#{user}" target="_blank" class="jektify__user-link jektify__user-link--#{theme} jektify__user-link--custom" title="#{text}">
|
|
28
|
+
<span class="jektify__user-text jektify__user-text--#{theme} jektify__user-text--custom">#{text}</span>
|
|
29
|
+
</a>
|
|
30
|
+
</div>
|
|
31
|
+
HTML
|
|
32
|
+
end
|
|
42
33
|
end
|
|
43
34
|
|
|
44
|
-
|
|
45
|
-
# Render template if enable == true
|
|
46
|
-
if app_root_config["enable"] == true
|
|
47
|
-
%(<dl class="jektify jektify--#{spotify_embed_theme} jektify--custom">
|
|
48
|
-
|
|
49
|
-
<dt class="jektify__header jektify__header--#{spotify_embed_theme} jektify__header--custom">
|
|
50
|
-
|
|
51
|
-
<a class="jektify__brand jektify__brand--#{spotify_embed_theme} jektify__brand--custom" href="https://#{app_name}.github.io" target="_blank">#{app_name}</a>
|
|
35
|
+
return unless app_root_config["enable"]
|
|
52
36
|
|
|
53
|
-
|
|
54
|
-
|
|
37
|
+
<<~HTML
|
|
38
|
+
<dl class="jektify jektify--#{theme} jektify--custom">
|
|
39
|
+
<dt class="jektify__header jektify__header--#{theme} jektify__header--custom">
|
|
40
|
+
<a class="jektify__brand jektify__brand--#{theme} jektify__brand--custom" href="https://#{app_name}.github.io" target="_blank">#{app_name}</a>
|
|
41
|
+
<i class="jektify__year jektify__year--#{theme} jektify__year--custom">© #{$DATETIME.year} </i>
|
|
42
|
+
#{toggle_button}
|
|
55
43
|
</dt>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
#{
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<div class="jektify__tracklist jektify__tracklist--#{spotify_embed_theme} jektify__tracklist--custom">
|
|
66
|
-
<iframe id="jektify__track"
|
|
67
|
-
class="jektify__track jektify__track--#{spotify_embed_theme}
|
|
68
|
-
jektify__track--custom"
|
|
69
|
-
src="#{spotify_embed_url}"
|
|
70
|
-
width="100%"
|
|
71
|
-
height="#{box_height}"
|
|
72
|
-
frameborder="0"
|
|
73
|
-
allowtransparency="true"
|
|
74
|
-
allow="encrypted-media">
|
|
44
|
+
<dd class="jektify__body jektify__body--#{theme} jektify__body--custom" style="display: #{open_track}">
|
|
45
|
+
#{spotify_user_html}
|
|
46
|
+
<h1 class="jektify__title jektify__title--#{theme} jektify__title--custom" style="display: #{jektify_title};">#{app_root_config.dig("title", "text")}</h1>
|
|
47
|
+
<p class="jektify__description jektify__description--#{theme} jektify__description--custom" style="display: #{jektify_description};">#{app_root_config.dig("description", "text")}</p>
|
|
48
|
+
<div class="jektify__tracklist jektify__tracklist--#{theme} jektify__tracklist--custom">
|
|
49
|
+
<iframe id="jektify__track" class="jektify__track jektify__track--#{theme} jektify__track--custom"
|
|
50
|
+
src="#{url}" width="100%" height="#{box_height}" frameborder="0"
|
|
51
|
+
allowtransparency="true" allow="encrypted-media">
|
|
75
52
|
</iframe>
|
|
76
53
|
</div>
|
|
77
54
|
</dd>
|
|
78
|
-
</dl>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
end # class Render
|
|
84
|
-
|
|
85
|
-
end # module Jektify
|
|
55
|
+
</dl>
|
|
56
|
+
HTML
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|