jekyll-embeds 0.0.7 → 0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 320b373c028ca67b1e38a403ec7897b90631461da0ac9924674b3ac23b006ee4
4
- data.tar.gz: 4c346c208938bd002aca1725f1819bddf9acebbe46c98a42ec443dfcaf3b975d
3
+ metadata.gz: 53b2f85931b1283f46847a49e560d87db57a11d69f12b4eef18e14c85bbe8f9f
4
+ data.tar.gz: cabb4f3e300a982c8f83137fea118346eefa5771ece8f5c8964f90752e57a3d3
5
5
  SHA512:
6
- metadata.gz: 409b0a3df7d6557f657ed0628aed338bc3a83b983cbefe50a00b601c3214984952b2b9b12c91ab06fe794b6ac0e2439db2319e6fafb701e4cf96b4154f37a412
7
- data.tar.gz: 89164b515c36967b6bc8fb6a368899e9e8294b4137153c60fd0c5c7df94b5be1b28bd76b4f8e446d196a23b0140854cae1ab754b4c0d5640474a602a92c23584
6
+ metadata.gz: df0eda5c43746e2b5466a6e546a149c8c465e840de9b0421e815d6484e5100c1417237a66bd2f6d5b19f340318d8ac51f30ee284927725f7ab12f3e8649db651
7
+ data.tar.gz: 4bbe213f549dcf7bee0abbf95dca25fb342ccbb1f65efa21ab5538228781adf3632b74e58feaeb526e4c89aec11f18406e9a3dd1acbbab886692d01b66501d7b
@@ -4,11 +4,11 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "jekyll-embeds"
7
- spec.version = "0.0.7"
7
+ spec.version = "0.0.8"
8
8
  spec.authors = ["SEBAS204"]
9
9
 
10
10
  spec.summary = %q{Jekyll plugin for embedding diferent media elements.}
11
- spec.description = %q{Jekyll plugin to generate html snippets for embedding Youtube; VIMEO; Twitch channels, videos & clips; SoundCloud.}
11
+ spec.description = %q{Jekyll plugin to generate html snippets for embedding Youtube; VIMEO; Twitch channels, videos & clips; SoundCloud; Spotify.}
12
12
  spec.homepage = "https://github.com/ZEBAS204/Jekyll-Embeds"
13
13
  spec.license = "MIT"
14
14
 
@@ -83,15 +83,7 @@ class VimeoEmbed < Liquid::Tag
83
83
  if vimeo_url[/vimeo\.com\/([^\?]*)/]
84
84
  @vimeo_id = $1
85
85
  end
86
-
87
- tmpl_path = File.join Dir.pwd, "_includes", "vimeo.html"
88
- if File.exist?(tmpl_path)
89
- tmpl = File.read tmpl_path
90
- site = context.registers[:site]
91
- tmpl = (Liquid::Template.parse tmpl).render site.site_payload.merge!({"vimeo_id" => @vimeo_id})
92
- else
93
- %Q{<div class='embed-container'><iframe src="https://player.vimeo.com/video/#{ @vimeo_id }" frameborder="0" allowfullscreen="true" scrolling="no" height="390" width="640"></iframe></div>}
94
- end
86
+ %Q{<div class='embed-container'><iframe src="https://player.vimeo.com/video/#{@vimeo_id}" frameborder="0" allowfullscreen="true" scrolling="no" height="390" width="640"></iframe></div>}
95
87
  end
96
88
 
97
89
  Liquid::Template.register_tag "vimeo", self
@@ -108,8 +100,32 @@ class SoundCloudEmbed < Liquid::Tag
108
100
  end
109
101
 
110
102
  def render(context)
111
- %Q{<div class="embed-container"><iframe width=\"100%\" height=\"166\" scrolling=\"no\" frameborder=\"no\" src=\"//w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/#{@items[:id]}&color=%23#{@items[:color]}&auto_play=#{@items[:aplay]}&hide_related=true&show_comments=false&show_reposts=false&show_teaser=false\"></iframe></div>}
103
+ %Q{<div class="embed-container"><iframe width="100%" height="166" scrolling="no" frameborder="no" src="//w.soundcloud.com/player/?url=//api.soundcloud.com/tracks/#{@items[:id]}&color=%23#{@items[:color]}&auto_play=#{@items[:aplay]}&hide_related=true&show_comments=false&show_reposts=false&show_teaser=false"></iframe></div>}
112
104
  end
113
105
 
114
106
  Liquid::Template.register_tag "soundcloud", self
107
+ end
108
+
109
+
110
+
111
+ class SpotifyEmbed < Liquid::Tag
112
+
113
+ def initialize(tag_name, markup, tokens)
114
+ super
115
+ params = Shellwords.shellwords markup
116
+ @items = { :url => params[0] }
117
+ end
118
+
119
+ def render(context)
120
+ spotify_url = "#{@items[:url].strip}"
121
+
122
+ if spotify_url[/open\.spotify\.com\/((embed\/?)?)([^\?]*)/]
123
+ @spotify_id = $3
124
+ else
125
+ @spotify_id = "track/#{@items[:url]}"
126
+ end
127
+ %Q{<div class="embed-container"><iframe width="100%" height="166" scrolling="no" frameborder="no" src="//embed.spotify.com/?uri=#{@spotify_id}"></iframe></div>}
128
+ end
129
+
130
+ Liquid::Template.register_tag "spotify", self
115
131
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-embeds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - SEBAS204
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-01 00:00:00.000000000 Z
11
+ date: 2019-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '10.0'
55
55
  description: Jekyll plugin to generate html snippets for embedding Youtube; VIMEO;
56
- Twitch channels, videos & clips; SoundCloud.
56
+ Twitch channels, videos & clips; SoundCloud; Spotify.
57
57
  email:
58
58
  executables: []
59
59
  extensions: []