octopress 3.0.0.rc.12 → 3.0.0.rc.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 +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +10 -3
- data/bin/octopress +0 -5
- data/lib/octopress.rb +1 -1
- data/lib/octopress/draft.rb +5 -0
- data/lib/octopress/page.rb +18 -7
- data/lib/octopress/version.rb +1 -1
- data/octopress.gemspec +1 -0
- data/scaffold/_templates/draft +4 -0
- data/test/Gemfile +4 -0
- data/test/expected/_templates/draft +4 -0
- data/test/test.rb +1 -1
- metadata +21 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: fead3f71ad05e8d4ae9bb9037cd98bf46f2dcc6c
         | 
| 4 | 
            +
              data.tar.gz: 9d4cbd900dcd2b381282d46acbb4cc103c133c24
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 40a3dd0146e0a4d5ab3d3d911f595a774fae90de19522e5b602065d622dfbcc4f31eaac3888ff28e63b9c02a3aa0628d6b0d13dfb913f7c1e6da2d89c77cfb7a
         | 
| 7 | 
            +
              data.tar.gz: 79683e347d84488151bfdde5848f4383ffb40b206adafbea9470ab216810622f32f3997b2d4d9d1ecbf06b2737d896c35863deaa44325c11fc16d22823f1230e
         | 
    
        data/.gitignore
    CHANGED
    
    
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,13 +1,20 @@ | |
| 1 1 | 
             
            # Octopress Changelog
         | 
| 2 2 |  | 
| 3 3 | 
             
            ## Current released version
         | 
| 4 | 
            -
            ### 3.0.0 RC11 - 2014-05-23
         | 
| 5 4 |  | 
| 6 | 
            -
             | 
| 7 | 
            -
             | 
| 5 | 
            +
            ### 3.0.0 RC13 - 2014-07-24
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            - Templates are no longer required unless passed as an option.
         | 
| 8 | 
            +
            - Drafts template default doesn't have a date anymore.
         | 
| 9 | 
            +
            - Now using octopress filters for titlecase
         | 
| 8 10 |  | 
| 9 11 | 
             
            ## Past versions
         | 
| 10 12 |  | 
| 13 | 
            +
            ### 3.0.0 RC12 - 2014-05-23
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            - Change: Default page template no longer includes a date.
         | 
| 16 | 
            +
            - Improved date management when publishing a draft.
         | 
| 17 | 
            +
             | 
| 11 18 | 
             
            ### 3.0.0 RC11 - 2014-05-07
         | 
| 12 19 |  | 
| 13 20 | 
             
            - Replaced Hash extensions with Jekyll utility methods.
         | 
    
        data/bin/octopress
    CHANGED
    
    | @@ -7,11 +7,6 @@ require 'octopress' | |
| 7 7 |  | 
| 8 8 | 
             
            Octopress.require_blessed_gems
         | 
| 9 9 |  | 
| 10 | 
            -
            if defined? Octopress::Ink
         | 
| 11 | 
            -
              require 'octopress/docs'
         | 
| 12 | 
            -
              Octopress::Ink.register_plugin(Octopress::CLIDocs)
         | 
| 13 | 
            -
            end
         | 
| 14 | 
            -
             | 
| 15 10 | 
             
            if ENV['BUNDLE_BIN_PATH'] || ENV['BUNDLE_GEMFILE']
         | 
| 16 11 | 
             
              begin
         | 
| 17 12 | 
             
                require 'bundler'
         | 
    
        data/lib/octopress.rb
    CHANGED
    
    
    
        data/lib/octopress/draft.rb
    CHANGED
    
    
    
        data/lib/octopress/page.rb
    CHANGED
    
    | @@ -63,7 +63,9 @@ module Octopress | |
| 63 63 | 
             
                def set_default_options
         | 
| 64 64 | 
             
                  @options['type']      ||= 'page'
         | 
| 65 65 | 
             
                  @options['layout']      = @config['page_layout']
         | 
