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 +4 -4
- data/assets/_includes/post.html +1 -1
- data/assets/general_feed.xml +0 -2
- data/lib/jekyll/octopod_filters.rb +11 -1
- data/lib/octopod/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7269818a8369249ba866e41eae32e5185151870236d187008b23c2201f0b52c
|
4
|
+
data.tar.gz: 26f2e263a571f7685d9ffe91124405e6ae2e130d17da5badb17e0d89e1157bfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b43b3c1e8c39ed3916325a14a8281dcc0095c3ee7b8d85c8e00a9b7d7af94d5a62b128a4032072a9d1d32f990dff1bd1ab5be36186f12d4a0a35d3df7388550
|
7
|
+
data.tar.gz: a26627d73215bce30e851840512c2f420d13dd52f3533ba98ff77c5f92572e608c52bff971fd51669ada08712fc7ff99db1a754f6581c526d7cd7d1ddfa62832
|
data/assets/_includes/post.html
CHANGED
@@ -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 |
|
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>
|
data/assets/general_feed.xml
CHANGED
@@ -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
|
-
|
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
|
|
data/lib/octopod/version.rb
CHANGED