fix lib file for rubocop

trunk
Thomas Riboulet 4 years ago
parent d91525c1a0
commit 118008c9f8

@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'jekyll-transistor'
s.version = '0.0.3'
s.version = '0.0.4'
s.date = '2020-05-04'
s.summary = "A transistor.fm plugin liquid tag for Jekyll"
s.description = "Allows to embed Transistor.fm audio bits in Jekyll pages and posts."

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Transistor embed tag for Jekyll/Liquid
#
# Usage:
@ -16,22 +18,22 @@
require 'shellwords'
module Jekyll
# Transistor sound tag for Jekyll
class TransistorSoundTag < Liquid::Tag
def initialize(tag_name, markup, tokens)
super
params = Shellwords.shellwords markup
@sound = { :id => params[0], :color => params[1] || "light" }
@sound = { id: params[0], color: params[1] || 'light' }
end
def render(context)
def render(_context)
url = "https://share.transistor.fm/e/#{@sound[:id]}"
url += "/dark" if @sound[:color] == 'dark'
"<iframe src='#{url}' width='100%' height='180' frameborder='0' scrolling='no' seamless='true' style='width:100%; height:180px;'></iframe>"
url += '/dark' if @sound[:color] == 'dark'
"<iframe src='#{url}' width='100%' height='180' frameborder='0' "\
"scrolling='no' seamless='true' style='width:100%; height:180px;'>"\
'</iframe>'
end
end
end
Liquid::Template.register_tag('transistor_sound', Jekyll::TransistorSoundTag)

Loading…
Cancel
Save