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
@@ -0,0 +1,51 @@
1
+ @three_one
2
+
3
+ Feature: Host Multiple Blogs with Middleman 3.1+
4
+
5
+ Scenario: Preview
6
+ Given a fixture app "multiblog-app"
7
+ And a file named "config.rb" with:
8
+ """
9
+ activate :blog, :name => "blog_number_1", :prefix => "blog1", :sources => ":year-:month-:day-:title.html"
10
+
11
+ activate :blog do |blog|
12
+ blog.name = "blog_number_2"
13
+ blog.prefix = "blog2"
14
+ blog.sources = ":year/:month/:day/:title.html"
15
+ end
16
+ """
17
+ Given the Server is running
18
+ When I go to "/blog1/2012/12/12/other-article.html"
19
+ Then I should see "Other Article Content"
20
+ When I go to "/blog2/2011/01/01/new-article.html"
21
+ Then I should see "Newer Article Content"
22
+ When I go to "/index.html"
23
+ Then I should see "blog_number_1 length: 1"
24
+ Then I should see "blog_number_1 title: Other Article"
25
+ Then I should see "blog_number_2 length: 1"
26
+ Then I should see "blog_number_2 title: Newer Article"
27
+
28
+ Scenario: Build
29
+ Given a fixture app "multiblog-app"
30
+ And a file named "config.rb" with:
31
+ """
32
+ activate :blog, :name => "blog_number_1", :prefix => "blog1", :sources => ":year-:month-:day-:title.html"
33
+
34
+ activate :blog do |blog|
35
+ blog.name = "blog_number_2"
36
+ blog.prefix = "blog2"
37
+ blog.sources = ":year/:month/:day/:title.html"
38
+ end
39
+ """
40
+ Given a successfully built app at "multiblog-app"
41
+ When I cd to "build"
42
+ Then the following files should exist:
43
+ | blog1/2012/12/12/other-article.html |
44
+ | blog2/2011/01/01/new-article.html |
45
+
46
+ And the file "blog1/2012/12/12/other-article.html" should contain "Other Article Content"
47
+ And the file "blog2/2011/01/01/new-article.html" should contain "Newer Article Content"
48
+ And the file "index.html" should contain "blog_number_1 length: 1"
49
+ And the file "index.html" should contain "blog_number_1 title: Other Article"
50
+ And the file "index.html" should contain "blog_number_2 length: 1"
51
+ And the file "index.html" should contain "blog_number_2 title: Newer Article"
@@ -0,0 +1,270 @@
1
+ @three_one
2
+
3
+ Feature: Pagination with Multiblog
4
+ Scenario: Index pages are accessible from preview server
5
+ Given the Server is running at "paginate-multiblog-app"
6
+ When I go to "/blog1/index.html"
7
+ Then I should see "Paginate1: true"
8
+ Then I should see "Article Count1: 5"
9
+ Then I should see "Page Num1: 1"
10
+ Then I should see "Num Pages1: 2"
11
+ Then I should see "Per Page1: 5"
12
+ Then I should see "Page Start1: 1"
13
+ Then I should see "Page End1: 5"
14
+ Then I should see "Next Page1: '/blog1/page/2/'"
15
+ Then I should see "Prev Page1: ''"
16
+ Then I should not see "/blog1/2011-01-01-test-article.html"
17
+ Then I should see "/blog1/2011-01-02-test-article.html"
18
+ Then I should see "/blog1/2011-01-03-test-article.html"
19
+ Then I should see "/blog1/2011-01-04-test-article.html"
20
+ Then I should see "/blog1/2011-01-05-test-article.html"
21
+ Then I should see "/blog1/2011-02-01-test-article.html"
22
+ Then I should not see "/blog2/2011-01-01-test-article.html"
23
+ Then I should not see "/blog2/2011-01-02-test-article.html"
24
+ Then I should not see "/blog2/2011-01-03-test-article.html"
25
+ Then I should not see "/blog2/2011-01-04-test-article.html"
26
+ Then I should not see "/blog2/2011-01-05-test-article.html"
27
+
28
+ When I go to "/blog2/index.html"
29
+ Then I should see "Paginate2: true"
30
+ Then I should see "Article Count2: 3"
31
+ Then I should see "Page Num2: 1"
32
+ Then I should see "Num Pages2: 2"
33
+ Then I should see "Per Page2: 3"
34
+ Then I should see "Page Start2: 1"
35
+ Then I should see "Page End2: 3"
36
+ Then I should see "Next Page2: '/blog2/page/2/'"
37
+ Then I should see "Prev Page2: ''"
38
+ Then I should not see "/blog2/2011-01-01-test-article.html"
39
+ Then I should not see "/blog2/2011-01-02-test-article.html"
40
+ Then I should see "/blog2/2011-01-03-test-article.html"
41
+ Then I should see "/blog2/2011-01-04-test-article.html"
42
+ Then I should see "/blog2/2011-01-05-test-article.html"
43
+ Then I should not see "/blog1/2011-01-02-test-article.html"
44
+ Then I should not see "/blog1/2011-01-03-test-article.html"
45
+ Then I should not see "/blog1/2011-01-04-test-article.html"
46
+ Then I should not see "/blog1/2011-01-05-test-article.html"
47
+ Then I should not see "/blog1/2011-02-01-test-article.html"
48
+
49
+ When I go to "/blog3/index.html"
50
+ Then I should see "Paginate3: false"
51
+ Then I should see "Article Count3: 7"
52
+ Then I should see "/blog3/2011-01-01-test-article.html"
53
+ Then I should see "/blog3/2011-01-02-test-article.html"
54
+ Then I should see "/blog3/2011-01-03-test-article.html"
55
+ Then I should see "/blog3/2011-01-04-test-article.html"
56
+ Then I should see "/blog3/2011-01-05-test-article.html"
57
+ Then I should see "/blog3/2011-02-01-test-article.html"
58
+ Then I should see "/blog3/2011-02-02-test-article.html"
59
+ Then I should not see "/blog1/2011-01-02-test-article.html"
60
+ Then I should not see "/blog1/2011-01-03-test-article.html"
61
+ Then I should not see "/blog1/2011-01-04-test-article.html"
62
+ Then I should not see "/blog1/2011-01-05-test-article.html"
63
+ Then I should not see "/blog1/2011-02-01-test-article.html"
64
+ Then I should not see "/blog2/2011-01-01-test-article.html"
65
+ Then I should not see "/blog2/2011-01-02-test-article.html"
66
+ Then I should not see "/blog2/2011-01-03-test-article.html"
67
+ Then I should not see "/blog2/2011-01-04-test-article.html"
68
+ Then I should not see "/blog2/2011-01-05-test-article.html"
69
+
70
+ When I go to "/blog1/page/2/index.html"
71
+ Then I should see "Article Count1: 1"
72
+ Then I should see "Page Num1: 2"
73
+ Then I should see "Page Start1: 6"
74
+ Then I should see "Page End1: 6"
75
+ Then I should see "Next Page1: ''"
76
+ Then I should see "Prev Page1: '/blog1/'"
77
+ Then I should see "/blog1/2011-01-01-test-article.html"
78
+ Then I should not see "/blog1/2011-01-02-test-article.html"
79
+ Then I should not see "/blog1/2011-01-03-test-article.html"
80
+ Then I should not see "/blog1/2011-01-04-test-article.html"
81
+ Then I should not see "/blog1/2011-01-05-test-article.html"
82
+ Then I should not see "/blog1/2011-02-01-test-article.html"
83
+
84
+ When I go to "/blog1/2011.html"
85
+ Then I should see "Paginate1: true"
86
+ Then I should see "Article Count1: 5"
87
+ Then I should see "Page Num1: 1"
88
+ Then I should see "Num Pages1: 2"
89
+ Then I should see "Per Page1: 5"
90
+ Then I should see "Page Start1: 1"
91
+ Then I should see "Page End1: 5"
92
+ Then I should see "Next Page1: '/blog1/2011/page/2.html'"
93
+ Then I should see "Prev Page1: ''"
94
+ Then I should not see "/blog1/2011-01-01-test-article.html"
95
+ Then I should see "/blog1/2011-01-02-test-article.html"
96
+ Then I should see "/blog1/2011-01-03-test-article.html"
97
+ Then I should see "/blog1/2011-01-04-test-article.html"
98
+ Then I should see "/blog1/2011-01-05-test-article.html"
99
+ Then I should see "/blog1/2011-02-01-test-article.html"
100
+ Then I should not see "/blog2/2011-01-01-test-article.html"
101
+ Then I should not see "/blog2/2011-01-02-test-article.html"
102
+ Then I should not see "/blog2/2011-01-03-test-article.html"
103
+ Then I should not see "/blog2/2011-01-04-test-article.html"
104
+ Then I should not see "/blog2/2011-01-05-test-article.html"
105
+
106
+ When I go to "/blog2/2011.html"
107
+ Then I should see "Paginate2: true"
108
+ Then I should see "Article Count2: 3"
109
+ Then I should see "Page Num2: 1"
110
+ Then I should see "Num Pages2: 2"
111
+ Then I should see "Per Page2: 3"
112
+ Then I should see "Page Start2: 1"
113
+ Then I should see "Page End2: 3"
114
+ Then I should see "Next Page2: '/blog2/2011/page/2.html'"
115
+ Then I should see "Prev Page2: ''"
116
+ Then I should not see "/blog2/2011-01-01-test-article.html"
117
+ Then I should not see "/blog2/2011-01-02-test-article.html"
118
+ Then I should see "/blog2/2011-01-03-test-article.html"
119
+ Then I should see "/blog2/2011-01-04-test-article.html"
120
+ Then I should see "/blog2/2011-01-05-test-article.html"
121
+ Then I should not see "/blog1/2011-01-02-test-article.html"
122
+ Then I should not see "/blog1/2011-01-03-test-article.html"
123
+ Then I should not see "/blog1/2011-01-04-test-article.html"
124
+ Then I should not see "/blog1/2011-01-05-test-article.html"
125
+ Then I should not see "/blog1/2011-02-01-test-article.html"
126
+
127
+ When I go to "/blog3/2011.html"
128
+ Then I should see "Paginate3: false"
129
+ Then I should see "Article Count3: 7"
130
+ Then I should see "/blog3/2011-01-01-test-article.html"
131
+ Then I should see "/blog3/2011-01-02-test-article.html"
132
+ Then I should see "/blog3/2011-01-03-test-article.html"
133
+ Then I should see "/blog3/2011-01-04-test-article.html"
134
+ Then I should see "/blog3/2011-01-05-test-article.html"
135
+ Then I should see "/blog3/2011-02-01-test-article.html"
136
+ Then I should see "/blog3/2011-02-02-test-article.html"
137
+ Then I should not see "/blog1/2011-01-02-test-article.html"
138
+ Then I should not see "/blog1/2011-01-03-test-article.html"
139
+ Then I should not see "/blog1/2011-01-04-test-article.html"
140
+ Then I should not see "/blog1/2011-01-05-test-article.html"
141
+ Then I should not see "/blog1/2011-02-01-test-article.html"
142
+ Then I should not see "/blog2/2011-01-01-test-article.html"
143
+ Then I should not see "/blog2/2011-01-02-test-article.html"
144
+ Then I should not see "/blog2/2011-01-03-test-article.html"
145
+ Then I should not see "/blog2/2011-01-04-test-article.html"
146
+ Then I should not see "/blog2/2011-01-05-test-article.html"
147
+
148
+ When I go to "/blog1/2011/page/2.html"
149
+ Then I should see "Article Count1: 1"
150
+ Then I should see "Page Num1: 2"
151
+ Then I should see "Page Start1: 6"
152
+ Then I should see "Page End1: 6"
153
+ Then I should see "Next Page1: ''"
154
+ Then I should see "Prev Page1: '/blog1/2011.html'"
155
+ Then I should see "/blog1/2011-01-01-test-article.html"
156
+ Then I should not see "/blog1/2011-01-02-test-article.html"
157
+ Then I should not see "/blog1/2011-01-03-test-article.html"
158
+ Then I should not see "/blog1/2011-01-04-test-article.html"
159
+ Then I should not see "/blog1/2011-01-05-test-article.html"
160
+ Then I should not see "/blog1/2011-02-01-test-article.html"
161
+
162
+ When I go to "/blog1/tags/bar.html"
163
+ Then I should see "Paginate1: true"
164
+ Then I should see "Article Count1: 2"
165
+ Then I should see "Page Num1: 1"
166
+ Then I should see "Num Pages1: 2"
167
+ Then I should see "Per Page1: 2"
168
+ Then I should see "Page Start1: 1"
169
+ Then I should see "Page End1: 2"
170
+ Then I should see "Next Page1: '/blog1/tags/bar/page/2.html'"
171
+ Then I should see "Prev Page1: ''"
172
+ Then I should see "/blog1/2011-02-01-test-article.html"
173
+ Then I should see "/blog1/2011-01-05-test-article.html"
174
+ Then I should not see "/blog1/2011-02-05-test-article.html"
175
+ Then I should not see "/blog1/2011-01-04-test-article.html"
176
+ Then I should not see "/blog1/2011-01-03-test-article.html"
177
+
178
+ When I go to "/blog2/tags/bar.html"
179
+ Then I should see "Paginate2: true"
180
+ Then I should see "Article Count2: 1"
181
+ Then I should see "Page Num2: 1"
182
+ Then I should see "Num Pages2: 3"
183
+ Then I should see "Per Page2: 1"
184
+ Then I should see "Page Start2: 1"
185
+ Then I should see "Page End2: 1"
186
+ Then I should see "Next Page2: '/blog2/tags/bar/page/2.html'"
187
+ Then I should see "Prev Page2: ''"
188
+ Then I should see "/blog2/2011-01-05-test-article.html"
189
+ Then I should not see "/blog2/2011-01-04-test-article.html"
190
+ Then I should not see "/blog2/2011-01-03-test-article.html"
191
+ Then I should not see "/blog2/2011-01-02-test-article.html"
192
+ Then I should not see "/blog2/2011-01-01-test-article.html"
193
+
194
+ Scenario: Index pages also get built
195
+ Given a successfully built app at "paginate-multiblog-app"
196
+ When I cd to "build"
197
+ Then the following files should exist:
198
+ | blog1/index.html |
199
+ | blog1/page/2/index.html |
200
+ | blog1/tags/foo.html |
201
+ | blog1/tags/bar.html |
202
+ | blog1/tags/bar/page/2.html |
203
+ | blog1/2011.html |
204
+ | blog1/2011/page/2.html |
205
+ | blog2/index.html |
206
+ | blog2/tags/foo.html |
207
+ | blog2/tags/bar.html |
208
+ | blog2/tags/bar/page/2.html |
209
+ | blog2/tags/bar/page/3.html |
210
+ | blog2/2011.html |
211
+ | blog2/2011/page/2.html |
212
+ Then the following files should not exist:
213
+ | tags1.html |
214
+ | calendar1.html |
215
+ | tags2.html |
216
+ | calendar2.html |
217
+ | tags3.html |
218
+ | calendar3.html |
219
+
220
+ And the file "blog1/2011/page/2.html" should contain "Year1: '2011'"
221
+ And the file "blog1/2011/page/2.html" should contain "Month1: ''"
222
+ And the file "blog1/2011/page/2.html" should contain "Day1: ''"
223
+ And the file "blog1/2011/page/2.html" should contain "Article Count1: 1"
224
+ And the file "blog1/2011/page/2.html" should contain "/blog1/2011-01-01-test-article.html"
225
+
226
+ And the file "blog1/tags/bar/page/2.html" should contain "Tag1: bar"
227
+ And the file "blog1/tags/bar/page/2.html" should contain "Article Count1: 2"
228
+ And the file "blog1/tags/bar/page/2.html" should contain "Prev Page1: '/blog1/tags/bar.html'"
229
+ And the file "blog1/tags/bar/page/2.html" should contain "Next Page1: ''"
230
+ And the file "blog1/tags/bar/page/2.html" should contain "/blog1/2011-01-04-test-article.html"
231
+ And the file "blog1/tags/bar/page/2.html" should contain "/blog1/2011-01-03-test-article.html"
232
+
233
+ And the file "blog2/2011/page/2.html" should contain "Year2: '2011'"
234
+ And the file "blog2/2011/page/2.html" should contain "Month2: ''"
235
+ And the file "blog2/2011/page/2.html" should contain "Day2: ''"
236
+ And the file "blog2/2011/page/2.html" should contain "Article Count2: 2"
237
+ And the file "blog2/2011/page/2.html" should contain "/blog2/2011-01-01-test-article.html"
238
+
239
+ And the file "blog2/tags/bar/page/3.html" should contain "Tag2: bar"
240
+ And the file "blog2/tags/bar/page/3.html" should contain "Article Count2: 1"
241
+ And the file "blog2/tags/bar/page/3.html" should contain "Prev Page2: '/blog2/tags/bar/page/2.html'"
242
+ And the file "blog2/tags/bar/page/3.html" should contain "Next Page2: ''"
243
+ And the file "blog2/tags/bar/page/3.html" should contain "/blog2/2011-01-03-test-article.html"
244
+
245
+ Scenario: Adding a tag to a post in preview adds a new index page
246
+ Given the Server is running at "paginate-multiblog-app"
247
+ When I go to "/blog1/tags/foo.html"
248
+ Then I should see "/blog1/2011-01-01-test-article.html"
249
+ Then I should see "Next Page1: ''"
250
+
251
+ When I go to "/blog1/tags/foo/page/2.html"
252
+ Then I should see "Not Found"
253
+
254
+ And the file "source/blog1/2011-02-03-new-article.html.markdown" has the contents
255
+ """
256
+ ---
257
+ title: "Newest Article"
258
+ date: 2011-02-03
259
+ tags: foo
260
+ ---
261
+
262
+ Newer Article Content
263
+ """
264
+ When I go to "/blog1/tags/foo.html"
265
+ Then I should see "Next Page1: '/blog1/tags/foo/page/2.html'"
266
+ Then I should see "/blog1/2011-02-03-new-article.html"
267
+ Then I should not see "/blog1/2011-01-01-test-article.html"
268
+
269
+ When I go to "/blog1/tags/foo/page/2.html"
270
+ Then I should see "/blog1/2011-01-01-test-article.html"
@@ -0,0 +1,43 @@
1
+ Feature: Article summary generation
2
+ Scenario: Article has no summary separator
3
+ Given the Server is running at "summary-app"
4
+ When I go to "/index.html"
5
+ Then I should see "Summary from article with separator."
6
+ Then I should not see "Extended part from article with separator."
7
+ Then I should see "Summary from article with no separator."
8
+ Then I should not see "Extended part from article with no separator."
9
+
10
+ Scenario: Article has custom summary separator
11
+ Given a fixture app "summary-app"
12
+ And a file named "config.rb" with:
13
+ """
14
+ activate :blog do |blog|
15
+ blog.summary_separator = /SPLIT_SUMMARY_BEFORE_THIS/
16
+ end
17
+ """
18
+ Given the Server is running at "summary-app"
19
+ When I go to "/index.html"
20
+ Then I should see "Summary from article with custom separator."
21
+ Then I should not see "Extended part from article with custom separator."
22
+ Then I should see "Extended part from article with separator."
23
+
24
+ Scenario: Using a custom summary generator
25
+ Given a fixture app "summary-app"
26
+ And a file named "config.rb" with:
27
+ """
28
+ activate :blog do |blog|
29
+ blog.summary_generator = Proc.new { "This is my summary, and I like it" }
30
+ end
31
+ """
32
+ Given the Server is running at "summary-app"
33
+ When I go to "/index.html"
34
+ Then I should see "This is my summary, and I like it"
35
+ Then I should see "Summary from article"
36
+ Then I should not see "Summary from article with no separator"
37
+ Then I should not see "Extended part from article"
38
+
39
+ Scenario: Article has comments in the summary and no summary separator
40
+ Given the Server is running at "summary-app"
41
+ When I go to "/index.html"
42
+ Then I should see "Summary from article with no summary separator and comments in the summary."
43
+ Then I should not see "Extended part from article from article with no summary separator and comments in the summary."
@@ -1,7 +1,12 @@
1
+ require 'simplecov'
2
+ SimpleCov.start do
3
+ add_filter "/features/"
4
+ end
5
+
1
6
  ENV["TEST"] = "true"
