jekyll-transistor 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/transistor_sound.rb +37 -0
  3. metadata +43 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 5c16b7b7fc4d018aac494de31cdbc1a115a03dd34be8624ee71b0184b12684c4
4
+ data.tar.gz: ad26ed084b63ab7670c18350f123cfaf5cf1621efb1e1f3af8ff101526215eaa
5
+ SHA512:
6
+ metadata.gz: ecccd7af5f63bb8f200269ec860a67867a14c3e01e573d62e6ba4923087f295654dd24bb3470d0b2cdcf06dfeb124e782e5c738f4c09998296468e3c199b2b3f
7
+ data.tar.gz: 7cbf60bd0a5cd9897abb2b68784ce4aaaf0407611feef59ed809e837ac2d98626a683ca5a8248771a3ec30dfedd386ac2c2dfc7e9befcb7f5d4d637736ac0b58
@@ -0,0 +1,37 @@
1
+ # Transistor embed tag for Jekyll/Liquid
2
+ #
3
+ # Usage:
4
+ #
5
+ # {% transistor_sound 8eea9221 %}
6
+ # {% transistor_sound 8eea9221 light %}
7
+ # {% transistor_sound 8eea9221 dark %}
8
+ #
9
+ # ... where 8eea9221 is the transistor sound ID, light/dark is the color.
10
+ #
11
+ # * Requires a paid Transistor account
12
+ #
13
+ # Author: Thomas Riboulet (@mcansky)
14
+ # Source: http://github.com/mcansky/jekyll-transistor
15
+
16
+ require 'shellwords'
17
+
18
+ module Jekyll
19
+ class TransistorSoundTag < Liquid::Tag
20
+
21
+ def initialize(tag_name, markup, tokens)
22
+ super
23
+ params = Shellwords.shellwords markup
24
+ @sound = { :id => params[0], :color => params[1] || "light" }
25
+ end
26
+
27
+ def render(context)
28
+ url = "https://share.transistor.fm/e/#{@sound[:id]}"
29
+ url += "/dark" if @sound[:color] == 'dark'
30
+ "<iframe src='#{url}' width='100%' height='180' frameborder='0' scrolling='no' seamless='true' style='width:100%; height:180px;'></iframe>"
31
+ end
32
+
33
+ end
34
+
35
+ end
36
+
37
+ Liquid::Template.register_tag('transistor_sound', Jekyll::TransistorSoundTag)
metadata ADDED
@@ -0,0 +1,43 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-transistor
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Thomas Riboulet
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-05-04 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Allows to embed Transistor.fm audio bits in Jekyll pages and posts.
14
+ email: thomas@imfiny.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - transistor_sound.rb
20
+ homepage: https://git.imfiny.com/OpenSource/jekyll-transistor
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubygems_version: 3.0.3
40
+ signing_key:
41
+ specification_version: 4
42
+ summary: A transistor.fm plugin liquid tag for Jekyll
43
+ test_files: []