middleman-blog 4.0.1 → 4.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/.editorconfig +16 -0
  3. data/.gitignore +5 -1
  4. data/.travis.yml +33 -19
  5. data/.yardopts +2 -2
  6. data/CHANGELOG.md +51 -24
  7. data/CONTRIBUTING.md +5 -2
  8. data/Gemfile +23 -16
  9. data/ISSUE_TEMPLATE.md +14 -0
  10. data/LICENSE.md +15 -17
  11. data/README.md +52 -14
  12. data/Rakefile +10 -7
  13. data/features/article_dirs.feature +34 -0
  14. data/features/blog_sources.feature +35 -6
  15. data/features/filename_date.feature +4 -2
  16. data/features/language.feature +108 -77
  17. data/features/layouts.feature +3 -0
  18. data/features/multiblog.feature +1 -1
  19. data/features/next_previous.feature +10 -7
  20. data/features/permalink.feature +17 -0
  21. data/features/summary.feature +26 -2
  22. data/features/support/env.rb +7 -4
  23. data/features/support/time_steps.rb +7 -3
  24. data/features/tags.feature +68 -34
  25. data/fixtures/article-dirs-app/config-directory-indexes.rb +6 -0
  26. data/fixtures/article-dirs-app/config-permalink-with-dot.rb +6 -0
  27. data/fixtures/blog-sources-app/config.rb +6 -3
  28. data/fixtures/blog-sources-app/source/blog/2011-01-01-new-article.html.markdown +5 -3
  29. data/fixtures/blog-sources-app/source/blog/2013-08-08-slug-from-filename.html.markdown +5 -3
  30. data/fixtures/blog-sources-app/source/index.html.erb +12 -8
  31. data/fixtures/blog-sources-app/source/layout.erb +21 -10
  32. data/fixtures/blog-sources-no-date-app/config.rb +6 -0
  33. data/fixtures/blog-sources-no-date-app/source/blog/new-article.html.markdown +8 -0
  34. data/fixtures/blog-sources-no-date-app/source/index.html.erb +13 -0
  35. data/fixtures/blog-sources-no-date-app/source/layout.erb +24 -0
  36. data/fixtures/blog-sources-no-day-app/config.rb +6 -0
  37. data/fixtures/blog-sources-no-day-app/source/2012-08-testing.html.markdown +8 -0
  38. data/fixtures/blog-sources-no-day-app/source/layout.erb +24 -0
  39. data/fixtures/{no-title-app → blog-sources-no-title-app}/config.rb +3 -0
  40. data/fixtures/blog-sources-no-title-app/source/2013-08-07.html.markdown +8 -0
  41. data/fixtures/blog-sources-no-title-app/source/2013-08-08.html.markdown +9 -0
  42. data/fixtures/{no-date-app → blog-sources-no-title-app}/source/layout.erb +11 -0
  43. data/fixtures/blog-sources-subdirs-app/config.rb +6 -3
  44. data/fixtures/blog-sources-subdirs-app/source/blog.html.erb +6 -3
  45. data/fixtures/blog-sources-subdirs-app/source/blog/another-post.html.markdown +9 -0
  46. data/fixtures/blog-sources-subdirs-app/source/blog/subdir/yet-another-post.html.markdown +9 -0
  47. data/fixtures/blog-sources-subdirs-app/source/layout.erb +24 -1
  48. data/fixtures/calendar-app/config-directory-indexes.rb +6 -4
  49. data/fixtures/calendar-app/config-only-year.rb +8 -6
  50. data/fixtures/calendar-app/config.rb +6 -4
  51. data/fixtures/calendar-app/source/layout.erb +17 -12
  52. data/fixtures/language-app/locales/en.yml +5 -4
  53. data/fixtures/language-app/locales/ru.yml +5 -4
  54. data/fixtures/language-app/source/2013-09-05-previous-english-article.html.erb +9 -0
  55. data/fixtures/language-app/source/2013-09-06-previous-russian-article.html.erb +9 -0
  56. data/fixtures/language-app/source/2013-09-07-english-article-with-lang-in-frontmatter.html.erb +5 -2
  57. data/fixtures/language-app/source/2013-09-07-russian-article-with-lang-in-frontmatter.html.erb +5 -2
  58. data/fixtures/language-app/source/2013-09-08-next-russian-article.html.erb +9 -0
  59. data/fixtures/language-app/source/2013-09-09-next-english-article.html.erb +9 -0
  60. data/fixtures/language-app/source/layouts/layout.erb +12 -1
  61. data/fixtures/language-app/source/localizable/index.html.erb +3 -1
  62. data/fixtures/layouts-app/source/2011/01/01/fourth-article.html.markdown +7 -0
  63. data/fixtures/paginate-app/config-directory-indexes.rb +14 -12
  64. data/fixtures/paginate-app/config-paginate-off.rb +14 -12
  65. data/fixtures/paginate-app/config.rb +16 -13
  66. data/fixtures/permalink-app/config.rb +7 -0
  67. data/fixtures/permalink-app/source/index.html.erb +13 -0
  68. data/fixtures/permalink-app/source/layout.erb +26 -0
  69. data/fixtures/permalink-app/source/news/2011-01-01-new-article.html.markdown +9 -0
  70. data/fixtures/summary-app/source/2013-05-08-article-with-custom-separator.html.markdown +1 -1
  71. data/fixtures/summary-app/source/2016-05-21-article-with-comment-separator.html.markdown +7 -0
  72. data/fixtures/tags-app/config-directory-indexes.rb +2 -1
  73. data/fixtures/tags-app/config-filters.rb +8 -0
  74. data/fixtures/tags-app/config-no-tags.rb +5 -3
  75. data/fixtures/tags-app/config.rb +2 -1
  76. data/fixtures/tags-app/source/blog/2011-01-03-no-taga.html.markdown +6 -0
  77. data/lib/middleman-blog.rb +7 -4
  78. data/lib/middleman-blog/blog_article.rb +157 -34
  79. data/lib/middleman-blog/blog_data.rb +83 -29
  80. data/lib/middleman-blog/calendar_pages.rb +1 -1
  81. data/lib/middleman-blog/commands/article.rb +88 -30
  82. data/lib/middleman-blog/commands/article.tt +4 -1
  83. data/lib/middleman-blog/custom_pages.rb +1 -1
  84. data/lib/middleman-blog/helpers.rb +2 -2
  85. data/lib/middleman-blog/paginator.rb +5 -4
  86. data/lib/middleman-blog/tag_pages.rb +61 -24
  87. data/lib/middleman-blog/truncate_html.rb +4 -9
  88. data/lib/middleman-blog/uri_templates.rb +44 -30
  89. data/lib/middleman-blog/version.rb +3 -1
  90. data/middleman-blog.gemspec +19 -17
  91. data/spec/spec_helper.rb +1 -1
  92. data/spec/uri_templates_spec.rb +21 -6
  93. metadata +68 -52
  94. data/.gemtest +0 -0
  95. data/features/no_date.feature +0 -9
  96. data/features/permalink-data.feature +0 -12
  97. data/fixtures/blog-sources-app/source/_article_template.erb +0 -1
  98. data/fixtures/blog-sources-subdirs-app/source/blog/another-post.html.md.erb +0 -8
  99. data/fixtures/blog-sources-subdirs-app/source/blog/subdir/yet-another-post.html.md.erb +0 -8
  100. data/fixtures/no-date-app/config.rb +0 -3
  101. data/fixtures/no-date-app/source/_article_template.erb +0 -1
  102. data/fixtures/no-date-app/source/blog/new-article.html.markdown +0 -6
  103. data/fixtures/no-date-app/source/index.html.erb +0 -9
  104. data/fixtures/no-day-app/config.rb +0 -3
  105. data/fixtures/no-day-app/source/2012-08-testing.html.markdown +0 -6
  106. data/fixtures/no-day-app/source/layout.erb +0 -13
  107. data/fixtures/no-title-app/source/2013-08-07.html.markdown +0 -6
  108. data/fixtures/no-title-app/source/2013-08-08.html.markdown +0 -7
  109. data/fixtures/no-title-app/source/layout.erb +0 -13
  110. data/fixtures/permalink-data-app/config.rb +0 -5
  111. data/fixtures/permalink-data-app/source/index.html.erb +0 -3
  112. data/fixtures/permalink-data-app/source/layout.erb +0 -14
  113. data/fixtures/permalink-data-app/source/news/2011-01-01-new-article.html.markdown +0 -7
