middleman-blog 3.2.0 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -1
  3. data/.travis.yml +5 -7
  4. data/CHANGELOG.md +21 -0
  5. data/CONTRIBUTING.md +43 -0
  6. data/Gemfile +22 -14
  7. data/Gemfile-3.0 +27 -0
  8. data/{LICENSE → LICENSE.md} +2 -2
  9. data/README.md +33 -28
  10. data/Rakefile +17 -1
  11. data/features/blog_sources.feature +13 -0
  12. data/features/calendar_multiblog.feature +153 -0
  13. data/features/multiblog.feature +51 -0
  14. data/features/paginate_multiblog.feature +270 -0
  15. data/features/summary.feature +43 -0
  16. data/features/support/env.rb +6 -1
  17. data/features/tags_multiblog.feature +125 -0
  18. data/features/time_zone.feature +5 -0
  19. data/fixtures/blog-sources-app/source/blog/2013-08-08-slug-from-filename.html.markdown +7 -0
  20. data/fixtures/calendar-multiblog-app/config.rb +17 -0
  21. data/fixtures/calendar-multiblog-app/source/blog1/2011-01-01-new-article.html.markdown +7 -0
  22. data/fixtures/calendar-multiblog-app/source/blog1/2011-01-02-another-article.html.markdown +8 -0
  23. data/fixtures/calendar-multiblog-app/source/blog2/2011-01-01-new-article.html.markdown +7 -0
  24. data/fixtures/calendar-multiblog-app/source/blog2/2011-01-02-another-article.html.markdown +8 -0
  25. data/fixtures/calendar-multiblog-app/source/calendar1.html.erb +13 -0
  26. data/fixtures/calendar-multiblog-app/source/calendar2.html.erb +13 -0
  27. data/fixtures/calendar-multiblog-app/source/index.html.erb +15 -0
  28. data/fixtures/calendar-multiblog-app/source/layout.erb +15 -0
  29. data/fixtures/default-template-app/Gemfile +6 -0
  30. data/fixtures/default-template-app/config.rb +35 -0
  31. data/fixtures/default-template-app/source/2013-04-01-new-article.html.markdown +25 -0
  32. data/{features/encoding.feature → fixtures/default-template-app/source/about-me.html.erb} +0 -0
  33. data/fixtures/default-template-app/source/archives.html.erb +10 -0
  34. data/fixtures/default-template-app/source/index.html.erb +11 -0
  35. data/fixtures/default-template-app/source/javascripts/_zepto.pjax.js +744 -0
  36. data/fixtures/default-template-app/source/javascripts/app.js +11 -0
  37. data/fixtures/default-template-app/source/javascripts/modernizr.js +1 -0
  38. data/fixtures/default-template-app/source/layouts/layout.erb +62 -0
  39. data/fixtures/default-template-app/source/stylesheets/app.css.scss +109 -0
  40. data/fixtures/multiblog-app/config.rb +0 -0
  41. data/fixtures/multiblog-app/source/blog1/2012-12-12-other-article.html.markdown +5 -0
  42. data/fixtures/multiblog-app/source/blog2/2011/01/01/new-article.html.markdown +6 -0
  43. data/fixtures/multiblog-app/source/index.html.erb +7 -0
  44. data/fixtures/multiblog-app/source/layout.erb +30 -0
  45. data/fixtures/no-title-app/config.rb +3 -0
  46. data/fixtures/no-title-app/source/2013-08-07.html.markdown +6 -0
  47. data/fixtures/no-title-app/source/2013-08-08.html.markdown +7 -0
  48. data/fixtures/no-title-app/source/layout.erb +13 -0
  49. data/fixtures/paginate-multiblog-app/config.rb +31 -0
  50. data/fixtures/paginate-multiblog-app/source/blog1/2011-01-01-test-article.html.markdown +6 -0
  51. data/fixtures/paginate-multiblog-app/source/blog1/2011-01-02-test-article.html.markdown +6 -0
  52. data/fixtures/paginate-multiblog-app/source/blog1/2011-01-03-test-article.html.markdown +6 -0
  53. data/fixtures/paginate-multiblog-app/source/blog1/2011-01-04-test-article.html.markdown +6 -0
  54. data/fixtures/paginate-multiblog-app/source/blog1/2011-01-05-test-article.html.markdown +6 -0
  55. data/fixtures/paginate-multiblog-app/source/blog1/2011-02-01-test-article.html.markdown +6 -0
  56. data/fixtures/paginate-multiblog-app/source/blog1/index.html.erb +27 -0
  57. data/fixtures/paginate-multiblog-app/source/blog2/2011-01-01-test-article.html.markdown +6 -0
  58. data/fixtures/paginate-multiblog-app/source/blog2/2011-01-02-test-article.html.markdown +6 -0
  59. data/fixtures/paginate-multiblog-app/source/blog2/2011-01-03-test-article.html.markdown +6 -0
  60. data/fixtures/paginate-multiblog-app/source/blog2/2011-01-04-test-article.html.markdown +6 -0
  61. data/fixtures/paginate-multiblog-app/source/blog2/2011-01-05-test-article.html.markdown +6 -0
  62. data/fixtures/paginate-multiblog-app/source/blog2/index.html.erb +27 -0
  63. data/fixtures/paginate-multiblog-app/source/blog3/2011-01-01-test-article.html.markdown +6 -0
  64. data/fixtures/paginate-multiblog-app/source/blog3/2011-01-02-test-article.html.markdown +6 -0
  65. data/fixtures/paginate-multiblog-app/source/blog3/2011-01-03-test-article.html.markdown +6 -0
  66. data/fixtures/paginate-multiblog-app/source/blog3/2011-01-04-test-article.html.markdown +6 -0
  67. data/fixtures/paginate-multiblog-app/source/blog3/2011-01-05-test-article.html.markdown +6 -0
  68. data/fixtures/paginate-multiblog-app/source/blog3/2011-02-01-test-article.html.markdown +6 -0
  69. data/fixtures/paginate-multiblog-app/source/blog3/2011-02-02-test-article.html.markdown +6 -0
  70. data/fixtures/paginate-multiblog-app/source/blog3/index.html.erb +28 -0
  71. data/fixtures/paginate-multiblog-app/source/calendar1.html.erb +28 -0
  72. data/fixtures/paginate-multiblog-app/source/calendar2.html.erb +28 -0
  73. data/fixtures/paginate-multiblog-app/source/calendar3.html.erb +28 -0
  74. data/fixtures/paginate-multiblog-app/source/layout.erb +15 -0
  75. data/fixtures/paginate-multiblog-app/source/tag1.html.erb +23 -0
  76. data/fixtures/paginate-multiblog-app/source/tag2.html.erb +23 -0
  77. data/fixtures/paginate-multiblog-app/source/tag3.html.erb +19 -0
  78. data/fixtures/summary-app/config.rb +1 -0
  79. data/fixtures/summary-app/source/2011-01-01-article-with-no-summary-separator-and-comments-in-the-summary.html.erb +10 -0
  80. data/fixtures/summary-app/source/2011-01-01-article-with-standard-summary-separator.html.markdown +7 -0
  81. data/fixtures/summary-app/source/2012-06-19-article-with-no-summary-separator.html.markdown +9 -0
  82. data/fixtures/summary-app/source/2013-05-08-article-with-custom-separator.html.markdown +7 -0
  83. data/fixtures/summary-app/source/index.html.erb +5 -0
  84. data/fixtures/tags-multiblog-app/config.rb +15 -0
  85. data/fixtures/tags-multiblog-app/source/blog1/2011-01-01-new-article.html.markdown +7 -0
  86. data/fixtures/tags-multiblog-app/source/blog1/2011-01-02-another-article.html.markdown +9 -0
  87. data/fixtures/tags-multiblog-app/source/blog2/2011-01-01-new-article.html.markdown +7 -0
  88. data/fixtures/tags-multiblog-app/source/blog2/2011-01-02-another-article.html.markdown +9 -0
  89. data/fixtures/tags-multiblog-app/source/index.html.erb +8 -0
  90. data/fixtures/tags-multiblog-app/source/layout.erb +13 -0
  91. data/fixtures/tags-multiblog-app/source/tag1.html.erb +7 -0
  92. data/fixtures/tags-multiblog-app/source/tag2.html.erb +7 -0
  93. data/fixtures/time-zone-app/config.rb +5 -0
  94. data/fixtures/time-zone-app/source/blog/2013-06-24-hello.html.erb +5 -0
  95. data/lib/middleman-blog.rb +9 -4
  96. data/lib/middleman-blog/blog_article.rb +47 -21
  97. data/lib/middleman-blog/blog_data.rb +11 -4
  98. data/lib/middleman-blog/calendar_pages.rb +40 -25
  99. data/lib/middleman-blog/{extension.rb → extension_3_0.rb} +20 -16
  100. data/lib/middleman-blog/extension_3_1.rb +208 -0
  101. data/lib/middleman-blog/paginator.rb +33 -7
  102. data/lib/middleman-blog/tag_pages.rb +26 -9
  103. data/lib/middleman-blog/template/shared/Gemfile.tt +4 -2
  104. data/lib/middleman-blog/template/source/calendar.html.erb +1 -1
  105. data/lib/middleman-blog/template/source/feed.xml.builder +8 -7
  106. data/lib/middleman-blog/template/source/index.html.erb +1 -1
  107. data/lib/middleman-blog/template/source/tag.html.erb +1 -1
  108. data/lib/middleman-blog/truncate_html.rb +10 -1
  109. data/lib/middleman-blog/version.rb +1 -1
  110. data/middleman-blog.gemspec +12 -15
  111. metadata +180 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 307641a41396030f5930374adc6ccd8016e4fcd3
