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.
Files changed (119) hide show
  1. checksums.yaml +6 -14
  2. data/.gitignore +15 -18
  3. data/Gemfile +3 -1
  4. data/LICENSE +20 -0
  5. data/README.md +66 -0
  6. data/Rakefile +1 -76
  7. data/bin/octopress +14 -58
  8. data/lib/octopress.rb +40 -79
  9. data/lib/octopress/command.rb +10 -4
  10. data/lib/octopress/commands/new.rb +50 -12
  11. data/lib/octopress/commands/publish.rb +18 -0
  12. data/lib/octopress/core_ext.rb +1 -0
  13. data/lib/octopress/draft.rb +43 -0
  14. data/lib/octopress/page.rb +109 -0
  15. data/lib/octopress/post.rb +30 -0
  16. data/lib/octopress/version.rb +1 -1
  17. data/octopress.gemspec +7 -32
  18. metadata +31 -437
  19. data/.editorconfig +0 -22
  20. data/.gitattributes +0 -1
  21. data/.powrc +0 -4
  22. data/.rspec +0 -5
  23. data/.rubocop.yml +0 -119
  24. data/.slugignore +0 -3
  25. data/.travis.yml +0 -6
  26. data/CHANGELOG.markdown +0 -46
  27. data/CONTRIBUTING.markdown +0 -17
  28. data/README.markdown +0 -37
  29. data/lib/console +0 -17
  30. data/lib/guard/jekyll.rb +0 -33
  31. data/lib/octopress/commands.rb +0 -14
  32. data/lib/octopress/commands/build.rb +0 -17
  33. data/lib/octopress/commands/build_javascripts.rb +0 -11
  34. data/lib/octopress/commands/build_jekyll.rb +0 -42
  35. data/lib/octopress/commands/build_stylesheets.rb +0 -13
  36. data/lib/octopress/commands/install.rb +0 -44
  37. data/lib/octopress/commands/scaffold.rb +0 -102
  38. data/lib/octopress/commands/serve.rb +0 -25
  39. data/lib/octopress/configuration.rb +0 -237
  40. data/lib/octopress/dependency_installer.rb +0 -287
  41. data/lib/octopress/errors.rb +0 -3
  42. data/lib/octopress/filters/content.rb +0 -66
  43. data/lib/octopress/filters/date.rb +0 -46
  44. data/lib/octopress/filters/post.rb +0 -175
  45. data/lib/octopress/filters/url.rb +0 -34
  46. data/lib/octopress/formatters.rb +0 -9
  47. data/lib/octopress/formatters/base_formatter.rb +0 -17
  48. data/lib/octopress/formatters/simple_formatter.rb +0 -9
  49. data/lib/octopress/formatters/verbose_formatter.rb +0 -9
  50. data/lib/octopress/generators/category_generator.rb +0 -196
  51. data/lib/octopress/generators/sitemap_generator.rb +0 -308
  52. data/lib/octopress/guardfile +0 -43
  53. data/lib/octopress/helpers/titlecase.rb +0 -37
  54. data/lib/octopress/ink.rb +0 -12
  55. data/lib/octopress/inquirable_string.rb +0 -12
  56. data/lib/octopress/installer.rb +0 -96
  57. data/lib/octopress/js_assets_manager.rb +0 -97
  58. data/lib/octopress/liquid_helpers/conditional.rb +0 -36
  59. data/lib/octopress/liquid_helpers/config.rb +0 -58
  60. data/lib/octopress/liquid_helpers/include.rb +0 -33
  61. data/lib/octopress/liquid_helpers/url.rb +0 -29
  62. data/lib/octopress/liquid_helpers/vars.rb +0 -30
  63. data/lib/octopress/plugin.rb +0 -33
  64. data/lib/octopress/rake.rb +0 -16
  65. data/lib/octopress/scaffold/.gitignore +0 -18
  66. data/lib/octopress/scaffold/site/Gemfile +0 -3
  67. data/lib/octopress/scaffold/site/config.ru +0 -25
  68. data/lib/octopress/scaffold/site/config/compass.rb +0 -27
  69. data/lib/octopress/scaffold/site/config/rack.rb +0 -25
  70. data/lib/octopress/scaffold/site/config/site.yml +0 -0
  71. data/lib/octopress/scaffold/site/javascripts/lib/ios-rotate-scaling-fix.js +0 -19
  72. data/lib/octopress/scaffold/site/javascripts/lib/jquery-1.9.1.js +0 -9598
  73. data/lib/octopress/scaffold/site/javascripts/lib/jquery.cookie.js +0 -93
  74. data/lib/octopress/scaffold/site/stylesheets/_config.scss +0 -1
  75. data/lib/octopress/scaffold/site/stylesheets/_style.scss +0 -1
  76. data/lib/octopress/scaffold/site/stylesheets/site.scss +0 -16
  77. data/lib/octopress/tags/assign.rb +0 -34
  78. data/lib/octopress/tags/capture.rb +0 -31
  79. data/lib/octopress/tags/config-tag.rb +0 -23
  80. data/lib/octopress/tags/include.rb +0 -63
  81. data/lib/octopress/tags/js-assets.rb +0 -23
  82. data/lib/octopress/tags/puts.rb +0 -39
  83. data/lib/octopress/tags/render-partial.rb +0 -89
  84. data/lib/octopress/tags/return.rb +0 -21
  85. data/lib/rake/clean.rake +0 -8
  86. data/lib/rake/clobber.rake +0 -5
  87. data/lib/rake/console.rake +0 -5
  88. data/lib/rake/deploy.rake +0 -4
  89. data/lib/rake/gen_deploy.rake +0 -2
  90. data/lib/rake/generate.rake +0 -4
  91. data/lib/rake/generate_only.rake +0 -14
  92. data/lib/rake/hygiene.rake +0 -29
  93. data/lib/rake/install.rake +0 -8
  94. data/lib/rake/integrate.rake +0 -4
  95. data/lib/rake/isolate.rake +0 -13
  96. data/lib/rake/list_drafts.rake +0 -7
  97. data/lib/rake/new.rake +0 -7
  98. data/lib/rake/new_page.rake +0 -49
  99. data/lib/rake/new_post.rake +0 -32
  100. data/lib/rake/nuke.rake +0 -4
  101. data/lib/rake/preview.rake +0 -4
  102. data/lib/rake/push.rake +0 -37
  103. data/lib/rake/rsync.rake +0 -20
  104. data/lib/rake/set_root_dir.rake +0 -35
  105. data/lib/rake/setup_github_pages.rake +0 -115
  106. data/lib/rake/watch.rake +0 -11
  107. data/lib/scaffold/Rakefile +0 -142
  108. data/lib/scaffold/plugin-name.gemspec +0 -43
  109. data/lib/spec/fixtures/env/defaults/classic.yml +0 -2
  110. data/lib/spec/fixtures/no_override/defaults/classic.yml +0 -11
  111. data/lib/spec/fixtures/override/defaults/classic.yml +0 -11
  112. data/lib/spec/fixtures/override/site.yml +0 -11
  113. data/lib/spec/octopress/configuration_spec.rb +0 -67
  114. data/lib/spec/octopress/dependency_installer_spec.rb +0 -66
  115. data/lib/spec/octopress/ink_spec.rb +0 -10
  116. data/lib/spec/octopress/octopress_spec.rb +0 -97
  117. data/lib/spec/spec_helper.rb +0 -22
  118. data/lib/spec/support/env.rb +0 -36
  119. data/lib/spec/support/simplecov.rb +0 -52