data/Rakefile CHANGED
@@ -5,28 +5,31 @@ require 'cucumber/rake/task'
5
5
 
6
6
  require 'middleman-core'
7
7
 
8
- Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
9
- ENV["TEST"] = "true"
8
+ Cucumber::Rake::Task.new( :cucumber, 'Run features that should pass' ) do | t |
9
+ ENV[ "TEST" ] = "true"
10
10
 
11
11
  exempt_tags = ""
12
12
  exempt_tags << "--tags ~@nojava " if RUBY_PLATFORM == "java"
13
13
 
14
- t.cucumber_opts = "--color --tags ~@wip #{exempt_tags} --strict --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'}"
14
+ t.cucumber_opts = "--color --tags ~@wip #{ exempt_tags } --strict --format #{ ENV[ 'CUCUMBER_FORMAT' ] || 'pretty' }"
15
15
  end
16
16
 
17
17
  require 'rake/clean'
18
18
 
19
19
  desc "Run tests, both RSpec and Cucumber"
20
- task :test => [:spec, :cucumber]
20
+ task test: [ :spec, :cucumber ]
21
21
 
22
22
  require 'rspec/core/rake_task'
23
+
23
24
  desc "Run RSpec"
24
- RSpec::Core::RakeTask.new do |spec|
25
- spec.pattern = 'spec/**/*_spec.rb'
26
- spec.rspec_opts = ['--color', '--format documentation']
25
+
26
+ RSpec::Core::RakeTask.new do | spec |
27
+ spec.pattern = 'spec/**/*_spec.rb'
28
+ spec.rspec_opts = [ '--color', '--format documentation' ]
27
29
  end
