liquid-audio-tag 1.0.0

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/liquid-audio-tag.rb +37 -0
  3. metadata +45 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 21a37261bc1b1e2142bca6207f1ca4a289021124
4
+ data.tar.gz: c1e25924112f626718142781b0750f556b5b72b4
5
+ SHA512:
6
+ metadata.gz: 49800534d77d57b23bc81784b299dc4f7652d4aee263d05b7d93c74e300146981f76668eac0cf5b310394f3f7f15cc036a58f5807e8b555c73b018d6b3394609
7
+ data.tar.gz: 7f6bb088c11d2698fe3ed6ae1b04e38edf6973edbdd2830355e655ffa4070b2349273ee9c037721a734d3c860fcb5956fc2cd2ac46fb394b841fa2ad29789ab3
@@ -0,0 +1,37 @@
1
+ # Title:
2
+ # Octopress HTML5 Audio Tag
3
+ # http://antoncherkasov.me/projects/octopress-plugins
4
+ # Author:
5
+ # Anton Cherkasov
6
+ # http://antoncherkasov.me
7
+ # antoncherkasov@me.com
8
+ # Syntax:
9
+ # {% audio url/to/mp3 %}
10
+ # {% audio url/to/mp3 url/to/ogg %}
11
+ # Example:
12
+ # {% audio http://example.org/music.mp3 http://example.org/music.ogg %}
13
+ # Output:
14
+ # <audio controls><source src="http://example.org/music.mp3"><source src="http://example.org/music.org"></audio>
15
+
16
+ module Jekyll
17
+ class AudioTag < Liquid::Tag
18
+ @audio = nil
19
+
20
+ def initialize(tag_name, markup, tokens)
21
+ @files = markup
22
+ super
23
+ end
24
+
25
+ def render(context)
26
+ output = super
27
+ audio = "<audio controls>"
28
+ @files.each_line(' ') do |file|
29
+ audio += "<source src='#{file[0...-1]}'>"
30
+ end
31
+ audio += "</audio>"
32
+ end
33
+ end
34
+ end
35
+
36
+ Liquid::Template.register_tag('audio', Jekyll::AudioTag)
37
+
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: liquid-audio-tag
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Anton Cherkasov, Tom Müller
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-10-18 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: 'I took Anton''s plugin and turned it into a gem to be able to use it
14
+ in github-pages. Still needs audio.js! See: http://blog.micronarrativ.org/blog/2012/09/06/wordpress-til-octopress-audio/'
15
+ email: kontakt@tommueller.me
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/liquid-audio-tag.rb
21
+ homepage: https://gist.github.com/HKLF4/3487038
22
+ licenses:
23
+ - MIT
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 2.5.1
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: Adds support for {% audio /path/to/file.mp3 %} to liquid.
45
+ test_files: []