4
- data.tar.gz: 4fceaaa05d6742597a5f281192da389ab70da601
3
+ metadata.gz: 1263e95335ae87696662040be1d7ccfdf24570c4
4
+ data.tar.gz: dc2e80fe5ab676711441c0b69b516df06e8b9c04
5
5
  SHA512:
6
- metadata.gz: a06536de8efae6ee8df31ec992d7f8c19b3f82506eff011050eb5ec39dd4fc0f7989bdcad6985787de2381f593ded44f5e9e564f8a38c5a0b4eddb66a0213149
7
- data.tar.gz: bb6d528615b52afcd59c976f8d1f93fe7fadc521d989894f270db7cb45524af94686e535732d22cea399a0b7485dc9ce79f5b9ccf380c1dcc28336513dd3def8
6
+ metadata.gz: 066c202dd003d01b12ff4a06feb4dc9dba7fc04feba63a66c5fa1c3d7e5c9637a971c0f4dcef6be2f737fe6b9eb051c8ac1bb2c18599f6f450b9d0de51cc9677
7
+ data.tar.gz: 2a2e7c2332d3beb2132103cc12ee3ebe5769f50b19cb438ae67481925b6bebad26b37902593a5e5316b0ee41ad2dedc80fb4f4908034e9ed5c08aca115bfe1dd
data/.gitignore CHANGED
@@ -1,11 +1,14 @@
1
1
  *.gem