28
30
 
29
31
  desc "Build HTML documentation"
32
+
30
33
  task :doc do
31
34
  sh 'bundle exec yard'
32
35
  end
@@ -1,7 +1,41 @@
1
1
  Feature: Article-specific subdirectories
2
+
2
3
  Scenario: Blog articles can have their own subdirectories for related files
4
+
3
5
  Given the Server is running at "article-dirs-app"
6
+
4
7
  When I go to "/blog/2011-01-01-new-article/example.txt"
5
8
  Then I should see "Not Found"
9
+
6
10
  When I go to "/2011/01/01/new-article/example.txt"
7
11
  Then I should see "Example Text"
12
+
13
+ Scenario: Blog articles with directory_indexes can have their own subdirectories for related files
14
+
15
+ Given a fixture app "article-dirs-app"
16
+ And app "article-dirs-app" is using config "directory-indexes"
17
+ And the Server is running
18
+
19
+ When I go to "/2011/01/01/new-article"
20
+ Then I should see "Newer Article Content"
21
+
22
+ When I go to "/2011-01-01-new-article/example.txt"
23
+ Then I should see "Not Found"
24
+
25
+ When I go to "/2011/01/01/new-article/example.txt"
26
+ Then I should see "Example Text"
27
+
28
+ Scenario: Blog articles with permalinks containing dots can have their own subdirectories for related files
29
+
30
+ Given a fixture app "article-dirs-app"
31
+ And app "article-dirs-app" is using config "permalink-with-dot"
32
+ And the Server is running
33
+
34
+ When I go to "/2011.01.01/new-article"
35
+ Then I should see "Newer Article Content"
36
+
37
+ When I go to "/2011-01-01-new-article/example.txt"
38
+ Then I should see "Not Found"
39
+
40
+ When I go to "/2011.01.01/new-article/example.txt"
41
+ Then I should see "Example Text"
@@ -1,32 +1,61 @@
1
- Feature: Flexible article sources
1
+ Feature: Blog sources
2
+
2
3
  Scenario: Blog articles can live under a different structure than their permalink