| 66 | 
            -
                   | 
| 66 | 
            +
                  if @options['date']
         | 
| 67 | 
            +
                    @options['date']        = convert_date @options['date']
         | 
| 68 | 
            +
                  end
         | 
| 67 69 | 
             
                  @options['extension'] ||= @config['page_ext']
         | 
| 68 70 | 
             
                  @options['template']  ||= @config['page_template']
         | 
| 69 71 | 
             
                end
         | 
| @@ -95,8 +97,10 @@ module Octopress | |
| 95 97 | 
             
                    file = File.join(source, '_templates', file) if file
         | 
| 96 98 | 
             
                    if File.exist? file
         | 
| 97 99 | 
             
                      parse_template File.open(file).read
         | 
| 98 | 
            -
                     | 
| 100 | 
            +
                    elsif @options['template']
         | 
| 99 101 | 
             
                      abort "No #{@options['type']} template found at #{file}"
         | 
| 102 | 
            +
                    else
         | 
| 103 | 
            +
                      parse_template default_content
         | 
| 100 104 | 
             
                    end
         | 
| 101 105 | 
             
                  else
         | 
| 102 106 | 
             
                    parse_template default_content
         | 
| @@ -110,19 +114,26 @@ module Octopress | |
| 110 114 | 
             
                # Render Liquid vars in YAML front-matter.
         | 
| 111 115 | 
             
                def parse_template(input)
         | 
| 112 116 |  | 
| 113 | 
            -
                   | 
| 117 | 
            +
                  if @config['titlecase']
         | 
| 118 | 
            +
                    @options['title'] = Octopress::Filters.titlecase(@options['title'])
         | 
| 119 | 
            +
                  end
         | 
| 114 120 | 
             
                  # If possible only parse the YAML front matter.
         | 
| 115 121 | 
             
                  # If YAML front-matter dashes aren't present parse the whole 
         | 
| 116 122 | 
             
                  # template and add dashes.
         | 
| 117 123 | 
             
                  #
         | 
| 118 124 |  | 
| 119 125 | 
             
                  parsed = if input =~ /\A-{3}\s+(.+?)\s+-{3}(.+)?/m
         | 
| 120 | 
            -
                     | 
| 121 | 
            -
                     | 
| 126 | 
            +
                    input = $1
         | 
| 127 | 
            +
                    content = $2
         | 
| 128 | 
            +
                    if @options['date'] && !(input =~ /date:/)
         | 
| 129 | 
            +
                      input += "\ndate: #{@options['date']}"
         | 
| 130 | 
            +
                    end
         | 
| 122 131 | 
             
                  else
         | 
| 123 | 
            -
                     | 
| 124 | 
            -
                    "---\n#{template.render(@options).strip}\n---\n"
         | 
| 132 | 
            +
                    content = ''
         | 
| 125 133 | 
             
                  end
         | 
| 134 | 
            +
             | 
| 135 | 
            +
                  template = Liquid::Template.parse(input)
         | 
| 136 | 
            +
                  "---\n#{template.render(@options).strip}\n---\n#{content}"
         | 
| 126 137 | 
             
                end
         | 
| 127 138 |  | 
| 128 139 | 
             
                def date_slug
         | 
    
        data/lib/octopress/version.rb
    CHANGED
    
    
    
        data/octopress.gemspec
    CHANGED
    
    | @@ -20,6 +20,7 @@ Gem::Specification.new do |spec| | |
| 20 20 |  | 
| 21 21 | 
             
              spec.add_runtime_dependency "mercenary", "~> 0.3.2"
         | 
| 22 22 | 
             
              spec.add_runtime_dependency "jekyll", "~> 2.0"
         | 
| 23 | 
            +
              spec.add_runtime_dependency "octopress-filters", "~> 1.1"
         | 
| 23 24 |  | 
| 24 25 | 
             
              spec.add_development_dependency "octopress-ink"
         | 
