jekyll-octopod 0.9.12 → 0.9.13

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9289c490f1a440ed7971c14c1cdfabbc17a034cdd396d36e464b489bc4a8a718
4
- data.tar.gz: efd5f19905034f9ff861e426b50036b735af36b62e5e0859963ea94fe6640ff9
3
+ metadata.gz: f36ab4f125eedb8ab2944b68ae35060b6e38fa3ee40c3a3f9b5000dfd35ed045
4
+ data.tar.gz: 2f4c2dd4e4303815081c4dcc3c567e6bb2f1bc7c5bee40546c642d03ee0ef775
5
5
  SHA512:
6
- metadata.gz: 69687c854cb7a116de5d57db2e56d4f541c50f946a68b5e43a487bdc65f328ace80f8f5598d77370e8eb57766452b5361b1d2434e2152abde7f26c989bac3832
7
- data.tar.gz: '08beb893b83dc7d0a315a327cb6eba8fdd00579daa88d2420204a1993a158a10e1d1feafe5b3db76d2abb8468d667a085bbc1096f1cdd280762241bf3d06511d'
6
+ metadata.gz: 245b40715a94b7cc887d1b57b67cf57eb8c7307caca1f6d2fc44579e47174a2e25f9401bbf0f96da0a32e58c8f0cd0f76e0f4d8fd5f48026a189e503ef65b062
7
+ data.tar.gz: 153407bde19114e7a120122df243d0288abb438d5bf24c2db17f7de3b7eb2f843309f75a100cfbc099c1d7f098e52ec4058112ea061147b9babd180434e4cc76
@@ -8,7 +8,13 @@
8
8
  {{ post.content }}
9
9
  {% if post.audio %}
10
10
  {% for file in post.audio %}
11
- <a class="btn btn-info" href="{{ site | download_url_with_fallback }}/{{ file.last }}">Download .{{ file.first }} ({{ file.last | file_size:'./' | string_of_size }})</a>
11
+ {% if post.filesize %}
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>
14
+ {% else %}
15
+ <a class="btn btn-info"
16
+ href="{{ site | download_url_with_fallback }}/{{ file.last }}">Download .{{ file.first }} ({{ file.last | file_size:'./' | string_of_size }})</a>
17
+ {% endif %}
12
18
  {% endfor %}
13
19
  {% endif %}
14
20
  <hr>
@@ -45,15 +45,15 @@ layout: null
45
45
  {% for category in site.itunes_categories %}
46
46
  <itunes:category text="{{ category | xml_escape }}" />
47
47
  {% endfor %}
48
- {% if site.download_url == "" or site.download_url == nil %}
48
+ {%- if site.download_url == "" or site.download_url == nil -%}
49
49
  {% assign download_url = site.url | append: '/episodes' %}
50
- {% else %}
50
+ {%- else -%}
51
51
  {% assign download_url = site.download_url %}
52
52
  {% endif %}
53
- {% for post in site.posts %}
54
- {% if post.audio[page.format] %}
55
- {% assign check = forloop.index0 | divided_by:site.episodes_per_feed_page | plus: 1 %}
56
- {% if check == page.page_number %}
53
+ {%- for post in site.posts -%}
54
+ {%- if post.audio[page.format] -%}
55
+ {%- assign check = forloop.index0 | divided_by:site.episodes_per_feed_page | plus: 1 -%}
56
+ {%- if check == page.page_number -%}
57
57
  <item>
58
58
  <title>{{ post.title }} - {{ post.subtitle }}</title>
59
59
  <link>{{ site.url }}{{ post.url }}</link>
@@ -67,7 +67,15 @@ layout: null
67
67
  <description><![CDATA[{{ post.content | expand_urls: site.url | cdata_escape | remove_script_and_audio }}]]></description>
68
68
  <content:encoded><![CDATA[{{ post.content | expand_urls: site.url | cdata_escape | remove_script_and_audio }}]]></content:encoded>
69
69
  {% assign url = download_url | append: '/' | append: post.audio[page.format] %}
70
- <enclosure url="{{ url }}" length="{{ post.audio | audio:page.format | file_size }}" type="{{ page.format | mime_type }}" />
70
+ {%- if post.filesize -%}
71
+ <enclosure url="{{ url }}"
72
+ length="{{ post | size_by_format: page.format }}"
73
+ type="{{ page.format | mime_type }}" />
74
+ {%- else -%}
75
+ <enclosure url="{{ url }}"
76
+ length="{{ post.audio | audio:page.format | file_size }}"
77
+ type="{{ page.format | mime_type }}" />
78
+ {% endif %}
71
79
  <itunes:keywords>{{ post.tags }}</itunes:keywords>
72
80
  <itunes:subtitle>{{ post.subtitle }}</itunes:subtitle>
73
81
  <itunes:summary>{{ post.summary }}</itunes:summary>
@@ -75,33 +83,33 @@ layout: null
75
83
  <itunes:explicit>{{ post.explicit | otherwise:site.explicit }}</itunes:explicit>
76
84
  <itunes:duration>{{ post.duration }}</itunes:duration>
77
85
  {{ site | flattr_rss:post }}