4
+
3
5
  Given the Server is running at "blog-sources-app"
6
+
4
7
  When I go to "/2011/01/01/new-article.html"
5
8
  Then I should see "/2011/01/01/new-article.html"
9
+
6
10
  When I go to "/blog/2001-01-01-new-article.html"
7
11
  Then I should see "Not Found"
12
+
8
13
  When I go to "/"
9
14
  Then I should see "/2011/01/01/new-article.html"
10
15
 
11
16
  Scenario: Blog articles can omit the day part
12
- Given the Server is running at "no-day-app"
17
+
18
+ Given the Server is running at "blog-sources-no-day-app"
19
+
13
20
  When I go to "/2012/08/01/testing.html"
14
21
  Then I should see "Testing Article"
15
22
 
16
23
  Scenario: Blog article sources can omit the title part
17
- Given the Server is running at "no-title-app"
24
+
25
+ Given the Server is running at "blog-sources-no-title-app"
26
+
18
27
  When I go to "/2013/08/07/testing-article.html"
19
- Then I should see "Testing Article"
28
+ Then I should see "/2013/08/07/testing-article.html"
20
29
 
21
30
  Scenario: Slug can be specified in frontmatter
22
- Given the Server is running at "no-title-app"
31
+
32
+ Given the Server is running at "blog-sources-no-title-app"
33
+
23
34
  When I go to "/2013/08/08/slug-from-frontmatter.html"
24
35
  Then I should see "Article with slug specified in frontmatter"
36
+
25
37
  Given the Server is running at "blog-sources-app"
38
+
26
39
  When I go to "/2013/08/08/slug-from-frontmatter.html"
27
40
  Then I should see "Article with slug specified in frontmatter"
28
41
 
29
42
  Scenario: There can be subdirectories in the blog sources dir
43
+
30
44
  Given the Server is running at "blog-sources-subdirs-app"
45
+
31
46
  When I go to "/blog.html"
32
- Then I should see "Yet another post"
47
+ Then I should see "Yet another post"
48
+ And I should see "Another post"
49
+
50
+ Scenario: Blog sources may not include the date in the filename
51
+
52
+ Given the Server is running at "blog-sources-no-date-app"
53
+
54
+ When I go to "/2011/01/01/new-article.html"
55
+ Then I should see "/2011/01/01/new-article.html"
56
+
57
+ When I go to "/blog/new-article.html"
58
+ Then I should see "Not Found"
59
+
60
+ When I go to "/"
61
+ Then I should see "/2011/01/01/new-article.html"
@@ -1,9 +1,11 @@
1
1
  Feature: Derive article date from its source filename
2
+
2
3
  Scenario: Posts with dates in filenames and optionally frontmatter
4
+
3
5
  Given the Server is running at "filename-date-app"
6
+
4
7
  When I go to "/2011/01/01/new-article.html"
5
8
  Then I should see "Date: 2011-01-01T00:00:00"
9
+
6
10
  When I go to "/2011/01/03/filename-and-frontmatter.html"
7
11
  Then I should see "Date: 2011-01-03T10:15:00"
8
-
9
-
@@ -1,78 +1,109 @@
1
+
1
2
  Feature: Internationalized articles