2
7
  ENV["AUTOLOAD_SPROCKETS"] = "false"
3
8
 
4
9
  PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
5
10
  require "middleman-core"
6
11
  require "middleman-core/step_definitions"
7
- require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-blog')
12
+ require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-blog')
@@ -0,0 +1,125 @@
1
+ @three_one
2
+
3
+ Feature: Tag pages with multiple blogs
4
+ Scenario: Tag pages are accessible from preview server
5
+ Given the Server is running at "tags-multiblog-app"
6
+ When I go to "/blog1/tags/foo1.html"
7
+ Then I should see "/blog1/2011-01-01-new-article.html"
8
+ Then I should see "/blog1/2011-01-02-another-article.html"
9
+ Then I should see "Tag1: foo1"
10
+ When I go to "/blog2/tags/foo2.html"
11
+ Then I should see "/blog2/2011-01-01-new-article.html"
12
+ Then I should see "/blog2/2011-01-02-another-article.html"
13
+ Then I should see "Tag2: foo2"
14
+ When I go to "/blog1/tags/bar1.html"
15
+ Then I should see "/blog1/2011-01-01-new-article.html"
16
+ Then I should not see "/blog1/2011-01-02-another-article.html"
17
+ Then I should see "Tag1: bar1"
18
+ When I go to "/blog2/tags/bar2.html"
19
+ Then I should see "/blog2/2011-01-01-new-article.html"
20
+ Then I should not see "/blog2/2011-01-02-another-article.html"
21
+ Then I should see "Tag2: bar2"
22
+ When I go to "/index.html"
23
+ Then I should see "Tag Path1: '/blog1/tags/foox.html'"
24
+ Then I should see "Tag Path2: '/blog2/tags/foox.html'"
25
+
26
+ Scenario: Tag pages also get built
27
+ Given a successfully built app at "tags-multiblog-app"
28
+ When I cd to "build"
29
+ Then the following files should exist:
30
+ | blog1/tags/foox.html |
31
+ | blog1/tags/barx.html |
32
+ | blog1/tags/foo1.html |
33
+ | blog1/tags/bar1.html |
34
+ | blog2/tags/foox.html |
35
+ | blog2/tags/barx.html |
36
+ | blog2/tags/foo2.html |
37
+ | blog2/tags/bar2.html |
38
+ Then the following files should not exist:
39
+ | tags1.html |
40
+ | tags2.html |
41
+
42
+ And the file "blog1/tags/foox.html" should contain "Tag1: fooX"
43
+ And the file "blog1/tags/foox.html" should contain "/blog1/2011-01-01-new-article.html"
44
+ And the file "blog1/tags/foox.html" should contain "/blog1/2011-01-02-another-article.html"
45
+ And the file "blog1/tags/foox.html" should not contain "/blog2/2011-01-01-new-article.html"
46
+ And the file "blog1/tags/foox.html" should not contain "/blog2/2011-01-02-another-article.html"
47
+
48
+ And the file "blog1/tags/foo1.html" should contain "Tag1: foo1"
49
+ And the file "blog1/tags/foo1.html" should contain "/blog1/2011-01-01-new-article.html"
50
+ And the file "blog1/tags/foo1.html" should contain "/blog1/2011-01-02-another-article.html"
51
+
52
+ And the file "blog1/tags/barx.html" should contain "Tag1: barX"
53
+ And the file "blog1/tags/barx.html" should contain "/blog1/2011-01-01-new-article.html"
54
+ And the file "blog1/tags/barx.html" should not contain "/blog1/2011-01-02-another-article.html"
55
+ And the file "blog1/tags/barx.html" should not contain "/blog2/2011-01-01-new-article.html"
56
+
57
+ And the file "blog1/tags/bar1.html" should contain "Tag1: bar1"
58
+ And the file "blog1/tags/bar1.html" should contain "/blog1/2011-01-01-new-article.html"
59
+ And the file "blog1/tags/bar1.html" should not contain "/blog1/2011-01-02-another-article.html"
60
+
61
+
62
+ And the file "blog2/tags/foox.html" should contain "Tag2: fooX"
63
+ And the file "blog2/tags/foox.html" should contain "/blog2/2011-01-01-new-article.html"
64
+ And the file "blog2/tags/foox.html" should contain "/blog2/2011-01-02-another-article.html"
65
+ And the file "blog2/tags/foox.html" should not contain "/blog1/2011-01-01-new-article.html"
66
+ And the file "blog2/tags/foox.html" should not contain "/blog1/2011-01-02-another-article.html"
67
+
68
+ And the file "blog2/tags/foo2.html" should contain "Tag2: foo2"
69
+ And the file "blog2/tags/foo2.html" should contain "/blog2/2011-01-01-new-article.html"
70
+ And the file "blog2/tags/foo2.html" should contain "/blog2/2011-01-02-another-article.html"
71
+
72
+ And the file "blog2/tags/barx.html" should contain "Tag2: barX"
73
+ And the file "blog2/tags/barx.html" should contain "/blog2/2011-01-01-new-article.html"
74
+ And the file "blog2/tags/barx.html" should not contain "/blog2/2011-01-02-another-article.html"
75
+ And the file "blog2/tags/barx.html" should not contain "/blog1/2011-01-01-new-article.html"
76
+
77
+ And the file "blog2/tags/bar2.html" should contain "Tag2: bar2"
78
+ And the file "blog2/tags/bar2.html" should contain "/blog2/2011-01-01-new-article.html"
79
+ And the file "blog2/tags/bar2.html" should not contain "/blog2/2011-01-02-another-article.html"
80
+
81
+ Scenario: Adding a tag to a post in preview adds a tag page
82
+ Given the Server is running at "tags-multiblog-app"
83
+ When I go to "/blog1/tags/bar1.html"
84
+ Then I should see "/blog1/2011-01-01-new-article.html"
85
+ When I go to "/blog1/tags/newtag1.html"
86
+ When I go to "/blog2/tags/bar2.html"
87
+ Then I should see "/blog2/2011-01-01-new-article.html"
88
+ When I go to "/blog2/tags/newtag2.html"
89
+ Then I should see "Not Found"
90
+ And the file "source/blog1/2011-01-01-new-article.html.markdown" has the contents
91
+ """
92
+ ---
93
+ title: "Newest Article"
94
+ date: 2011-01-01
95
+ tags: newtag1, newtagX
96
+ ---
97
+
98
+ Newer Article Content
99
+ """
100
+ And the file "source/blog2/2011-01-01-new-article.html.markdown" has the contents
101
+ """
102
+ ---
103
+ title: "Newest Article"
104
+ date: 2011-01-01
105
+ tags: newtag2, newtagX
106
+ ---
107
+
108
+ Newer Article Content
109
+ """
110
+ When I go to "/blog1/tags/bar1.html"
111
+ Then I should see "Not Found"
112
+ When I go to "/blog2/tags/bar2.html"
113
+ Then I should see "Not Found"
114
+ When I go to "/blog1/tags/newtag1.html"
115
+ Then I should see "/blog1/2011-01-01-new-article.html"
116
+ Then I should not see "/blog2/2011-01-01-new-article.html"
117
+ When I go to "/blog2/tags/newtag2.html"
118
+ Then I should see "/blog2/2011-01-01-new-article.html"
119
+ Then I should not see "/blog1/2011-01-01-new-article.html"
120
+ When I go to "/blog1/tags/newtagx.html"
121
+ Then I should see "/blog1/2011-01-01-new-article.html"
122
+ Then I should not see "/blog2/2011-01-01-new-article.html"
123
+ When I go to "/blog2/tags/newtagx.html"
124
+ Then I should see "/blog2/2011-01-01-new-article.html"
125
+ Then I should not see "/blog1/2011-01-01-new-article.html"