jekyll-octopod 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +29 -8
- data/Rakefile +2 -1
- data/bin/octopod +250 -0
- data/lib/jekyll/octopod/version.rb +1 -1
- metadata +20 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43b02c09d5031f84ac5bf63449f516169a90a1b7
|
4
|
+
data.tar.gz: 3040b8706f3214479476516e90f60fbd46b1832b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa90cd3b533527b3b373097af3a7b7aa53a662288f4a761ae4c08ddf5698d606cd761b41704218b203f8c983cbcbd7ced45bb74d0a4ff76559f65117edb4b816
|
7
|
+
data.tar.gz: 56d1217779413bfbb40ea2e8d78d32edcaf9e48ed5c3fb25088a8bb417e2f3dfe48ef6bc83ee2c05bd401db00bf66cb8fe35b925893ee0d9b62f9eec205e8a95
|
data/README.rdoc
CHANGED
@@ -4,11 +4,26 @@ Podcasting publishing extension for Jekyll
|
|
4
4
|
|
5
5
|
== Installation
|
6
6
|
|
7
|
-
$ gem install jekyll
|
7
|
+
$ gem install jekyll
|
8
|
+
$ jekyll new name-of-my-podcast
|
9
|
+
$ cd name-of-my-podcast
|
10
|
+
|
11
|
+
Create file Gemfile with the contents:
|
12
|
+
|
13
|
+
source 'http://rubygems.org'
|
14
|
+
gem 'jekyll-octopod'
|
15
|
+
|
16
|
+
Install the dependencies and run the setup script via:
|
17
|
+
|
18
|
+
$ bundle install
|
19
|
+
$ octopod setup
|
20
|
+
|
8
21
|
|
9
22
|
== Usage
|
10
23
|
|
11
|
-
|
24
|
+
FIXME! Confiruration File.
|
25
|
+
FIXME! You might want to change the images and logos in ...
|
26
|
+
FIXME! You might want to delete the demo episode files
|
12
27
|
|
13
28
|
== Contributions
|
14
29
|
|
@@ -18,18 +33,24 @@ are welcomed!
|
|
18
33
|
|
19
34
|
Stefan Haslinger <mailto:stefan.haslinger@informatom.com>
|
20
35
|
|
36
|
+
Based on octopod by Arne Eilermann <mailto: arne@kleinerdrei.org>
|
37
|
+
|
21
38
|
|
22
39
|
== Credits
|
23
40
|
|
24
41
|
This Gem is sitting on the shoulder of giants, lots of the code was not written by me and/or depends on other code.
|
42
|
+
|
25
43
|
Especially to be mentioned: Arne Eilermann eilermann@lavabit.com from Octopod https://github.com/pattex/octopod
|
26
44
|
|
27
45
|
== License
|
28
46
|
|
29
|
-
|
30
|
-
|
31
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
32
|
-
|
33
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
47
|
+
Missing: Link to MIT -License
|
34
48
|
|
35
|
-
|
49
|
+
* Glyphicons
|
50
|
+
* Font Awesome
|
51
|
+
* Podlove Webplayer
|
52
|
+
* Bootflat
|
53
|
+
* Bootstrap
|
54
|
+
* iCheck v1.0.1 by Damir Sultanov, http://git.io/arlzeA, MIT License
|
55
|
+
* JQuery
|
56
|
+
* Demo Audio
|
data/Rakefile
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'rake/testtask'
|
2
|
+
require "bundler/gem_tasks"
|
2
3
|
|
3
4
|
task :default => [:test]
|
4
5
|
|
@@ -7,4 +8,4 @@ Rake::TestTask.new(:test) do |t|
|
|
7
8
|
t.pattern = 'test/all.rb'
|
8
9
|
t.verbose = true
|
9
10
|
end
|
10
|
-
Rake::Task['test'].comment = "Run all tests"
|
11
|
+
Rake::Task['test'].comment = "Run all tests"
|
data/bin/octopod
ADDED
@@ -0,0 +1,250 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "byebug"
|
3
|
+
PWD = Dir.pwd
|
4
|
+
GEM_DIR = Gem::Specification.find_by_name("jekyll-octopod").gem_dir
|
5
|
+
|
6
|
+
require 'rubygems'
|
7
|
+
require 'optparse'
|
8
|
+
require 'yaml'
|
9
|
+
|
10
|
+
octopod_help = <<HELP
|
11
|
+
Octopod - podcast publishing for geeks
|
12
|
+
|
13
|
+
Basic Command Line Usage:
|
14
|
+
Standard Jekyll commands:
|
15
|
+
octopod # . -> ./_site
|
16
|
+
octopod <path to write generated site> # . -> <path>
|
17
|
+
octopod <path to source> <path to write generated site> # <path> -> <path>
|
18
|
+
octopod import <importer name> <options> # imports posts using named import script
|
19
|
+
octopod setup # Setup blog to become podcast-aware, copy assets and default config
|
20
|
+
|
21
|
+
Additional Octopod commands:
|
22
|
+
octopod episode # adds a template for a new episode
|
23
|
+
octopod deploy # deploys your site
|
24
|
+
|
25
|
+
See 'octopod <command> --help' for more information on a specific command.
|
26
|
+
|
27
|
+
Configuration is read from '<source>/_config.yml' but can be overridden
|
28
|
+
using the following options:
|
29
|
+
|
30
|
+
HELP
|
31
|
+
|
32
|
+
episode_help = <<EPISODE_HELP
|
33
|
+
octopod episode - generates a template to post your next episode
|
34
|
+
|
35
|
+
octopod episode [options] [audio file[, audio file]]
|
36
|
+
|
37
|
+
Configuration is read from '<source>/_config.yml' but can be overridden
|
38
|
+
using the following options:
|
39
|
+
|
40
|
+
EPISODE_HELP
|
41
|
+
|
42
|
+
deploy_help = <<DEPLOY_HELP
|
43
|
+
octopod deploy - deploys website via rsync
|
44
|
+
|
45
|
+
octopod deploy [path to write generated site] [options]
|
46
|
+
|
47
|
+
Configuration is read from '<source>/_config.yml' but can be overridden
|
48
|
+
using the following options:
|
49
|
+
|
50
|
+
DEPLOY_HELP
|
51
|
+
|
52
|
+
DEFAULT_EXT = '.md'
|
53
|
+
|
54
|
+
class OptionParser
|
55
|
+
alias_method :_octopod_banner=, :banner=
|
56
|
+
def banner=(_)
|
57
|
+
return ''
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def ok_failed(condition)
|
62
|
+
if (condition)
|
63
|
+
puts "OK"
|
64
|
+
else
|
65
|
+
puts "FAILED"
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def write_file?(filename)
|
70
|
+
if File.exists?(filename)
|
71
|
+
unless ["Y","N"].include?(@answer)
|
72
|
+
@answer = ask("File '#{filename}' already exists. Overwrite? Capitalized answer for ALL files.", ['y', 'Y', 'n', 'N'])
|
73
|
+
end
|
74
|
+
["Y", "y"].include?(@answer)
|
75
|
+
else
|
76
|
+
true
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def copy_file_or_create_dir(file)
|
81
|
+
filename = file.split(GEM_DIR + "/assets")[1]
|
82
|
+
if File.directory?(file)
|
83
|
+
FileUtils.mkdir(PWD + filename, {verbose: true}) unless File.exists?(PWD + filename)
|
84
|
+
else
|
85
|
+
if write_file?(PWD + filename)
|
86
|
+
FileUtils.cp(file, PWD + filename, {verbose: true})
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
def ask(message, valid_options = nil)
|
92
|
+
if valid_options
|
93
|
+
answer = get_stdin("#{message} #{valid_options.to_s.gsub(/"/, '').gsub(/, /,'/')} ") while !valid_options.include?(answer)
|
94
|
+
else
|
95
|
+
answer = get_stdin(message)
|
96
|
+
end
|
97
|
+
answer
|
98
|
+
end
|
99
|
+
|
100
|
+
def get_stdin(message)
|
101
|
+
print message
|
102
|
+
STDIN.gets.chomp
|
103
|
+
end
|
104
|
+
|
105
|
+
if ARGV.size > 0 && (ARGV[0] == 'episode' || ARGV[0] == 'deploy' || ARGV[0] == 'setup')
|
106
|
+
options = YAML.load_file(File.join(PWD, '_config.yml'))
|
107
|
+
options['posts_dir'] = File.join(PWD, '_posts')
|
108
|
+
|
109
|
+
case ARGV[0]
|
110
|
+
|
111
|
+
when 'episode'
|
112
|
+
post_header = {
|
113
|
+
'title' => nil,
|
114
|
+
'layout' => 'post',
|
115
|
+
'author' => options['author'],
|
116
|
+
'explicit' => options['explicit'] || 'no',
|
117
|
+
'audio' => {
|
118
|
+
'm4a' => 'name.m4a',
|
119
|
+
'mp3' => 'name.mp3',
|
120
|
+
'opus' => 'name.opus'},
|
121
|
+
}
|
122
|
+
|
123
|
+
opts = OptionParser.new do |opts|
|
124
|
+
opts._octopod_banner = episode_help
|
125
|
+
|
126
|
+
opts.on("-a", "--author [AUTHOR]", "Name of post author") do |episode_author|
|
127
|
+
post_header['author'] = options['author'] = episode_author
|
128
|
+
end
|
129
|
+
|
130
|
+
opts.on("-c", "--chapters [chapter1,chapter2,...]", Array, "The episodes chapters.") do |episode_chapters|
|
131
|
+
warn episode_chapters.inspect
|
132
|
+
post_header['chapters'] = options['chapters'] = episode_chapters
|
133
|
+
end
|
134
|
+
|
135
|
+
opts.on("-d", "--duration [DURATION]", "Duration of the episode") do |episode_duration|
|
136
|
+
post_header['duration'] = options['duration'] = episode_duration.to_i
|
137
|
+
end
|
138
|
+
|
139
|
+
opts.on("-e", "--explicit [yes/no]", "Explicit rating for this episode (default: 'no')") do |episode_explicit|
|
140
|
+
post_header['explicit'] = options['explicit'] = episode_explicit
|
141
|
+
end
|
142
|
+
|
143
|
+
opts.on("--episode-cover [PATH]", "Path to the image that represents the episode.") do |episode_cover|
|
144
|
+
post_header['episode_cover'] = options['episode_cover'] = episode_cover
|
145
|
+
end
|
146
|
+
|
147
|
+
opts.on("-l", "--layout [LAYOUT]", "Layout to use (default: 'post')") do |episode_layout|
|
148
|
+
post_header['layout'] = options['layout'] = episode_layout
|
149
|
+
end
|
150
|
+
|
151
|
+
opts.on("-p", "--posts-dir [PATH]", "Path to the post directory (default: '_posts')") do |episode_posts_dir|
|
152
|
+
options['posts_dir'] = episode_posts_dir
|
153
|
+
end
|
154
|
+
|
155
|
+
opts.on("-s", "--subtitle [TEXT]", "Subtitle of the episode") do |episode_subtitle|
|
156
|
+
post_header['subtitle'] = options['subtitle'] = episode_subtitle
|
157
|
+
end
|
158
|
+
|
159
|
+
opts.on("--summary [TEXT]", "Summary of the episode") do |episode_summary|
|
160
|
+
post_header['summary'] = options['summary'] = episode_summary
|
161
|
+
end
|
162
|
+
|
163
|
+
opts.on("--tags [tag1,tag2,...]", Array, "Tags for the episode") do |episode_tags|
|
164
|
+
post_header['tags'] = options['tags'] = episode_tags
|
165
|
+
end
|
166
|
+
|
167
|
+
opts.on("-t", "--title [TEXT]", "Title of the episode") do |episode_title|
|
168
|
+
post_header['title'] = options['title'] = episode_title
|
169
|
+
end
|
170
|
+
end
|
171
|
+
opts.parse!
|
172
|
+
|
173
|
+
unless FileTest.directory?(options['posts_dir'])
|
174
|
+
abort("rake aborted: '#{options['posts_dir']}' directory not found.")
|
175
|
+
end
|
176
|
+
|
177
|
+
post_header['title'] = post_header['title'] || 'untitled'
|
178
|
+
slug = post_header['title'].downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '_')
|
179
|
+
date = Time.now.strftime('%Y-%m-%d')
|
180
|
+
|
181
|
+
filename = File.join(options['posts_dir'], "#{date}-#{slug}#{DEFAULT_EXT}")
|
182
|
+
|
183
|
+
abort() unless write_file?(filename)
|
184
|
+
|
185
|
+
open(filename, 'w') do |post|
|
186
|
+
post.puts post_header.to_yaml
|
187
|
+
post.puts '---'
|
188
|
+
post.puts "Insert eloquent and worth reading text here.\n\n"
|
189
|
+
post.puts "{{ page | web_player:site }}\n\n"
|
190
|
+
post.puts "## Shownotes\n* Note"
|
191
|
+
end
|
192
|
+
|
193
|
+
puts "Created new episode: #{filename}" if File.exists?(filename)
|
194
|
+
|
195
|
+
when 'deploy'
|
196
|
+
opts = OptionParser.new do |opts|
|
197
|
+
opts._octopod_banner = deploy_help
|
198
|
+
|
199
|
+
opts.on("--document-root [PATH]", "Path to the documwrite_fileent root on the remote machine") do |deploy_document_root|
|
200
|
+
options['document_root'] = deploy_document_root
|
201
|
+
end
|
202
|
+
|
203
|
+
opts.on("--rsync-delete", "Delete extraneous files from destination dir") do |deploy_rsync_delete|
|
204
|
+
options['rsync_delete'] = deploy_rsync_delete
|
205
|
+
end
|
206
|
+
|
207
|
+
opts.on("--ssh-host [USER@]<HOST>", "[User and] host of the destination machine") do |deploy_ssh_host|
|
208
|
+
options['ssh_host'] = deploy_ssh_host =~ /\A\w*@.*/ ? deploy_ssh_host : "#{ENV['USER']}@#{deploy_ssh_host}"
|
209
|
+
end
|
210
|
+
|
211
|
+
opts.on("--ssh-port [PORT]", "SSH port on the remote machine") do |deploy_ssh_port|
|
212
|
+
options['ssh_port'] = deploy_ssh_port.to_i
|
213
|
+
end
|
214
|
+
end
|
215
|
+
opts.parse!
|
216
|
+
|
217
|
+
options['public_dir'] = ARGV[1] ? ARGV[1] : File.join(PWD, '_site')
|
218
|
+
exclude = ""
|
219
|
+
if File.exists?('./rsync-exclude')
|
220
|
+
exclude = "--exclude-from '#{File.expand_path('./rsync-exclude')}'"
|
221
|
+
end
|
222
|
+
puts "## Deploying website via Rsync"
|
223
|
+
|
224
|
+
rsync_command = "rsync --progress -avze 'ssh -p #{options['ssh_port']}' #{exclude} \
|
225
|
+
#{"--delete" unless options['rsync_delete'] == false} \
|
226
|
+
#{options['public_dir']}/ #{options['ssh_host']}:#{options['document_root']}"
|
227
|
+
|
228
|
+
ok_failed system(rsync_command)
|
229
|
+
|
230
|
+
when 'setup'
|
231
|
+
unless File.exists?(PWD + '/_config.dist_backup.yml')
|
232
|
+
puts "", "===== Creating a backup of the configuation file ... ====="
|
233
|
+
FileUtils.cp(PWD + '/_config.yml', PWD + '/_config.dist_backup.yml', {verbose: true})
|
234
|
+
puts "===== ... done ===== ", ""
|
235
|
+
end
|
236
|
+
|
237
|
+
puts "", "===== Copying assets ... ====="
|
238
|
+
Dir.glob(GEM_DIR + "/assets/**/*").each do |file|
|
239
|
+
copy_file_or_create_dir(file)
|
240
|
+
end
|
241
|
+
|
242
|
+
Dir.glob(GEM_DIR + "/assets/**/.*").each do |file|
|
243
|
+
copy_file_or_create_dir(file)
|
244
|
+
end
|
245
|
+
puts "===== ... done ===== ", ""
|
246
|
+
end
|
247
|
+
else
|
248
|
+
puts octopod_help if ARGV.size > 0 && ARGV[0] == '--help'
|
249
|
+
load Gem.bin_path('jekyll', 'jekyll')
|
250
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-octopod
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- Arne Eilermann
|
7
8
|
- Stefan Haslinger
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
12
|
+
date: 2016-05-28 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: jekyll
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '3.1'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '3.1'
|
13
28
|
- !ruby/object:Gem::Dependency
|
14
29
|
name: rspec
|
15
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -28,12 +43,14 @@ description: Enables you to publish your podcast using the Jekyll static site ge
|
|
28
43
|
creating feeds and a reasonably looking website
|
29
44
|
email:
|
30
45
|
- stefan.haslinger@informatom.com
|
31
|
-
executables:
|
46
|
+
executables:
|
47
|
+
- octopod
|
32
48
|
extensions: []
|
33
49
|
extra_rdoc_files: []
|
34
50
|
files:
|
35
51
|
- README.rdoc
|
36
52
|
- Rakefile
|
53
|
+
- bin/octopod
|
37
54
|
- lib/jekyll/octopod/version.rb
|
38
55
|
- lib/octopod.rb
|
39
56
|
homepage: https://github.com/haslinger/jekyll-
|