jekyll-octopod 0.9.13 → 0.9.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f36ab4f125eedb8ab2944b68ae35060b6e38fa3ee40c3a3f9b5000dfd35ed045
4
- data.tar.gz: 2f4c2dd4e4303815081c4dcc3c567e6bb2f1bc7c5bee40546c642d03ee0ef775
3
+ metadata.gz: b7269818a8369249ba866e41eae32e5185151870236d187008b23c2201f0b52c
4
+ data.tar.gz: 26f2e263a571f7685d9ffe91124405e6ae2e130d17da5badb17e0d89e1157bfb
5
5
  SHA512:
6
- metadata.gz: 245b40715a94b7cc887d1b57b67cf57eb8c7307caca1f6d2fc44579e47174a2e25f9401bbf0f96da0a32e58c8f0cd0f76e0f4d8fd5f48026a189e503ef65b062
7
- data.tar.gz: 153407bde19114e7a120122df243d0288abb438d5bf24c2db17f7de3b7eb2f843309f75a100cfbc099c1d7f098e52ec4058112ea061147b9babd180434e4cc76
6
+ metadata.gz: 7b43b3c1e8c39ed3916325a14a8281dcc0095c3ee7b8d85c8e00a9b7d7af94d5a62b128a4032072a9d1d32f990dff1bd1ab5be36186f12d4a0a35d3df7388550
7
+ data.tar.gz: a26627d73215bce30e851840512c2f420d13dd52f3533ba98ff77c5f92572e608c52bff971fd51669ada08712fc7ff99db1a754f6581c526d7cd7d1ddfa62832
@@ -10,7 +10,7 @@
10
10
  {% for file in post.audio %}
11
11
  {% if post.filesize %}
12
12
  <a class="btn btn-info"
13
- href="{{ site | download_url_with_fallback }}/{{ file.last }}">Download .{{ file.first }} ({{ post | size_by_format: file.first | in_kilobytes }})</a>
13
+ href="{{ site | download_url_with_fallback }}/{{ file.last }}">Download .{{ file.first }} ({{ post | size_by_format: file.first | in_megabytes }})</a>
14
14
  {% else %}
15
15
  <a class="btn btn-info"
16
16
  href="{{ site | download_url_with_fallback }}/{{ file.last }}">Download .{{ file.first }} ({{ file.last | file_size:'./' | string_of_size }})</a>
@@ -28,12 +28,10 @@ layout: null
28
28
  length="{{ post.filesize[file.first] }}"
29
29
  href="{{ site.url }}/episodes/{{ file.last }}"/>
30
30
  {% else %}
31
- {% comment %}
32
31
  <link rel="enclosure"
33
32
  type="{{ file.first | mime_type }}"
34
33
  length="{{ file.last | file_size }}"
35
34
  href="{{ site.url }}/episodes/{{ file.last }}"/>
36
- {% endcomment %}
37
35
  {% endif %}
38
36
  {% endfor %}
39
37
  {{ site | flattr_atom:post }}
@@ -102,11 +102,21 @@ module Jekyll
102
102
  File.size(path)
103
103
  end
104
104
 
105
+ # Returns the size of a given file in bytes by looking into the front matter
106
+ # The sizes should be in
107
+ # filesize:
108
+ # mp3: 4242
109
+ # ...
110
+ #
111
+ # {{ "example.m4a" | size_by_format: "mp3" }} => 4242
105
112
  def size_by_format(page, format)
106
113
  page["filesize"][format]
107
114
  end
108
115
 
109
- def in_kilobytes(size_in_bytes)
116
+ # Converts a size in Bytes to Megabytes
117
+ #
118
+ # {{ 123456 | in_megabytes }} => 0.1 MB
119
+ def in_megabytes(size_in_bytes)
110
120
  (size_in_bytes / 1024.0 / 1024.0).round(2).to_s + " MB"
111
121
  end
112
122
 
@@ -3,7 +3,7 @@ module Jekyll
3
3
  module VERSION #:nodoc:
4
4
  MAJOR = 0
5
5
  MINOR = 9
6
- TINY = 13
6
+ TINY = 14
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY].join('.')
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-octopod
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.13
4
+ version: 0.9.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arne Eilermann