2
2
  .bundle
3
- Gemfile.lock
3
+ Gemfile*.lock
4
4
  pkg/*
5
5
  .rvmrc
6
6
  .DS_Store
7
7
  .rbenv-version
8
+ .ruby-version
8
9
  tmp
9
10
  doc
10
11
  .yardoc
11
12
  build/
13
+ .sass-cache
14
+ coverage
data/.travis.yml CHANGED
@@ -1,16 +1,14 @@
1
1
  rvm:
2
2
  - 1.8.7
3
- - 1.9.2
4
3
  - 1.9.3
5
4
  - 2.0.0
6
5
  - jruby-18mode
7
6
  - jruby-19mode
8
7
 
9
- script: "bundle exec rake test"
8
+ gemfile:
9
+ - Gemfile
10
+ - Gemfile-3.0
10
11
 
11
- env: TEST=true
12
+ script: "bundle exec rake test"
12
13
 
13
- matrix:
14
- allow_failures:
15
- - rvm: jruby-18mode
16
- - rvm: jruby-19mode
14
+ env: TEST=true
data/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ master
2
+ ===
3
+
4
+ * Experimental support for multiple blogs in a single site by activating
5
+ `:blog` multiple times.
6
+ * Works as a Middleman 3.1-style extension.
7
+ * Add `:blog_name`, `:blog_author`, `:blog_avatar` options and a `page_title` helper
8
+ that incorporates `:blog_name`.
9
+ * Allow options.sources to contain the same date component multiple
10
+ times. #112
11
+ * Improve `feed.xml.builder` template to support `blog.prefix`. #126
12
+ * Hide page numbers in template if only one page per index. #125
13
+ * URLs in the feed.xml template are now absolute. #130
14
+ * ASCII-8BIT text is reencoded to UTF-8 to avoid Nokogiri problems when
15
+ generating summaries.
16
+ * `summary` will no longer explode when encountering comments in the
17
+ article. #136
18
+ * Fix setting time zone with `set :time_zone` in `config.rb`. #140
19
+ * Articles can omit their :title from the filename and specify it in frontmatter
20
+ instead. #148
21
+
1
22
  3.2.0
2
23
  ====
3
24
 
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,43 @@
1
+ # Contributing
2
+ In the spirit of [free software][free-sw], **everyone** is encouraged to help
3
+ improve this project.
4
+
5
+ [free-sw]: http://www.fsf.org/licensing/essays/free-sw.html
6
+
7
+ Here are some ways *you* can contribute:
8
+
9
+ * by using alpha, beta, and prerelease versions
10
+ * by reporting bugs
11
+ * by suggesting new features
12
+ * by writing or editing documentation
13
+ * by writing specifications
14
+ * by writing code ( **no patch is too small** : fix typos, add comments, clean up inconsistent whitespace )
15
+ * by refactoring code
16
+ * by closing [issues][]
17
+ * by reviewing patches
18
+
19
+ [issues]: https://github.com/middleman/middleman-blog/issues
20
+
21
+ ## Submitting an Issue
22
+ We use the [GitHub issue tracker][issues] to track bugs and features. Before
23
+ submitting a bug report or feature request, check to make sure it hasn't
24
+ already been submitted. When submitting a bug report, please include a [Gist][]
25
+ that includes a stack trace and any details that may be necessary to reproduce
26
+ the bug, including your gem version, Ruby version, and operating system.
27
+ Ideally, a bug report should include a pull request with failing specs.
28
+
29
+ [gist]: https://gist.github.com/
30
+
31
+ ## Submitting a Pull Request
32
+ 1. [Fork the repository.][fork]
33
+ 2. [Create a topic branch.][branch]
34
+ 3. Add specs for your unimplemented feature or bug fix.
35
+ 4. Run `bundle exec rake test`. If your specs pass, return to step 3.
36
+ 5. Implement your feature or bug fix.
37
+ 6. Run `bundle exec rake test`. If your specs fail, return to step 5.
38
+ 7. Add, commit, and push your changes.
39
+ 8. [Submit a pull request.][pr]
40
+
41
+ [fork]: http://help.github.com/fork-a-repo/
42
+ [branch]: http://learn.github.com/p/branching.html
43
+ [pr]: http://help.github.com/send-pull-requests/
data/Gemfile CHANGED
@@ -1,25 +1,33 @@
1
- source 'http://rubygems.org'
1
+ source 'https://rubygems.org'
2
2
 
3
- git "git://github.com/middleman/middleman.git", :branch => "master" do
4
- # gem "middleman"
5
- gem "middleman-core"
6
- gem "middleman-more"
7
- end
3
+ gem "middleman-core", :github => "middleman/middleman"
4
+ gem "middleman-more", :github => "middleman/middleman"
8
5
 
9
6
  # Specify your gem's dependencies in middleman-blog.gemspec
10
7
  gemspec
11
8
 
12
- gem "rake", "~> 0.9.2"
13
- gem "rdoc", "~> 3.9"
14
- gem "yard", "~> 0.8.0"
9
+ gem "rake", "~> 10.0.3", :require => false
10
+ gem "yard", "~> 0.8.0", :require => false
15
11
 
16
- gem "cucumber", "~> 1.2.0"
12
+ # Test tools
13
+ gem "cucumber", "~> 1.3.1"
17
14
  gem "fivemat"
18
- gem "aruba", "~> 0.4.11"
19
- gem "rspec", "~> 2.7"
15
+ gem "aruba", "~> 0.5.1"
16
+ gem "rspec", "~> 2.12"
17
+ gem "simplecov"
18
+
20
19
  gem "timecop", "~> 0.4.0"
21
- gem "nokogiri"
20
+ gem "nokogiri", "~> 1.6.0"
21
+ gem "kramdown"
22
+
23
+ # Code Quality
24
+ gem "cane", :platforms => [:mri_19, :mri_20], :require => false
22
25
 
23
26
  platforms :ruby do
24
- gem "redcarpet", "~> 2.1.1"
27
+ gem "redcarpet", /^1\.8/.match(RUBY_VERSION) ? "~> 2.0" : "~> 3.0"
28
+ end
29
+
30
+ # Cross-templating language block fix for Ruby 1.8
31
+ platforms :mri_18 do
32
+ gem "ruby18_source_location"
25
33
  end
data/Gemfile-3.0 ADDED
@@ -0,0 +1,27 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in middleman-blog.gemspec
4
+ gemspec
5
+
6
+ gem "middleman", "~> 3.0.0"
7
+
8
+ gem "rake", "~> 10.0.3", :require => false
9
+ gem "yard", "~> 0.8.0", :require => false
10
+
11
+ # Test tools
12
+ gem "cucumber", "~> 1.3.1"
13
+ gem "fivemat"
14
+ gem "aruba", "~> 0.5.1"
15
+ gem "rspec", "~> 2.12"
16
+ gem "simplecov"
17
+
18
+ gem "timecop", "~> 0.4.0"
19
+ gem "nokogiri", "~> 1.6.0"
20
+ gem "kramdown"
21
+
22
+ # Code Quality
23
+ gem "cane", :platforms => [:mri_19, :mri_20], :require => false
24
+
25
+ platforms :ruby do
26
+ gem "redcarpet", "~> 2.3.0"
27
+ end
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 Thomas Reynolds
1
+ Copyright (c) 2010-2013 Thomas Reynolds
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
17
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
18
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
19
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,61 +1,66 @@
1
- # middleman-blog
1
+ # Middleman-Blog
2
2
 
3
- middleman-blog is an extension for the [Middleman](http://middlemanapp.com) static site generator that adds blog-specific functionality. This includes handling blog articles, helpers for listing articles, and tagging support.
3
+ `middleman-blog` is an extension for the [Middleman] static site generator that adds blog-specific functionality. This includes handling blog articles, helpers for listing articles, and tagging support.
4
4
 
5
- # Install
6
- If you're just getting started, install the `middleman` and `middleman-blog` gems and generate a new project:
5
+ ## Installation
6
+
7
+ If you're just getting started, install the `middleman` gem and generate a new project:
7
8
 
8
9
  ```
9
10
  gem install middleman
10
- gem install middleman-blog
11
- middleman init MY_BLOG_PROJECT --template=blog
11
+ middleman init MY_PROJECT
12
12
  ```
13
13
 
14
- If you already have a Middleman project:
15
- Add `middleman-blog` to your `Gemfile`, and open your `config.rb` and add:
14
+ If you already have a Middleman project: Add `gem "middleman-blog"` to your `Gemfile` and run `bundle install`
15
+
16
+ ## Configuration
16
17
 
17
18
  ```
18
19
  activate :blog
19
20
  ```
20
21
 
21
- # Learn More
22
+ ## Learn More
22
23
 
23
24
  See [the blog extension guide](http://middlemanapp.com/blogging/) for detailed information on configuring and using the blog extension.
24
25
 
25
- Up-to-date generated code documentation is available on RubyDoc:
26
- http://rubydoc.info/github/middleman/middleman-blog
27
-
28
- # Community
29
-
30
- The official community forum is available at:
26
+ Additionally, up-to-date generated code documentation is available on [RubyDoc].
31
27
 
32
- http://forum.middlemanapp.com/
28
+ ## Build & Dependency Status
33
29
 
34
- # Bug Reports
30
+ [![Gem Version](https://badge.fury.io/rb/middleman-blog.png)][gem]
31
+ [![Build Status](https://travis-ci.org/middleman/middleman-blog.png)][travis]
32
+ [![Dependency Status](https://gemnasium.com/middleman/middleman-blog.png?travis)][gemnasium]
33
+ [![Code Quality](https://codeclimate.com/github/middleman/middleman-blog.png)][codeclimate]
35
34
 
36
- GitHub Issues are used for managing bug reports and feature requests. If you run into issues, please search the issues and submit new problems:
35
+ ## Community
37
36
 
38
- https://github.com/middleman/middleman-blog/issues
37
+ The official community forum is available at: http://forum.middlemanapp.com
39
38
 
40
- The best way to get quick responses to your issues and swift fixes to your bugs is to submit detailed bug reports, include test cases and respond to developer questions in a timely manner. Even better, if you know Ruby, you can submit Pull Requests containing Cucumber Features which describe how your feature should work or exploit the bug you are submitting.
39
+ ## Bug Reports
41
40
 
42
- # Build & Dependency Status
41
+ Github Issues are used for managing bug reports and feature requests. If you run into issues, please search the issues and submit new problems: https://github.com/middleman/middleman-blog/issues
43
42
 
44
- [![Build Status](https://travis-ci.org/middleman/middleman-blog.png)](https://travis-ci.org/middleman/middleman-blog)
43
+ The best way to get quick responses to your issues and swift fixes to your bugs is to submit detailed bug reports, include test cases and respond to developer questions in a timely manner. Even better, if you know Ruby, you can submit [Pull Requests](https://help.github.com/articles/using-pull-requests) containing Cucumber Features which describe how your feature should work or exploit the bug you are submitting.
45
44
 
46
- # How to Run Cucumber Tests
45
+ ## How to Run Cucumber Tests
47
46
 
48
47
  1. Checkout Repository: `git clone https://github.com/middleman/middleman-blog.git`
49
48
  2. Install Bundler: `gem install bundler`
50
49
  3. Run `bundle install` inside the project root to install the gem dependencies.
51
50
  4. Run test cases: `bundle exec rake test`
52
51
 
53
- # Donate
52
+ ## Donate
54
53
 
55
- Please, [help support the Middleman team with a donation](https://spb.io/s/4dXbHBorC3).
54
+ [Click here to lend your support to Middleman](https://spacebox.io/s/4dXbHBorC3)
56
55
 
57
- # License
56
+ ## License
58
57
 
59
- Copyright (c) 2010 Thomas Reynolds. MIT Licensed, see [LICENSE] for details.
58
+ Copyright (c) 2010-2013 Thomas Reynolds. MIT Licensed, see [LICENSE] for details.
60
59
 
61
- [LICENSE]: https://github.com/middleman/middleman-blog/blob/master/LICENSE
60
+ [middleman]: http://middlemanapp.com
61
+ [gem]: https://rubygems.org/gems/middleman-blog
62
+ [travis]: http://travis-ci.org/middleman/middleman-blog
63
+ [gemnasium]: https://gemnasium.com/middleman/middleman-blog
64
+ [codeclimate]: https://codeclimate.com/github/middleman/middleman-blog
65
+ [rubydoc]: http://rubydoc.info/github/middleman/middleman-blog
66
+ [LICENSE]: https://github.com/middleman/middleman-blog/blob/master/LICENSE.md
data/Rakefile CHANGED
@@ -3,11 +3,14 @@ Bundler::GemHelper.install_tasks
3
3
 
4
4
  require 'cucumber/rake/task'
5
5
 
6
+ require 'middleman-core'
7
+
6
8
  Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
7
9
  ENV["TEST"] = "true"
8
10
 
9
11
  exempt_tags = ""
10
- exempt_tags << "--tags ~@nojava" if RUBY_PLATFORM == "java"
12
+ exempt_tags << "--tags ~@nojava " if RUBY_PLATFORM == "java"
13
+ exempt_tags << "--tags ~@three_one " unless ::Middleman::VERSION.match(/^3\.1\./)
11
14
 
12
15
  t.cucumber_opts = "--color --tags ~@wip #{exempt_tags} --strict --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'}"
13
16
  end
@@ -16,6 +19,19 @@ require 'rake/clean'
16
19
 
17
20
  task :test => ["cucumber"]
18
21
 
22
+ begin
23
+ require 'cane/rake_task'
24
+
25
+ desc "Run cane to check quality metrics"
26
+ Cane::RakeTask.new(:quality) do |cane|
27
+ cane.no_style = true
28
+ cane.no_doc = true
29
+ cane.abc_glob = "lib/middleman-blog/**/*.rb"
30
+ end
31
+ rescue LoadError
32
+ # warn "cane not available, quality task not provided."
33
+ end
34
+
19
35
  desc "Build HTML documentation"