| 25 26 | 
             
              spec.add_development_dependency "bundler", "~> 1.3"
         | 
    
        data/test/Gemfile
    ADDED
    
    
    
        data/test/test.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: octopress
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 3.0.0.rc. | 
| 4 | 
            +
              version: 3.0.0.rc.13
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Brandon Mathis
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2014- | 
| 12 | 
            +
            date: 2014-07-25 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: mercenary
         | 
| @@ -39,6 +39,20 @@ dependencies: | |
| 39 39 | 
             
                - - "~>"
         | 
| 40 40 | 
             
                  - !ruby/object:Gem::Version
         | 
| 41 41 | 
             
                    version: '2.0'
         | 
| 42 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 43 | 
            +
              name: octopress-filters
         | 
| 44 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 45 | 
            +
                requirements:
         | 
| 46 | 
            +
                - - "~>"
         | 
| 47 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 48 | 
            +
                    version: '1.1'
         | 
| 49 | 
            +
              type: :runtime
         | 
| 50 | 
            +
              prerelease: false
         | 
| 51 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 52 | 
            +
                requirements:
         | 
| 53 | 
            +
                - - "~>"
         | 
| 54 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 55 | 
            +
                    version: '1.1'
         | 
| 42 56 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 43 57 | 
             
              name: octopress-ink
         | 
| 44 58 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -134,8 +148,10 @@ files: | |
| 134 148 | 
             
            - lib/octopress/version.rb
         | 
| 135 149 | 
             
            - octopress.gemspec
         | 
| 136 150 | 
             
            - scaffold/_octopress.yml
         | 
| 151 | 
            +
            - scaffold/_templates/draft
         | 
| 137 152 | 
             
            - scaffold/_templates/page
         | 
| 138 153 | 
             
            - scaffold/_templates/post
         | 
| 154 | 
            +
            - test/Gemfile
         | 
| 139 155 | 
             
            - test/expected/_config.yml
         | 
| 140 156 | 
             
            - test/expected/_drafts/stupid-idea.markdown
         | 
| 141 157 | 
             
            - test/expected/_layouts/page.html
         | 
| @@ -160,6 +176,7 @@ files: | |
| 160 176 | 
             
            - test/expected/_site/index.html
         | 
| 161 177 | 
             
            - test/expected/_site/okay-page/index.html
         | 
| 162 178 | 
             
            - test/expected/_templates/date_page
         | 
| 179 | 
            +
            - test/expected/_templates/draft
         | 
| 163 180 | 
             
            - test/expected/_templates/other_page
         | 
| 164 181 | 
             
            - test/expected/_templates/page
         | 
| 165 182 | 
             
            - test/expected/_templates/post
         | 
| @@ -197,6 +214,7 @@ specification_version: 4 | |
| 197 214 | 
             
            summary: Octopress is an obsessively designed framework for Jekyll blogging. It’s
         | 
| 198 215 | 
             
              easy to configure and easy to deploy. Sweet huh?
         | 
| 199 216 | 
             
            test_files:
         | 
| 217 | 
            +
            - test/Gemfile
         | 
| 200 218 | 
             
            - test/expected/_config.yml
         | 
| 201 219 | 
             
            - test/expected/_drafts/stupid-idea.markdown
         | 
| 202 220 | 
             
            - test/expected/_layouts/page.html
         | 
| @@ -221,6 +239,7 @@ test_files: | |
| 221 239 | 
             
            - test/expected/_site/index.html
         | 
| 222 240 | 
             
            - test/expected/_site/okay-page/index.html
         | 
| 223 241 | 
             
            - test/expected/_templates/date_page
         | 
| 242 | 
            +
            - test/expected/_templates/draft
         | 
| 224 243 | 
             
            - test/expected/_templates/other_page
         | 
| 225 244 | 
             
            - test/expected/_templates/page
         | 
| 226 245 | 
             
            - test/expected/_templates/post
         |