data/.editorconfig DELETED
@@ -1,22 +0,0 @@
1
- ; This file is for unifying the coding style for different editors and IDEs.
2
- ; More information at http://EditorConfig.org
3
-
4
- root = true
5
-
6
- ; Use 2 spaces for indentation in all Ruby files
7
-
8
- [*.rb]
9
- indent_style = space
10
- indent_size = 2
11
-
12
- [Rakefile]
13
- indent_style = space
14
- indent_size = 2
15
-
16
- [Gemfile*]
17
- indent_style = space
18
- indent_size = 2
19
-
20
- [config.ru]
21
- indent_style = space
22
- indent_size = 2
data/.gitattributes DELETED
@@ -1 +0,0 @@
1
- * text=auto
data/.powrc DELETED
@@ -1,4 +0,0 @@
1
- if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".rvmrc" ] ; then
2
- source "$rvm_path/scripts/rvm"
3
- source ".rvmrc"
4
- fi
data/.rspec DELETED
@@ -1,5 +0,0 @@
1
- --color
2
- --require ./lib/spec/spec_helper.rb
3
- -I./lib/spec
4
- --default-path ./lib/spec/octopress
5
- --pattern ./lib/spec/octopress/**/*_spec.rb
data/.rubocop.yml DELETED
@@ -1,119 +0,0 @@
1
- # For now, due to the mess, turn a few things off to focus on more important
2
- # items. Ultimately we'd like things to pass static analyzers cleanly.
3
- Encoding:
4
- Enabled: false
5
-
6
- LineLength:
7
- Enabled: false
8
- Max: 90
9
-
10
- StringLiterals:
11
- Enabled: false
12
-
13
- SpaceAfterComma:
14
- Enabled: false
15
-
16
- SpaceAroundOperators:
17
- Enabled: false
18
-
19
- SpaceAroundBraces:
20
- Enabled: false
21
-
22
- ParenthesesAroundCondition:
23
- Enabled: false
24
-
25
- AvoidPerlBackrefs:
26
- Enabled: false
27
-
28
- HashSyntax:
29
- Enabled: false
30
-
31
- SpaceAroundEqualsInParameterDefault:
32
- Enabled: false
33
-
34
- AsciiComments:
35
- Enabled: false
36
-
37
- MethodLength:
38
- Enabled: false
39
-
40
- CollectionMethods:
41
- Enabled: false
42
-
43
- FavorPercentR:
44
- Enabled: false
45
-
46
- FavorUnlessOverNegatedIf:
47
- Enabled: false
48
-
49
- HandleExceptions:
50
- Enabled: false
51
-
52
- PercentR:
53
- Enabled: false
54
-
55
- IfUnlessModifier:
56
- Enabled: false
57
-
58
- AvoidPerlisms:
59
- Enabled: false
60
-
61
- Semicolon:
62
- Enabled: false
63
-
64
- WhenThen:
65
- Enabled: false
66
-
67
- IfWithSemicolon:
68
- Enabled: false
69
-
70
- ReduceArguments:
71
- Enabled: false
72
-
73
- RescueModifier:
74
- Enabled: false
75
-
76
- WhileUntilModifier:
77
- Enabled: false
78
-
79
- FavorUntilOverNegatedWhile:
80
- Enabled: false
81
-
82
- ParameterLists:
83
- Enabled: false
84
-
85
- SpaceAfterControlKeyword:
86
- Enabled: false
87
-
88
- Blocks:
89
- Enabled: false
90
-
91
- SpaceInsideHashLiteralBraces:
92
- Enabled: false
93
-
94
- EmptyLines:
95
- Enabled: false
96
-
97
- RescueException:
98
- Enabled: false
99
-
100
- AndOr:
101
- Enabled: false
102
-
103
- WordArray:
104
- Enabled: false
105
-
106
- AlignParameters:
107
- Enabled: false
108
-
109
- LeadingCommentSpace:
110
- Enabled: false
111
-
112
- UnlessElse:
113
- Enabled: false
114
-
115
- AccessControl:
116
- Enabled: false
117
-
118
- EmptyLiteral:
119
- Enabled: false
data/.slugignore DELETED
@@ -1,3 +0,0 @@
1
- plugins
2
- sass
3
- source
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.0.0
4
- - 1.9.3
5
- script:
6
- - bundle exec rake test
data/CHANGELOG.markdown DELETED
@@ -1,46 +0,0 @@
1
- # Octopress Changelog
2
-
3
- ## 2.1
4
-
5
- - Gist plugin now uses raw text instead of the Gist JS
6
- - Improvements to SCSS which styles `<sup>` and `<sub>` tags (#426)
7
- - Added list of categories into atom.xml (#421)
8
- - Added default support for guag.es analytics (#827)
9
- - `rake preview` binds to IP and HOST, which can be set through OCTOPRESS_IP and OCTOPRESS_HOST, respectively (#780)
10
- - New configuration structure (#958)
11
- - Improved draft management options
12
- - rake list_drafts shows current drafts.
13
- - Rake generate, watch, and preview can compile future dated posts (defaults to false).
14
- - FIX: `full_configuration` in Rakefile was uninitialized (#1021)
15
- - Site Enhancements
16
- - Development fixes
17
-
18
- ## 2.0
19
-
20
- - Now based on [mojombo/jekyll](http://github.com/mojombo/jekyll)
21
- - Sports a semantic HTML5 template
22
- - Easy theming with Compass and Sass
23
- - A Mobile friendly responsive (320 and up) layout
24
- - Built in 3rd party support for Twitter, Google Plus One, Disqus Comments, Pinboard, Delicious, and Google Analytics
25
- - Deploy to Github pages or use Rsync
26
- - Built in support for POW and Rack servers
27
- - Beautiful [Solarized](http://ethanschoonover.com/solarized) syntax highlighting
28
- - Super easy setup and configuration
29
-
30
- **New Plugins, Filters, & Generators**
31
-
32
- - **Gist Tag** for easily embedding gists in your posts
33
- - **Pygments Cache** makes subsequent compiling much faster
34
- - **Include Code Tag** lets you embed external code snippets from your file system and adds a download link
35
- - **Pullquote Tag** Generate beautiful semantic pullquotes (no double data) based on Maykel Loomans's [technique](http://miekd.com/articles/pull-quotes-with-html5-and-css/)
36
- - **Blockquote Tag** makes it easy to semantically format blockquotes
37
- - **Category Generator** gives you archive pages for each category
38
- - **Sitemap.xml Generator** for search engines
39
-
40
- ## 1.0
41
-
42
- - **No longer supported.**
43
- - Jekyll Matured, but Henrik's Jekyll fork did not.
44
- - Thanks for all your pull requests, I learned a lot.
45
-
46
- # HEAD
@@ -1,17 +0,0 @@
1
- ## Octopress Contributing Guidelines
2
-
3
- We love to see people contributing to Octopress, whether it's a bug report,
4
- feature suggestion or a pull request. At the moment, we try to keep the core
5
- slick and lean, focusing on basic blogging needs, so some of your suggestions
6
- might not find their way into Octopress. For those ideas, we started a
7
- [list of 3rd party plug-ins](https://github.com/imathis/octopress/wiki/3rd-party-plugins),
8
- where you can link your own Octopress plug-in repositories.
9
-
10
- For the future, we're thinking about ways to more easily add them them into
11
- our main releases.
12
-
13
- **All development work is currently happening on the `2.1` branch and all PRs should be
14
- submitted against that branch for the time being.** We will, however, still accept
15
- critical patches against master where needed.
16
-
17
- Happy Blogging!
data/README.markdown DELETED
@@ -1,37 +0,0 @@
1
- ## What is Octopress?
2
-
3
- Octopress is [Jekyll](https://github.com/mojombo/jekyll) blogging at its finest.
4
-
5
- 1. **Octopress sports a clean responsive theme** written in semantic HTML5, focused on readability and friendliness toward mobile devices.
6
- 2. **Code blogging is easy and beautiful.** Embed code (with [Solarized](http://ethanschoonover.com/solarized) styling) in your posts from gists, jsFiddle or from your filesystem.
7
- 3. **Third party integration is simple** with built-in support for Pinboard, Delicious, GitHub Repositories, Disqus Comments and Google Analytics.
8
- 4. **It's easy to use.** A collection of rake tasks simplifies development and makes deploying a cinch.
9
- 5. **Ships with great plug-ins** some original and others from the Jekyll community &mdash; tested and improved.
10
-
11
-
12
- ## Documentation
13
-
14
- Check out [Octopress.org](http://octopress.org/docs) for guides and documentation.
15
-
16
-
17
- ## Contributing
18
-
19
- [![Build Status](https://travis-ci.org/imathis/octopress.png?branch=2.1)](https://travis-ci.org/imathis/octopress)
20
-
21
- See [CONTRIBUTING.markdown](CONTRIBUTING.markdown).
22
-
23
- ## License
24
- (The MIT License)
25
-
26
- Copyright © 2009-2013 Brandon Mathis
27
-
28
- 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:
29
-
30
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
31
-
32
- THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33
-
34
-
35
- #### If you want to be awesome.
36
- - Proudly display the 'Powered by Octopress' credit in the footer.
37
- - Add your site to the Wiki so we can watch the community grow.
data/lib/console DELETED
@@ -1,17 +0,0 @@
1
- #! /usr/bin/env ruby
2
-
3
- $:.unshift File.dirname(__FILE__)
4
-
5
- require 'octopress'
6
- require 'irb'
7
- require 'irb/completion'
8
-
9
- ARGV.delete_if do |arg|
10
- if arg =~ /(.+)=(.+)/
11
- ENV[$1] = $2
12
- else
13
- false
14
- end
15
- end
16
-
17
- IRB.start
data/lib/guard/jekyll.rb DELETED
@@ -1,33 +0,0 @@
1
- require 'guard'
2
- require 'guard/guard'
3
- require 'guard/watcher'
4
-
5
- $:.unshift File.expand_path("..", File.dirname(__FILE__))
6
- require 'octopress'
7
-
8
- module Guard
9
- class Jekyll < Guard
10
-
11
- VERSION = '0.0.2'
12
-
13
- # Calls #run_all if the :all_on_start option is present.
14
- def start
15
- run_all if options[:all_on_start]
16
- end
17
-
18
- # Call #run_on_change for all files which match this guard.
19
- def run_all
20
- if Watcher.match_files(self, Dir.glob('{,**/}*{,.*}').uniq).size > 0
21
- Octopress.configurator.write_configs_for_generation
22
- system "jekyll build #{"--drafts" unless Octopress.env == 'production'}"
23
- Octopress.configurator.remove_configs_for_generation
24
- end
25
- end
26
-
27
- def run_on_changes(_)
28
- Octopress.configurator.write_configs_for_generation
29
- system "jekyll build #{"--drafts" unless Octopress.env == 'production'}"
30
- Octopress.configurator.remove_configs_for_generation
31
- end
32
- end
33
- end
@@ -1,14 +0,0 @@
1
- $:.unshift(File.dirname(__FILE__))
2
-
3
- module Octopress
4
- module Commands
5
- autoload :Build, 'commands/build'
6
- autoload :BuildJekyll, 'commands/build_jekyll'
7
- autoload :BuildJavascripts, 'commands/build_javascripts'
8
- autoload :BuildStylesheets, 'commands/build_stylesheets'
9
- autoload :Install, 'commands/install'
10
- autoload :New, 'commands/new'
11
- autoload :Scaffold, 'commands/scaffold'
12
- autoload :Serve, 'commands/serve'
13
- end
14
- end
@@ -1,17 +0,0 @@
1
- module Octopress
2
- module Commands
3
- class Build < Command
4
- class << self
5
- def process(args, options)
6
- if Octopress.configuration[:source].nil? || !File.directory?(Octopress.configuration[:source])
7
- Octopress.logger.error "### You haven't set anything up yet. First run `octopress install <theme-name>` to set up an Octopress theme."
8
- raise SiteNotFoundError
9
- end
10
- BuildJavascripts.process(args, options)
11
- BuildStylesheets.process(args, options)
12
- BuildJekyll.process(args, options)
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,11 +0,0 @@
1
- module Octopress
2
- module Commands
3
- class BuildJavascripts < Command
4
- class << self
5
- def process(args, options)
6
- puts Octopress::JSAssetsManager.new.compile if Dir.exists?("javascripts")
7
- end
8
- end
9
- end
10
- end
11
- end
@@ -1,42 +0,0 @@
1
- module Octopress
2
- module Commands
3
- class BuildJekyll < Command
4
- class << self
5
- def process(args, options)
6
- Octopress.configurator.write_configs_for_generation
7
- puts "## Generating Site with Jekyll - ENV: #{Octopress.env}"
8
- system "jekyll build #{jekyll_flags}"
9
- puts unpublished unless unpublished.empty?
10
- Octopress.configurator.remove_configs_for_generation
11
- end
12
-
13
- def unpublished
14
- posts = Dir.glob("#{Octopress.configuration[:source]}/#{Octopress.configuration[:posts_dir]}/*.*")
15
- options = {env: Octopress.env, message: "\nThese posts were not generated:"}
16
- @unpublished ||= get_unpublished(posts, options)
17
- end
18
-
19
- def jekyll_flags
20
- Octopress.env.production? ? "" : "--drafts --trace"
21
- end
22
-
23
- def get_unpublished(posts, options = {})
24
- result = ""
25
- message = options[:message] || "These Posts will not be published:"
26
- posts.sort.each do |post|
27
- file = File.read(post)
28
- data = YAML.load file.match(/(^-{3}\n)(.+?)(\n-{3})/m)[2]
29
-
30
- if options[:env] == 'production'
31
- future = Time.now < Time.parse(data['date'].to_s) ? "future date: #{data['date']}" : false
32
- end
33
- draft = data['published'] == false ? 'published: false' : false
34
- result << "- #{data['title']} (#{draft or future})\n" if draft or future
35
- end
36
- result = "#{message}\n" + result unless result.empty?
37
- result
38
- end
39
- end
40
- end
41
- end
42
- end
@@ -1,13 +0,0 @@
1
- module Octopress
2
- module Commands
3
- class BuildStylesheets < Command
4
- class << self
5
- def process(args, options)
6
- if Dir.exists?("stylesheets")
7
- system "compass compile --css-dir #{Octopress.configuration[:source]}/stylesheets"
8
- end
9
- end
10
- end
11
- end
12
- end
13
- end
@@ -1,44 +0,0 @@
1
- module Octopress
2
- module Commands
3
- class Install < Command
4
- class << self
5
- def process(args = nil, options = nil)
6
- raise "Please specify at least one plugin to install." if args.nil? || args.empty?
7
-
8
- plugin_name = args[0]
9
- require_plugin(rubyify(plugin_name))
10
-
11
- Octopress::Installer.new(rubyify(plugin_name)).install
12
- end
13
-
14
- def require_plugin(plugin_name)
15
- require "#{plugin_name}"
16
- rescue LoadError
17
- begin
18
- if File.read("#{Octopress.root}/Gemfile").match(/gem ["']#{plugin_name}["']/)
19
- Octopress.logger.warn("Oops! Looks like you haven't installed the gem but you have it in your Gemfile. Running 'bundle install'...")
20
- `bundle install`
21
- require "#{plugin_name}"
22
- else
23
- raise LoadError, "Cannot load #{plugin_name}"
24
- end
25
- rescue LoadError
26
- Octopress.logger.error("We could couldn't find the plugin '#{plugin_name}'.")
27
- Octopress.logger.error("Make sure you add this to your Gemfile:\n")
28
- Octopress.logger.error("gem '#{plugin_name}'\n")
29
- Octopress.logger.error("Then run 'bundle install' and retry the installation.")
30
- raise LoadError, "Cannot load #{plugin_name}"
31
- end
32
- end
33
-
34
- def classify(plugin_name)
35
- rubyify(plugin_name).split("_").map(&:capitalize).join("")
36
- end
37
-
38
- def rubyify(plugin_name)
39
- plugin_name.to_s.gsub(/-/, '_')
40
- end
41
- end
42
- end
43
- end
44
- end