20
36
  task :doc do
21
37
  sh 'bundle exec yard'
@@ -12,3 +12,16 @@ Feature: Flexible article sources
12
12
  Given the Server is running at "no-day-app"
13
13
  When I go to "/2012/08/01/testing.html"
14
14
  Then I should see "Testing Article"
15
+
16
+ Scenario: Blog article sources can omit the title part
17
+ Given the Server is running at "no-title-app"
18
+ When I go to "/2013/08/07/testing-article.html"
19
+ Then I should see "Testing Article"
20
+
21
+ Scenario: Slug can be specified in frontmatter
22
+ Given the Server is running at "no-title-app"
23
+ When I go to "/2013/08/08/slug-from-frontmatter.html"
24
+ Then I should see "Article with slug specified in frontmatter"
25
+ Given the Server is running at "blog-sources-app"
26
+ When I go to "/2013/08/08/slug-from-frontmatter.html"
27
+ Then I should see "Article with slug specified in frontmatter"
@@ -0,0 +1,153 @@
1
+ @three_one
2
+
3
+ Feature: Calendar pages
4
+ Scenario: Calendar pages are accessible from preview server
5
+ Given the Server is running at "calendar-multiblog-app"
6
+ When I go to "/blog1/2011/01/01.html"
7
+ Then I should see "/blog1/2011-01-01-new-article.html"
8
+ Then I should not see "/blog1/2011-01-02-another-article.html"
9
+ Then I should not see "/blog2/2011-01-01-new-article.html"
10
+ Then I should see "Year1: '2011'"
11
+ Then I should see "Month1: '1'"
12
+ Then I should see "Day1: '1'"
13
+ When I go to "/blog2/2011/01/01.html"
14
+ Then I should see "/blog2/2011-01-01-new-article.html"
15
+ Then I should not see "/blog2/2011-01-02-another-article.html"
16
+ Then I should not see "/blog1/2011-01-01-new-article.html"
17
+ Then I should see "Year2: '2011'"
18
+ Then I should see "Month2: '1'"
19
+ Then I should see "Day2: '1'"
20
+
21
+ When I go to "/blog1/2011/01/02.html"
22
+ Then I should not see "/blog1/2011-01-01-new-article.html"
23
+ Then I should see "/blog1/2011-01-02-another-article.html"
24
+ Then I should not see "/blog2/2011-01-02-another-article.html"
25
+ Then I should see "Year1: '2011'"
26
+ Then I should see "Month1: '1'"
27
+ Then I should see "Day1: '2'"
28
+ When I go to "/blog2/2011/01/02.html"
29
+ Then I should not see "/blog2/2011-01-01-new-article.html"
30
+ Then I should see "/blog2/2011-01-02-another-article.html"
31
+ Then I should not see "/blog1/2011-01-02-another-article.html"
32
+ Then I should see "Year2: '2011'"
33
+ Then I should see "Month2: '1'"
34
+ Then I should see "Day2: '2'"
35
+
36
+ When I go to "/blog1/2011/01.html"
37
+ Then I should see "/blog1/2011-01-01-new-article.html"
38
+ Then I should see "/blog1/2011-01-02-another-article.html"
39
+ Then I should not see "/blog2/2011-01-01-new-article.html"
40
+ Then I should not see "/blog2/2011-01-02-another-article.html"
41
+ Then I should see "Year1: '2011'"
42
+ Then I should see "Month1: '1'"
43
+ Then I should see "Day1: ''"
44
+ When I go to "/blog2/2011/01.html"
45
+ Then I should see "/blog2/2011-01-01-new-article.html"
46
+ Then I should see "/blog2/2011-01-02-another-article.html"
47
+ Then I should not see "/blog1/2011-01-01-new-article.html"
48
+ Then I should not see "/blog1/2011-01-02-another-article.html"
49
+ Then I should see "Year2: '2011'"
50
+ Then I should see "Month2: '1'"
51
+ Then I should see "Day2: ''"
52
+
53
+ When I go to "/blog1/2011.html"
54
+ Then I should see "/blog1/2011-01-01-new-article.html"
55
+ Then I should see "/blog1/2011-01-02-another-article.html"
56
+ Then I should not see "/blog2/2011-01-01-new-article.html"
57
+ Then I should not see "/blog2/2011-01-02-another-article.html"
58
+ Then I should see "Year1: '2011'"
59
+ Then I should see "Month1: ''"
60
+ Then I should see "Day1: ''"
61
+ When I go to "/blog2/2011.html"
62
+ Then I should see "/blog2/2011-01-01-new-article.html"
63
+ Then I should see "/blog2/2011-01-02-another-article.html"
64
+ Then I should not see "/blog1/2011-01-01-new-article.html"
65
+ Then I should not see "/blog1/2011-01-02-another-article.html"
66
+ Then I should see "Year2: '2011'"
67
+ Then I should see "Month2: ''"
68
+ Then I should see "Day2: ''"
69
+
70
+ When I go to "/index.html"
71
+ Then I should see "Year Path1: '/blog1/2011.html'"
72
+ Then I should see "Month Path1: '/blog1/2011/01.html'"
73
+ Then I should see "Day Path1: '/blog1/2011/01/01.html'"
74
+ Then I should see "Year Path2: '/blog2/2011.html'"
75
+ Then I should see "Month Path2: '/blog2/2011/01.html'"
76
+ Then I should see "Day Path2: '/blog2/2011/01/01.html'"
77
+
78
+ Scenario: Calendar pages also get built
79
+ Given a successfully built app at "calendar-multiblog-app"
80
+ When I cd to "build"
81
+ Then the following files should exist:
82
+ | blog1/2011.html |
83
+ | blog1/2011/01.html |
84
+ | blog1/2011/01/01.html |
85
+ | blog1/2011/01/02.html |
86
+ | blog2/2011.html |
87
+ | blog2/2011/01.html |
88
+ | blog2/2011/01/01.html |
89
+ | blog2/2011/01/02.html |
90
+
91
+ And the file "blog1/2011.html" should contain "/blog1/2011-01-01-new-article.html"
92
+ And the file "blog1/2011.html" should contain "/blog1/2011-01-02-another-article.html"
93
+ And the file "blog1/2011.html" should not contain "/blog2/2011-01-01-new-article.html"
94
+ And the file "blog1/2011.html" should not contain "/blog2/2011-01-02-another-article.html"
95
+ And the file "blog1/2011.html" should contain "Year1: '2011'"
96
+ And the file "blog1/2011.html" should contain "Month1: ''"
97
+ And the file "blog1/2011.html" should contain "Day1: ''"
98
+ And the file "blog2/2011.html" should contain "/blog2/2011-01-01-new-article.html"
99
+ And the file "blog2/2011.html" should contain "/blog2/2011-01-02-another-article.html"
100
+ And the file "blog2/2011.html" should not contain "/blog1/2011-01-01-new-article.html"
101
+ And the file "blog2/2011.html" should not contain "/blog1/2011-01-02-another-article.html"
102
+ And the file "blog2/2011.html" should contain "Year2: '2011'"
103
+ And the file "blog2/2011.html" should contain "Month2: ''"
104
+ And the file "blog2/2011.html" should contain "Day2: ''"
105
+
106
+ And the file "blog1/2011/01.html" should contain "/blog1/2011-01-01-new-article.html"
107
+ And the file "blog1/2011/01.html" should contain "/blog1/2011-01-02-another-article.html"
108
+ And the file "blog1/2011/01.html" should not contain "/blog2/2011-01-01-new-article.html"
109
+ And the file "blog1/2011/01.html" should not contain "/blog2/2011-01-02-another-article.html"
110
+ And the file "blog1/2011/01.html" should contain "Year1: '2011'"
111
+ And the file "blog1/2011/01.html" should contain "Month1: '1'"
112
+ And the file "blog1/2011/01.html" should contain "Day1: ''"
113
+ And the file "blog2/2011/01.html" should contain "/blog2/2011-01-01-new-article.html"
114
+ And the file "blog2/2011/01.html" should contain "/blog2/2011-01-02-another-article.html"
115
+ And the file "blog2/2011/01.html" should not contain "/blog1/2011-01-01-new-article.html"
116
+ And the file "blog2/2011/01.html" should not contain "/blog1/2011-01-02-another-article.html"
117
+ And the file "blog2/2011/01.html" should contain "Year2: '2011'"
118
+ And the file "blog2/2011/01.html" should contain "Month2: '1'"
119
+ And the file "blog2/2011/01.html" should contain "Day2: ''"
120
+
121
+ And the file "blog1/2011/01/01.html" should contain "/blog1/2011-01-01-new-article.html"
122
+ And the file "blog1/2011/01/01.html" should not contain "/blog1/2011-01-02-another-article.html"
123
+ And the file "blog1/2011/01/01.html" should not contain "/blog2/2011-01-01-new-article.html"
124
+ And the file "blog1/2011/01/01.html" should contain "Year1: '2011'"
125
+ And the file "blog1/2011/01/01.html" should contain "Month1: '1'"
126
+ And the file "blog1/2011/01/01.html" should contain "Day1: '1'"
127
+ And the file "blog2/2011/01/01.html" should contain "/blog2/2011-01-01-new-article.html"
128
+ And the file "blog2/2011/01/01.html" should not contain "/blog2/2011-01-02-another-article.html"
129
+ And the file "blog2/2011/01/01.html" should not contain "/blog1/2011-01-01-new-article.html"
130
+ And the file "blog2/2011/01/01.html" should contain "Year2: '2011'"
131
+ And the file "blog2/2011/01/01.html" should contain "Month2: '1'"
132
+ And the file "blog2/2011/01/01.html" should contain "Day2: '1'"
133
+
134
+ And the file "blog1/2011/01/02.html" should not contain "/blog1/2011-01-01-new-article.html"
135
+ And the file "blog1/2011/01/02.html" should contain "/blog1/2011-01-02-another-article.html"
136
+ And the file "blog1/2011/01/02.html" should not contain "/blog2/2011-01-01-new-article.html"
137
+ And the file "blog1/2011/01/02.html" should contain "Year1: '2011'"
138
+ And the file "blog1/2011/01/02.html" should contain "Month1: '1'"
139
+ And the file "blog1/2011/01/02.html" should contain "Day1: '2'"
140
+ And the file "blog2/2011/01/02.html" should not contain "/blog2/2011-01-01-new-article.html"
141
+ And the file "blog2/2011/01/02.html" should contain "/blog2/2011-01-02-another-article.html"
142
+ And the file "blog2/2011/01/02.html" should not contain "/blog1/2011-01-01-new-article.html"
143
+ And the file "blog2/2011/01/02.html" should contain "Year2: '2011'"
144
+ And the file "blog2/2011/01/02.html" should contain "Month2: '1'"
145
+ And the file "blog2/2011/01/02.html" should contain "Day2: '2'"
146
+
147
+ And the file "index.html" should contain "Year Path1: '/blog1/2011.html'"
148
+ And the file "index.html" should contain "Month Path1: '/blog1/2011/01.html'"
149
+ And the file "index.html" should contain "Day Path1: '/blog1/2011/01/01.html'"
150
+ And the file "index.html" should contain "Year Path2: '/blog2/2011.html'"
151
+ And the file "index.html" should contain "Month Path2: '/blog2/2011/01.html'"
152
+ And the file "index.html" should contain "Day Path2: '/blog2/2011/01/01.html'"
153
+