2
- Scenario: Article has lang in frontmatter
3
- Given the Server is running at "language-app"
4
- When I go to "/index.html"
5
- Then I should see "Some text in English. All is OK."
6
- Then I should not see "Некоторый текст на русском языке. Всё отлично."
7
- When I go to "/ru/index.html"
8
- Then I should see "Некоторый текст на русском языке. Всё отлично."
9
- Then I should not see "Some text in English. All is OK."
10
-
11
- Scenario: Article has lang in path
12
- Given a fixture app "language-app"
13
- And a file named "config.rb" with:
14
- """
15
- activate :i18n
16
- activate :blog, prefix: ":lang"
17
- """
18
- Given the Server is running at "language-app"
19
- When I go to "/index.html"
20
- Then I should see "Some text in English. All is OK."
21
- Then I should not see "Некоторый текст на русском языке. Всё отлично."
22
- When I go to "/ru/index.html"
23
- Then I should see "Некоторый текст на русском языке. Всё отлично."
24
- Then I should not see "Some text in English. All is OK."
25
-
26
- Scenario: Article has lang in source path
27
- Given a fixture app "lang-path-app"
28
- Given the Server is running at "lang-path-app"
29
- When I go to "/en/a-humble-test.html"
30
- Then I should see "English!"
31
- When I go to "/ru/a-humble-test.html"
32
- Then I should see "Russian!"
33
-
34
- Scenario: Custom locales in articles
35
- Given a fixture app "language-app"
36
- And a file named "config.rb" with:
37
- """
38
- activate :i18n
39
- activate :blog, preserve_locale: true
40
- """
41
- Given the Server is running at "language-app"
42
- When I go to "/index.html"
43
- Then I should see "Some text in English. All is OK."
44
- When I go to "/ru/index.html"
45
- Then I should see "Некоторый текст на русском языке. Всё отлично."
46
-
47
- Scenario: Layout's locale match article's locale on article page
48
- Given a fixture app "language-app"
49
- Given the Server is running at "language-app"
50
- When I go to "/2013/09/07/english-article-with-lang-in-frontmatter.html"
51
- Then I should see "Language: en"
52
- Then I should see "Hello, world!"
53
- Then I should not see "Язык: ru"
54
- Then I should not see "Привет, мир!"
55
- When I go to "/2013/09/07/russian-article-with-lang-in-frontmatter.html"
56
- Then I should see "Язык: ru"
57
- Then I should see "Привет, мир!"
58
- Then I should not see "Language: en"
59
- Then I should not see "Hello, world!"
60
-
61
- Scenario: Custom locales on article pages
62
- Given a fixture app "language-app"
63
- And a file named "config.rb" with:
64
- """
65
- activate :i18n
66
- activate :blog, preserve_locale: true
67
- """
68
- Given the Server is running at "language-app"
69
- When I go to "/2013/09/07/english-article-with-lang-in-frontmatter.html"
70
- Then I should see "Language: en"
71
- Then I should see "Hello, world!"
72
- Then I should not see "Язык: ru"
73
- Then I should not see "Привет, мир!"
74
- When I go to "/2013/09/07/russian-article-with-lang-in-frontmatter.html"
75
- Then I should see "Language: en"
76
- Then I should see "Hello, world!"
77
- Then I should not see "Язык: ru"
78
- Then I should not see "Привет, мир!"
3
+
4
+ Scenario: Article has lang in frontmatter
5
+
6
+ Given the Server is running at "language-app"
7
+
8
+ When I go to "/index.html"
9
+ Then I should see "Some text in English. All is OK."
10
+ Then I should not see "Некоторый текст на русском языке. Всё отлично."
11
+ When I go to "/ru/index.html"
12
+ Then I should see "Некоторый текст на русском языке. Всё отлично."
13
+ Then I should not see "Some text in English. All is OK."
14
+
15
+
16
+ Scenario: Article has lang in path
17
+
18
+ Given a fixture app "language-app"
19
+ And a file named "config.rb" with:
20
+ """
21
+ activate :i18n
22
+ activate :blog, prefix: ":lang"
23
+ """
24
+
25
+ Given the Server is running at "language-app"
26
+
27
+ When I go to "/index.html"
28
+ Then I should see "Some text in English. All is OK."
29
+ Then I should not see "Некоторый текст на русском языке. Всё отлично."
30
+ When I go to "/ru/index.html"
31
+ Then I should see "Некоторый текст на русском языке. Всё отлично."
32
+ Then I should not see "Some text in English. All is OK."
33
+
34
+
35
+ Scenario: Article has lang in source path
36
+
37
+ Given a fixture app "lang-path-app"
38
+ Given the Server is running at "lang-path-app"
39
+
40
+ When I go to "/en/a-humble-test.html"
41
+ Then I should see "English!"
42
+ When I go to "/ru/a-humble-test.html"
43
+ Then I should see "Russian!"
44
+
45
+
46
+ Scenario: Custom locales in articles
47
+
48
+ Given a fixture app "language-app"
49
+ And a file named "config.rb" with:
50
+ """
51
+ activate :i18n
52
+ activate :blog, preserve_locale: true
53
+ """
54
+
55
+ Given the Server is running at "language-app"
56
+
57
+ When I go to "/index.html"
58
+ Then I should see "Some text in English. All is OK."
59
+ When I go to "/ru/index.html"
60
+ Then I should see "Некоторый текст на русском языке. Всё отлично."
61
+
62
+ Scenario: Layout's locale match article's locale on article page
63
+
64
+ Given a fixture app "language-app"
65
+ Given the Server is running at "language-app"
66
+
67
+ When I go to "/2013/09/07/english-article-with-lang-in-frontmatter.html"
68
+ Then I should see "Language: en"
69
+ Then I should see "Hello, world!"
70
+ Then I should not see "Язык: ru"
71
+ Then I should not see "Привет, мир!"
72
+ When I go to "/2013/09/07/russian-article-with-lang-in-frontmatter.html"
73
+ Then I should see "Язык: ru"
74
+ Then I should see "Привет, мир!"
75
+ Then I should not see "Language: en"
76
+ Then I should not see "Hello, world!"
77
+
78
+ Scenario: Custom locales on article pages
79
+
80
+ Given a fixture app "language-app"
81
+
82
+ And a file named "config.rb" with:
83
+ """
84
+ activate :i18n
85
+ activate :blog, preserve_locale: true
86
+ """
87
+
88
+ Given the Server is running at "language-app"
89
+
90
+ When I go to "/2013/09/07/english-article-with-lang-in-frontmatter.html"
91
+ Then I should see "Language: en"
92
+ Then I should see "Hello, world!"
93
+ Then I should not see "Язык: ru"
94
+ Then I should not see "Привет, мир!"
95
+ When I go to "/2013/09/07/russian-article-with-lang-in-frontmatter.html"
96
+ Then I should see "Language: en"
97
+ Then I should see "Hello, world!"
98
+ Then I should not see "Язык: ru"
99
+ Then I should not see "Привет, мир!"
100
+
101
+ Scenario: Next and previous local article
102
+
103
+ Given a fixture app "language-app"
104
+
105
+ When I go to "/2013/09/07/english-article-with-lang-in-frontmatter.html"
106
+ Then I should see "Next: /2013/09/09/next-english-article.html"
107
+ Then I should not see "Next: /2013/09/08/next-russian-article.html"
108
+ Then I should see "Previous: /2013/09/05/previous-english-article.html"
109
+ Then I should not see "Previous: /2013/09/06/previous-russian-article.html"
@@ -11,6 +11,9 @@ Feature: Layouts
11
11
  When I go to "/2011/01/01/third-article.html"
