jekyll-sound_cloud 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 01f1d69fe72660126159c055dcefc2c7053c2f63d8a48ba0ef9e93d2f788241e
4
+ data.tar.gz: 44135506fd1a1b94b57c649285023306bcfbe76edef325ea892e1d47f864c245
5
+ SHA512:
6
+ metadata.gz: 5f6415d3063d258633f120e8b916313e212d07f83ed2d8741e2823ed5aceb162f3ecf1e1882236c96be386ec5614ff54f4841c858d3de569cc395e12f9f54aa9
7
+ data.tar.gz: cd824f8c051375795d50eca7ca285a26826614b804643b0842b8469efdcb94bd45f38001966d2617fd605a4fd8ae6c6f5397483b37989b6e2e5c89e167411585
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # Jekyll SoundCloud Plugin
2
+
3
+ A Jekyll plugin for embedding SoundCloud tracks in your Liquid templates.
4
+
5
+ ## Installation
6
+ Add this to your Gemfile and `bundle install`
7
+ ```ruby
8
+ gem 'jekyll'
9
+
10
+ group :jekyll_plugins do
11
+ gem 'jekyll-sound_cloud'
12
+ end
13
+ ```
14
+
15
+ ## Usage:
16
+ ```
17
+ {% soundcloud_sound 256241332 %}
18
+ {% soundcloud_sound 256241332 widgetname %}
19
+ {% soundcloud_sound 256241332 widgetname ffffff %}
20
+ {% soundcloud_sound 256241332 widgetname ffffff small %}
21
+ ```
22
+ `256241332` is a sample SoundCloud trackID, `widgetname` is the sound's visual representation, `ffffff` is the `color`, and `size` is the size (SoundCloud gives you three options for the artwork widget).
23
+
24
+ ### Available SoundCloud widgets:
25
+
26
+ * html5 (default)
27
+ * *flash
28
+ * *mini
29
+ * *artwork
30
+
31
+ *Requires a paid SoundCloud tier
32
+
33
+ ### Contributors
34
+ * @cnunciato -- original repository [here](https://github.com/cnunciato/jekyll-soundcloud)
35
+ * @shushugah
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Jekyll
4
+ module SoundCloud
5
+ VERSION = '0.1.0'.freeze
6
+ end
7
+ end
@@ -0,0 +1,52 @@
1
+ require 'shellwords'
2
+ # require 'jekyll/sound_cloud/version'
3
+
4
+ module Jekyll
5
+ module SoundCloud
6
+ class SoundCloudTag < Liquid::Tag
7
+ BASE_URL= "https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F".freeze
8
+
9
+ def initialize(tag_name, markup, tokens)
10
+ super
11
+ params = Shellwords.shellwords markup
12
+ @sound = { :id => params[0], :widget => params[1] || 'html5', :color => params[2] || 'ff7700', :size => params[3] || 'medium' }
13
+ end
14
+
15
+ def render(context)
16
+ case @sound[:widget]
17
+
18
+ when 'html5'
19
+ "<iframe width='100%' height='166' scrolling='no' frameborder='no' src='http://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F#{@sound[:id]}&show_artwork=true'></iframe>"
20
+ when 'flash'
21
+ "<object height='81' width='100%'><param name='movie' value='#{BASE_URL + @sound[:id]}&amp;show_comments=false&amp;auto_play=false&amp;color=#{@sound[:color]}'></param><param name='allowscriptaccess' value='always'></param><embed allowscriptaccess='always' height='81' src='#{BASE_URL + @sound[:id]}&amp;show_comments=false&amp;auto_play=false&amp;color=#{@sound[:color]}' type='application/x-shockwave-flash' width='100%'></embed></object>"
22
+ when "mini"
23
+ "<object height='18' width='100%'><param name='movie' value='#{BASE_URL + @sound[:id]}&amp;auto_play=false&amp;player_type=tiny&amp;font=Arial&amp;color=#{@sound[:color]}'></param> <param name='allowscriptaccess' value='always'></param> <param name='wmode' value='transparent'></param><embed wmode='transparent' allowscriptaccess='always' height='18' src='#{BASE_URL + @sound[:id]}&amp;auto_play=false&amp;player_type=tiny&amp;font=Arial&amp;color=#{@sound[:color]}' type='application/x-shockwave-flash' width='100%'></embed></object>"
24
+ when "artwork"
25
+ "<object height='#{dimension}' width='#{dimension}'><param name='movie' value='#{BASE_URL + @sound[:id]}&amp;auto_play=false&amp;player_type=artwork&amp;color=#{@sound[:color]}'></param><param name='allowscriptaccess' value='always'></param><embed allowscriptaccess='always' height='220' src='#{BASE_URL + @sound[:id]}&amp;auto_play=false&amp;player_type=artwork&amp;color=#{@sound[:color]}' type='application/x-shockwave-flash' width='220'></embed></object>"
26
+ when "playlist"
27
+ "<iframe width='100%' height='450' scrolling='no' frameborder='no' src='#{BASE_URL + @sound[:id]}&amp;color=%23ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;show_teaser=true'></iframe>"
28
+ else
29
+ ''
30
+ end
31
+ end
32
+
33
+ private
34
+
35
+ def dimension(size)
36
+ case @sound[:size]
37
+
38
+ when 'small'
39
+ 220
40
+ when 'medium'
41
+ 300
42
+ when 'large'
43
+ 425
44
+ else
45
+ 0
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+
52
+ Liquid::Template.register_tag('soundcloud', Jekyll::SoundCloud::SoundCloudTag)
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "jekyll/sound_cloud"
metadata ADDED
@@ -0,0 +1,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-sound_cloud
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Chris Nunciato, Yonatan Miller
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-01-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jekyll
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.6'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '11.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '11.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.5'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.41'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.41'
69
+ description: Jekyll plugin adds Liquid Tag for generating embedded Soundcloud iframes
70
+ email:
71
+ - yonatan.miller@shushugah.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - Gemfile
77
+ - README.md
78
+ - lib/jekyll-sound_cloud.rb
79
+ - lib/jekyll/sound_cloud.rb
80
+ - lib/jekyll/sound_cloud/version.rb
81
+ homepage: https://github.com/shushugah/jekyll-sound_cloud-plugin
82
+ licenses:
83
+ - MIT
84
+ metadata: {}
85
+ post_install_message:
86
+ rdoc_options: []
87
+ require_paths:
88
+ - lib
89
+ required_ruby_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ required_rubygems_version: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ requirements: []
100
+ rubygems_version: 3.0.2
101
+ signing_key:
102
+ specification_version: 4
103
+ summary: Jekyll SoundCloud integration
104
+ test_files: []