78
- {% if post.chapters %}
86
+ {%- if post.chapters -%}
79
87
  <psc:chapters version="1.1" xmlns:psc="http://podlove.org/simple-chapters">
80
- {% for chapter in post.chapters %}
88
+ {%- for chapter in post.chapters -%}
81
89
  <psc:chapter start="{{ chapter | split_chapter:'start' }}" title="{{ chapter | split_chapter:'title' }}" />
82
90
  {% endfor %}
83
91
  </psc:chapters>
84
- {% endif %}
85
- {% if post.contributors %}
86
- {% for contributor in post.contributors %}
92
+ {%- endif -%}
93
+ {%- if post.contributors -%}
94
+ {%- for contributor in post.contributors -%}
87
95
  <atom:contributor>
88
96
  <atom:name>{{ contributor.name}}</atom:name>
89
97
  <atom:uri>{{ contributor.uri}}</atom:uri>
90
98
  <atom:email>{{ contributor.email}}</atom:email>
91
99
  </atom:contributor>
92
- {% endfor %}
93
- {% endif %}
94
- {% if post.image %}
100
+ {%- endfor -%}
101
+ {%- endif -%}
102
+ {%- if post.image -%}
95
103
  <itunes:image href="{{ site.url }}/img/{{post.image}}" />
96
104
  <image>
97
105
  <title>{{ post.image_title }}</title>
98
106
  <url>{{ site.url }}/img/{{post.image}}</url>
99
107
  <link>{{ site.url }}</link>
100
108
  </image>
101
- {% endif %}
109
+ {%- endif -%}
102
110
  </item>
103
- {% endif %}
104
- {% endif %}
105
- {% endfor %}
111
+ {%- endif -%}
112
+ {%- endif -%}
113
+ {%- endfor -%}
106
114
  </channel>
107
115
  </rss>
@@ -34,7 +34,11 @@ layout: null
34
34
  "attachments": [
35
35
  {"url": "{{ url }}",
36
36
  "mime_type": "audio/mpeg",
37
+ {%- if post.filesize -%}
38
+ "size_in_bytes": "{{ post | size_by_format: page.format }}"
39
+ {%- else -%}
37
40
  "size_in_bytes": "{{ post.audio | audio:mp3 | file_size }}"
41
+ {%- endif -%}
38
42
  }
39
43
  ],{% endif %}
40
44
  "date_published": "{{ post.date | date_to_xmlschema }}",
@@ -22,7 +22,19 @@ layout: null
22
22
  <id>{{ site.url }}{{ post.id }}</id>
23
23
  <content type="html">{{ post.content | xml_escape }}</content>
24
24
  {% for file in post.audio %}
25
- <link rel="enclosure" type="{{ file.first | mime_type }}" length="{{ file.last | file_size }}" href="{{ site.url }}/episodes/{{ file.last }}"/>
25
+ {% if post.filesize %}
26
+ <link rel="enclosure"
27
+ type="{{ file.first | mime_type }}"
28
+ length="{{ post.filesize[file.first] }}"
29
+ href="{{ site.url }}/episodes/{{ file.last }}"/>
30
+ {% else %}
31
+ {% comment %}
32
+ <link rel="enclosure"
33
+ type="{{ file.first | mime_type }}"
34
+ length="{{ file.last | file_size }}"
35
+ href="{{ site.url }}/episodes/{{ file.last }}"/>
36
+ {% endcomment %}
37
+ {% endif %}
26
38
  {% endfor %}
27
39
  {{ site | flattr_atom:post }}
28
40
  </entry>
@@ -64,7 +64,6 @@ module Jekyll
64
64
  end
65
65
  end
66
66
 
67
-
68
67
  # Returns the audio-type of a given hash. Is no key as second parameter given, it
69
68
  # trys first "mp3", than "m4a" and than it will return a more or less random
70
69
  # value.
@@ -103,6 +102,14 @@ module Jekyll
103
102
  File.size(path)
104
103
  end
105
104
 
105
+ def size_by_format(page, format)
106
+ page["filesize"][format]
107
+ end
108
+
109
+ def in_kilobytes(size_in_bytes)
110
+ (size_in_bytes / 1024.0 / 1024.0).round(2).to_s + " MB"
111
+ end
112
+
106
113
  # Returns a slug based on the id of a given page.
107
114
  #
108
115
  # {{ page | slug }} => '2012_10_02_octopod'
@@ -3,7 +3,7 @@ module Jekyll
3
3
  module VERSION #:nodoc:
4
4
  MAJOR = 0
5
5
  MINOR = 9
6
- TINY = 12
6
+ TINY = 13
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.12
4
+ version: 0.9.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arne Eilermann
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-01-18 00:00:00.000000000 Z
12
+ date: 2020-03-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: facets
@@ -322,8 +322,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
322
322
  - !ruby/object:Gem::Version
323
323
  version: '0'
324
324
  requirements: []
325
- rubyforge_project: jekyll-
326
- rubygems_version: 2.7.7
325
+ rubygems_version: 3.1.2
327
326
  signing_key:
328
327
  specification_version: 4
329
328
  summary: Podcasting Publishing Extension for Jekyll