octopress 3.0.0.alpha2 → 3.0.0.alpha3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/.gitignore +15 -18
- data/Gemfile +3 -1
- data/LICENSE +20 -0
- data/README.md +66 -0
- data/Rakefile +1 -76
- data/bin/octopress +14 -58
- data/lib/octopress.rb +40 -79
- data/lib/octopress/command.rb +10 -4
- data/lib/octopress/commands/new.rb +50 -12
- data/lib/octopress/commands/publish.rb +18 -0
- data/lib/octopress/core_ext.rb +1 -0
- data/lib/octopress/draft.rb +43 -0
- data/lib/octopress/page.rb +109 -0
- data/lib/octopress/post.rb +30 -0
- data/lib/octopress/version.rb +1 -1
- data/octopress.gemspec +7 -32
- metadata +31 -437
- data/.editorconfig +0 -22
- data/.gitattributes +0 -1
- data/.powrc +0 -4
- data/.rspec +0 -5
- data/.rubocop.yml +0 -119
- data/.slugignore +0 -3
- data/.travis.yml +0 -6
- data/CHANGELOG.markdown +0 -46
- data/CONTRIBUTING.markdown +0 -17
- data/README.markdown +0 -37
- data/lib/console +0 -17
- data/lib/guard/jekyll.rb +0 -33
- data/lib/octopress/commands.rb +0 -14
- data/lib/octopress/commands/build.rb +0 -17
- data/lib/octopress/commands/build_javascripts.rb +0 -11
- data/lib/octopress/commands/build_jekyll.rb +0 -42
- data/lib/octopress/commands/build_stylesheets.rb +0 -13
- data/lib/octopress/commands/install.rb +0 -44
- data/lib/octopress/commands/scaffold.rb +0 -102
- data/lib/octopress/commands/serve.rb +0 -25
- data/lib/octopress/configuration.rb +0 -237
- data/lib/octopress/dependency_installer.rb +0 -287
- data/lib/octopress/errors.rb +0 -3
- data/lib/octopress/filters/content.rb +0 -66
- data/lib/octopress/filters/date.rb +0 -46
- data/lib/octopress/filters/post.rb +0 -175
- data/lib/octopress/filters/url.rb +0 -34
- data/lib/octopress/formatters.rb +0 -9
- data/lib/octopress/formatters/base_formatter.rb +0 -17
- data/lib/octopress/formatters/simple_formatter.rb +0 -9
- data/lib/octopress/formatters/verbose_formatter.rb +0 -9
- data/lib/octopress/generators/category_generator.rb +0 -196
- data/lib/octopress/generators/sitemap_generator.rb +0 -308
- data/lib/octopress/guardfile +0 -43
- data/lib/octopress/helpers/titlecase.rb +0 -37
- data/lib/octopress/ink.rb +0 -12
- data/lib/octopress/inquirable_string.rb +0 -12
- data/lib/octopress/installer.rb +0 -96
- data/lib/octopress/js_assets_manager.rb +0 -97
- data/lib/octopress/liquid_helpers/conditional.rb +0 -36
- data/lib/octopress/liquid_helpers/config.rb +0 -58
- data/lib/octopress/liquid_helpers/include.rb +0 -33
- data/lib/octopress/liquid_helpers/url.rb +0 -29
- data/lib/octopress/liquid_helpers/vars.rb +0 -30
- data/lib/octopress/plugin.rb +0 -33
- data/lib/octopress/rake.rb +0 -16
- data/lib/octopress/scaffold/.gitignore +0 -18
- data/lib/octopress/scaffold/site/Gemfile +0 -3
- data/lib/octopress/scaffold/site/config.ru +0 -25
- data/lib/octopress/scaffold/site/config/compass.rb +0 -27
- data/lib/octopress/scaffold/site/config/rack.rb +0 -25
- data/lib/octopress/scaffold/site/config/site.yml +0 -0
- data/lib/octopress/scaffold/site/javascripts/lib/ios-rotate-scaling-fix.js +0 -19
- data/lib/octopress/scaffold/site/javascripts/lib/jquery-1.9.1.js +0 -9598
- data/lib/octopress/scaffold/site/javascripts/lib/jquery.cookie.js +0 -93
- data/lib/octopress/scaffold/site/stylesheets/_config.scss +0 -1
- data/lib/octopress/scaffold/site/stylesheets/_style.scss +0 -1
- data/lib/octopress/scaffold/site/stylesheets/site.scss +0 -16
- data/lib/octopress/tags/assign.rb +0 -34
- data/lib/octopress/tags/capture.rb +0 -31
- data/lib/octopress/tags/config-tag.rb +0 -23
- data/lib/octopress/tags/include.rb +0 -63
- data/lib/octopress/tags/js-assets.rb +0 -23
- data/lib/octopress/tags/puts.rb +0 -39
- data/lib/octopress/tags/render-partial.rb +0 -89
- data/lib/octopress/tags/return.rb +0 -21
- data/lib/rake/clean.rake +0 -8
- data/lib/rake/clobber.rake +0 -5
- data/lib/rake/console.rake +0 -5
- data/lib/rake/deploy.rake +0 -4
- data/lib/rake/gen_deploy.rake +0 -2
- data/lib/rake/generate.rake +0 -4
- data/lib/rake/generate_only.rake +0 -14
- data/lib/rake/hygiene.rake +0 -29
- data/lib/rake/install.rake +0 -8
- data/lib/rake/integrate.rake +0 -4
- data/lib/rake/isolate.rake +0 -13
- data/lib/rake/list_drafts.rake +0 -7
- data/lib/rake/new.rake +0 -7
- data/lib/rake/new_page.rake +0 -49
- data/lib/rake/new_post.rake +0 -32
- data/lib/rake/nuke.rake +0 -4
- data/lib/rake/preview.rake +0 -4
- data/lib/rake/push.rake +0 -37
- data/lib/rake/rsync.rake +0 -20
- data/lib/rake/set_root_dir.rake +0 -35
- data/lib/rake/setup_github_pages.rake +0 -115
- data/lib/rake/watch.rake +0 -11
- data/lib/scaffold/Rakefile +0 -142
- data/lib/scaffold/plugin-name.gemspec +0 -43
- data/lib/spec/fixtures/env/defaults/classic.yml +0 -2
- data/lib/spec/fixtures/no_override/defaults/classic.yml +0 -11
- data/lib/spec/fixtures/override/defaults/classic.yml +0 -11
- data/lib/spec/fixtures/override/site.yml +0 -11
- data/lib/spec/octopress/configuration_spec.rb +0 -67
- data/lib/spec/octopress/dependency_installer_spec.rb +0 -66
- data/lib/spec/octopress/ink_spec.rb +0 -10
- data/lib/spec/octopress/octopress_spec.rb +0 -97
- data/lib/spec/spec_helper.rb +0 -22
- data/lib/spec/support/env.rb +0 -36
- data/lib/spec/support/simplecov.rb +0 -52
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
Nzg4YTgwYWZkMmNlYWZmYTZiN2VhNmJjNzQzZGM2MDFkNWZkN2Q2YjI0ZDFi
|
10
|
-
NjNmZjQ4YzcyZWY3NGNhNWMwMWNmZGE0NThkOTNjYjgxOTg2NmYyZjA5MDM0
|
11
|
-
YWE4MTJkNDc3Y2E0YzI0NjVjMGNjOWVjY2FhNzQ1NDdiY2VjODA=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
OTE5YzI3NzYwOTg4YTdlMjczNWRkZGE1NWZhNmY1MjIzODVmZTU0OTQ2ZjAw
|
14
|
-
NDkyMThmOWNhMDEyMmY0MDE2M2E1NDJhY2U2MGY5MDQ3YWMyMWExZGViZTMy
|
15
|
-
MjU5NzU1ZjBiZjllMjE5YTkyOWI0NjA1NWI3YWViMWM0NjJhZWM=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 43594e6b5026cdfe8c0b63659e8c6d23073153b4
|
4
|
+
data.tar.gz: 13fe34f1bfa868adebaf7fbbe9f875a7ba4cffe3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bd87b4fee80759d6791deb6bb974a0ae92d538babcc9ee57df1308d0bae65fcd0fb0b14d924fcea6e528748d71071c10737be6b436d59f5949c05245fed6d507
|
7
|
+
data.tar.gz: 622aef0de4f00a34f80a2d8f595ff95f1ba3f8c6ac55d0897f898aa278a0b4ec6636300454873b1d9a1635ece49a8ead7e97bcccfefaea99378898b7285050af
|
data/.gitignore
CHANGED
@@ -1,20 +1,17 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
1
3
|
.bundle
|
2
|
-
.
|
4
|
+
.config
|
5
|
+
.yardoc
|
3
6
|
Gemfile.lock
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
/
|
12
|
-
/
|
13
|
-
/
|
14
|
-
|
15
|
-
/vendor
|
16
|
-
/lib/vendor
|
17
|
-
node_modules
|
18
|
-
/_config.yml
|
19
|
-
/config/deploy.yml
|
20
|
-
/coverage/
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
data/Gemfile
CHANGED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2013 octopress
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# Octopress
|
2
|
+
|
3
|
+
Octopress is an obsessively designed toolkit for writing and deploying Jekyll
|
4
|
+
blogs. Pretty sweet, huh?
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
gem 'octopress'
|
11
|
+
|
12
|
+
And then execute:
|
13
|
+
|
14
|
+
$ bundle
|
15
|
+
|
16
|
+
Or install it yourself as:
|
17
|
+
|
18
|
+
$ gem install octopress
|
19
|
+
|
20
|
+
## Usage
|
21
|
+
|
22
|
+
### Generating a new Post
|
23
|
+
|
24
|
+
```bash
|
25
|
+
$ octopress new post --title "My Title"
|
26
|
+
```
|
27
|
+
|
28
|
+
"Ok, great? What else can I do?" Great question! Check out these other options:
|
29
|
+
|
30
|
+
| Option | Type | Description |
|
31
|
+
|:-------------|:---------|:------------|
|
32
|
+
| `title` | `String` | The title of the new post |
|
33
|
+
| `date` | `String` | The date for the post. Should be parseable by [Time#parse](http://ruby-doc.org/stdlib-2.1.0/libdoc/time/rdoc/Time.html#method-i-parse) (defaults to Time.now) |
|
34
|
+
| `slug` | `String` | The slug for the new post. |
|
35
|
+
| `categories` | `Array` | A comma-separated list of categories to which this post belongs |
|
36
|
+
| `tags` | `Array` | A comma-separated list of tags for this post |
|
37
|
+
|
38
|
+
### Generating a new Page
|
39
|
+
|
40
|
+
```bash
|
41
|
+
$ octopress new page --path about/index.markdown
|
42
|
+
```
|
43
|
+
|
44
|
+
| Option | Type | Description |
|
45
|
+
|:-------------|:---------|:------------|
|
46
|
+
| `title` | `String` | The title of the new page |
|
47
|
+
| `date` | `String` | The date for the page. Should be parseable by [Time#parse](http://ruby-doc.org/stdlib-2.1.0/libdoc/time/rdoc/Time.html#method-i-parse) |
|
48
|
+
| `path` | `String` | The path at which the new page should be generated. |
|
49
|
+
|
50
|
+
### Other Commands
|
51
|
+
|
52
|
+
Octopress also has the following commands, bundled as separate gems:
|
53
|
+
|
54
|
+
| Command | Gem | Description |
|
55
|
+
|:---------|:---------------------|:------------|
|
56
|
+
| `deploy` | [octopress-deploy][] | Deployment for Octopress and Jekyll blogs. |
|
57
|
+
|
58
|
+
[octopress-deploy]: https://github.com/octopress/deploy
|
59
|
+
|
60
|
+
## Contributing
|
61
|
+
|
62
|
+
1. Fork it
|
63
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
64
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
65
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
66
|
+
5. Create new Pull Request
|
data/Rakefile
CHANGED
@@ -1,76 +1 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
$:.unshift File.expand_path("lib", File.dirname(__FILE__)) # For use/testing when no gem is installed
|
4
|
-
require 'octopress'
|
5
|
-
require 'tzinfo'
|
6
|
-
|
7
|
-
### Configuring Octopress:
|
8
|
-
### Under config/ you will find:
|
9
|
-
### site.yml, deploy.yml
|
10
|
-
### Here you can override Octopress's default configurations or add your own.
|
11
|
-
### This Rakefile uses those config settings to do what it does.
|
12
|
-
### Please do not change anything below if you want help --
|
13
|
-
### otherwise, you're on your own ;-)
|
14
|
-
|
15
|
-
#
|
16
|
-
# Run tests for Octopress module, found in lib/.
|
17
|
-
#
|
18
|
-
require 'rspec/core/rake_task'
|
19
|
-
desc "Run all examples"
|
20
|
-
RSpec::Core::RakeTask.new(:spec) do |t|
|
21
|
-
t.pattern = "./lib/spec{,/*/**}/*_spec.rb"
|
22
|
-
end
|
23
|
-
|
24
|
-
task :test do
|
25
|
-
sh "bundle exec rake spec"
|
26
|
-
#sh "bundle exec rake install['classic-theme']"
|
27
|
-
#sh "bundle exec rake install['video-tag']"
|
28
|
-
#sh "bundle exec rake install['adn-timeline']"
|
29
|
-
#sh "bundle exec rake generate"
|
30
|
-
end
|
31
|
-
|
32
|
-
def get_stdin(message)
|
33
|
-
print message
|
34
|
-
STDIN.gets.chomp
|
35
|
-
end
|
36
|
-
|
37
|
-
def now_in_timezone(timezone)
|
38
|
-
time = Time.now
|
39
|
-
unless timezone.nil? || timezone.empty? || timezone == 'local'
|
40
|
-
tz = TZInfo::Timezone.get(timezone) #setup Timezone object
|
41
|
-
adjusted_time = tz.utc_to_local(time.utc) #time object without correct offset
|
42
|
-
#time object with correct offset
|
43
|
-
time = Time.new(
|
44
|
-
adjusted_time.year,
|
45
|
-
adjusted_time.month,
|
46
|
-
adjusted_time.day,
|
47
|
-
adjusted_time.hour,
|
48
|
-
adjusted_time.min,
|
49
|
-
adjusted_time.sec,
|
50
|
-
tz.period_for_utc(time.utc).utc_total_offset())
|
51
|
-
#convert offset to utc instead of just ±0 if that was specified
|
52
|
-
if ['utc','zulu','universal','uct','gmt','gmt0','gmt+0','gmt-0'].include? timezone.downcase
|
53
|
-
time = time.utc
|
54
|
-
end
|
55
|
-
end
|
56
|
-
time
|
57
|
-
end
|
58
|
-
|
59
|
-
def get_unpublished(posts, options={})
|
60
|
-
result = ""
|
61
|
-
message = options[:message] || "These Posts will not be published:"
|
62
|
-
posts.sort.each do |post|
|
63
|
-
file = File.read(post)
|
64
|
-
data = YAML.load file.match(/(^-{3}\n)(.+?)(\n-{3})/m)[2]
|
65
|
-
|
66
|
-
if options[:env] == 'production'
|
67
|
-
future = Time.now < Time.parse(data['date'].to_s) ? "future date: #{data['date']}" : false
|
68
|
-
end
|
69
|
-
draft = data['published'] == false ? 'published: false' : false
|
70
|
-
result << "- #{data['title']} (#{draft or future})\n" if draft or future
|
71
|
-
end
|
72
|
-
result = "#{message}\n" + result unless result.empty?
|
73
|
-
result
|
74
|
-
end
|
75
|
-
|
76
|
-
Octopress::Rake.init!(self)
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/octopress
CHANGED
@@ -1,66 +1,22 @@
|
|
1
|
-
|
1
|
+
#! /usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
require File.expand_path("../lib/octopress", File.dirname(__FILE__))
|
5
|
-
require 'commander/import'
|
3
|
+
$LOAD_PATH.unshift(File.expand_path("../lib", File.dirname(__FILE__)))
|
6
4
|
|
7
|
-
|
8
|
-
|
9
|
-
'It\'s easy to configure and easy to deploy. Sweet huh?'
|
5
|
+
require 'mercenary'
|
6
|
+
require 'octopress'
|
10
7
|
|
11
|
-
|
12
|
-
c.syntax = 'octopress build [options]'
|
13
|
-
c.summary = 'Build your static site'
|
8
|
+
Octopress.require_blessed_gems
|
14
9
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
Octopress::Commands::Build.process(args, options.__hash__)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
command :install do |c|
|
24
|
-
c.syntax = 'octopress install NAME'
|
25
|
-
c.summary = 'Install an Octopress plugin'
|
26
|
-
|
27
|
-
c.action do |args, options|
|
28
|
-
Octopress::Commands::Install.process(args, options.__hash__)
|
29
|
-
end
|
10
|
+
begin
|
11
|
+
require 'bundler'
|
12
|
+
Bundler.require(:octopress)
|
13
|
+
rescue
|
30
14
|
end
|
31
15
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
c.example 'Create new site in current directory', 'octopress build .'
|
37
|
-
c.example 'Create new site in subdirectory "./blog"', 'octopress build blog'
|
38
|
-
|
39
|
-
c.action do |args, options|
|
40
|
-
Octopress::Commands::New.process(args, options.__hash__)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
command :scaffold do |c|
|
45
|
-
c.syntax = 'octopress scaffold (plugin|theme) [options]'
|
46
|
-
c.summary = 'Scaffold a new plugin or theme to release'
|
47
|
-
|
48
|
-
c.example 'Create a new plugin called "image_resizer" in "./image_resizer"',
|
49
|
-
'octopress scaffold plugin image_resizer'
|
50
|
-
|
51
|
-
c.action do |args, options|
|
52
|
-
Octopress::Commands::Scaffold.process(args, options.__hash__)
|
53
|
-
end
|
54
|
-
end
|
16
|
+
Mercenary.program(:octopress) do |p|
|
17
|
+
p.version Octopress::VERSION
|
18
|
+
p.description "Octopress is an obsessively designed toolkit for Jekyll blogging."
|
19
|
+
p.syntax "octopress <subcommand> [options]"
|
55
20
|
|
56
|
-
|
57
|
-
c.syntax = 'octopress serve [options]'
|
58
|
-
c.summary = 'Build your site locally and start a server for it'
|
59
|
-
|
60
|
-
c.option '--env ENV', 'Specify the build environment'
|
61
|
-
c.option '--watch', 'Auto-regenerate with filesystem changes'
|
62
|
-
|
63
|
-
c.action do |args, options|
|
64
|
-
Octopress::Commands::Serve.process(args, options.__hash__)
|
65
|
-
end
|
21
|
+
Octopress::Command.subclasses.each { |c| c.init_with_program(p) }
|
66
22
|
end
|
data/lib/octopress.rb
CHANGED
@@ -1,90 +1,51 @@
|
|
1
|
-
$:.unshift File.expand_path(File.dirname(__FILE__)) # For use/testing when no gem is installed
|
2
|
-
|
3
|
-
# stdlib
|
4
|
-
require 'logger'
|
5
|
-
|
6
|
-
# gems
|
7
|
-
require 'colorator'
|
8
|
-
require 'open3'
|
9
|
-
require 'stringex'
|
10
|
-
require 'time'
|
11
|
-
require 'tzinfo'
|
12
|
-
require 'safe_yaml'
|
13
|
-
|
14
|
-
SafeYAML::OPTIONS[:suppress_warnings] = true
|
15
|
-
|
16
|
-
# octopress
|
17
|
-
require "octopress/version"
|
18
|
-
require "octopress/errors"
|
19
|
-
require "octopress/core_ext"
|
20
|
-
require "octopress/helpers/titlecase"
|
21
|
-
|
22
1
|
module Octopress
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
autoload :
|
30
|
-
autoload :
|
31
|
-
autoload :
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
def self.root
|
46
|
-
Dir.pwd
|
47
|
-
end
|
2
|
+
require 'octopress/core_ext'
|
3
|
+
require 'octopress/command'
|
4
|
+
require 'octopress/version'
|
5
|
+
require 'octopress/commands/new'
|
6
|
+
require 'octopress/commands/publish'
|
7
|
+
|
8
|
+
autoload :Page, 'octopress/page'
|
9
|
+
autoload :Post, 'octopress/post'
|
10
|
+
autoload :Draft, 'octopress/draft'
|
11
|
+
|
12
|
+
BLESSED_GEMS = %w[
|
13
|
+
octopress-deploy
|
14
|
+
octopress-ink
|
15
|
+
]
|
16
|
+
|
17
|
+
DEFAULTS = { 'octopress' => {
|
18
|
+
'new_post_extension' => 'markdown',
|
19
|
+
'new_page_extension' => 'html',
|
20
|
+
'new_post_layout' => 'post',
|
21
|
+
'new_page_layout' => 'page',
|
22
|
+
'titlecase' => true
|
23
|
+
}}
|
48
24
|
|
49
|
-
# Static: Fetches the Octopress environment
|
50
|
-
#
|
51
|
-
# Returns the Octopress environment as an InquirableString
|
52
|
-
def self.env
|
53
|
-
# Not simply memoizing the result in case the configuration changes out
|
54
|
-
# from under us at runtime... Not sure if that can happen, but just in
|
55
|
-
# case let's be conservative in our behavior here.
|
56
|
-
env_raw_tmp = (ENV["OCTOPRESS_ENV"] || self.configuration[:env]).to_s
|
57
|
-
if(env_raw_tmp != @env_raw)
|
58
|
-
@env = nil
|
59
|
-
end
|
60
|
-
@env_raw = env_raw_tmp
|
61
|
-
@env ||= InquirableString.new(@env_raw)
|
62
|
-
end
|
63
|
-
|
64
|
-
# Static: Fetch the logger for Octopress
|
65
|
-
#
|
66
|
-
# Returns the Logger, based on Ruby's stdlib Logger
|
67
25
|
def self.logger
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
def self.configurator(root_dir = Octopress::Configuration::DEFAULT_CONFIG_DIR)
|
72
|
-
@configurator ||= Configuration.new(root_dir)
|
26
|
+
@logger ||= Logger.new(STDOUT)
|
27
|
+
@logger.level = Logger::DEBUG
|
28
|
+
@logger
|
73
29
|
end
|
74
30
|
|
75
|
-
def self.
|
76
|
-
@
|
31
|
+
def self.site(options={})
|
32
|
+
@site ||= Jekyll::Site.new(config(options))
|
77
33
|
end
|
78
34
|
|
79
|
-
def self.
|
80
|
-
|
81
|
-
|
35
|
+
def self.config(options={})
|
36
|
+
log_level = Jekyll.logger.log_level
|
37
|
+
Jekyll.logger.log_level = Jekyll::Stevenson::WARN
|
38
|
+
@config ||= DEFAULTS.deep_merge Jekyll.configuration(options)
|
39
|
+
Jekyll.logger.log_level = log_level
|
40
|
+
@config
|
82
41
|
end
|
83
|
-
end
|
84
42
|
|
85
|
-
def
|
86
|
-
|
87
|
-
|
43
|
+
def self.require_blessed_gems
|
44
|
+
BLESSED_GEMS.each do |gem|
|
45
|
+
begin
|
46
|
+
require gem
|
47
|
+
rescue LoadError
|
48
|
+
end
|
49
|
+
end
|
88
50
|
end
|
89
51
|
end
|
90
|
-
|
data/lib/octopress/command.rb
CHANGED
@@ -1,9 +1,15 @@
|
|
1
1
|
module Octopress
|
2
2
|
class Command
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
def self.inherited(base)
|
4
|
+
subclasses << base
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.subclasses
|
8
|
+
@subclasses ||= []
|
9
|
+
end
|
10
|
+
|
11
|
+
def init_with_program(p)
|
12
|
+
raise NotImplementedError.new("")
|
7
13
|
end
|
8
14
|
end
|
9
15
|
end
|