12
12
  Then I should see "Third Alternative Layout"
13
13
  And I should see "Third Article"
14
+ When I go to "/2011/01/01/fourth-article.html"
15
+ Then I should see "Default Layout"
16
+ And I should see "Fourth Article"
14
17
  Scenario: The default blog layout is used if none is set in front matter.
15
18
  When I go to "/2011/01/02/article-in-normal-layout.html"
16
19
  Then I should see "Default Layout"
@@ -48,4 +48,4 @@ Feature: Host Multiple Blogs with Middleman 3.1+
48
48
  And the file "index.html" should contain "blog_number_1 length: 1"
49
49
  And the file "index.html" should contain "blog_number_1 title: Other Article"
50
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"
51
+ And the file "index.html" should contain "blog_number_2 title: Newer Article"
@@ -1,8 +1,11 @@
1
+
1
2
  Feature: Next and previous article
2
-
3
- Scenario: Articles know their next and previous article
4
- Given the Server is running at "calendar-app"
5
- When I go to "/blog/2011-01-01-new-article.html"
6
- Then I should see "Next: /blog/2011-01-02-another-article.html"
7
- When I go to "/blog/2011-01-02-another-article.html"
8
- Then I should see "Previous: /blog/2011-01-01-new-article.html"
3
+
4
+ Scenario: Articles know their next and previous article
5
+
6
+ Given the Server is running at "calendar-app"
7
+
8
+ When I go to "/blog/2011-01-01-new-article.html"
9
+ Then I should see "Next: /blog/2011-01-02-another-article.html"
10
+ When I go to "/blog/2011-01-02-another-article.html"
11
+ Then I should see "Previous: /blog/2011-01-01-new-article.html"
@@ -0,0 +1,17 @@
1
+
2
+ Feature: Permalinks can include arbitrary data from frontmatter
3
+
4
+ Scenario: Articles list links using permalink with frontmatter data
5
+
6
+ Given the Server is running at "permalink-app"
7
+
8
+ When I go to "/index.html"
9
+ Then I should see "news/a-custom-string-2011-01-01-new-article.html"
10
+
11
+ Scenario: Articles can be accessed through permalinks with frontmatter data
12
+
13
+ Given the Server is running at "permalink-app"
14
+
15
+ When I go to "news/a-custom-string-2011-01-01-new-article.html"
16
+ Then I should see "Newer Article Content"
17
+ And I should see "Category : news"
@@ -2,7 +2,11 @@ Feature: Article summary generation
2
2
  Scenario: Article has no summary separator
3
3
  Given the Server is running at "summary-app"
4
4
  When I go to "/index.html"
5
- Then I should see "<p>Summary from article with separator.</p>"
5
+ Then I should see:
6
+ """
7
+ <p>Summary from article with separator.
8
+ </p>
9
+ """
6
10
  Then I should not see "Extended part from article with separator."
7
11
  Then I should see "<p>Summary from article with no separator.</p>"
8
12
  Then I should not see "Extended part from article with no separator."
@@ -25,6 +29,24 @@ Feature: Article summary generation
25
29
  Then I should not see "Extended part from article with custom separator."
26
30
  Then I should see "Extended part from article with separator."
27
31
 
32
+ Scenario: Article has custom summary separator that's an HTML comment
33
+ Given a fixture app "summary-app"
34
+ And a file named "config.rb" with:
35
+ """
36
+ activate :blog do |blog|
37
+ blog.summary_separator = /<!--more-->/
38
+ end
39
+ """
40
+ Given the Server is running at "summary-app"
41
+ When I go to "/index.html"
42
+ Then I should see:
43
+ """
44
+ <p>Summary from article with HTML comment separator.
45
+ </p>
46
+ """
47
+ Then I should not see "Extended part from article with HTML comment separator."
48
+ Then I should see "Extended part from article with separator."
49
+
28
50
  Scenario: Using a custom summary generator
29
51
  Given a fixture app "summary-app"
30
52
  And a file named "config.rb" with:
@@ -79,4 +101,6 @@ Feature: Article summary generation
79
101
  Then I should see "Summary1"
80
102
  Then I should see "Summary2"
81
103
  Then I should see "Summary3"
82
- Then I should see "Summary4"
104
+ # it has a custom separator, which overrides explicit length, so we show up to the separator
105
+ Then I should see "Summary from article with separator."
106
+ Then I should see "Summary5"