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.
- checksums.yaml +4 -4
- data/.editorconfig +16 -0
- data/.gitignore +5 -1
- data/.travis.yml +33 -19
- data/.yardopts +2 -2
- data/CHANGELOG.md +51 -24
- data/CONTRIBUTING.md +5 -2
- data/Gemfile +23 -16
- data/ISSUE_TEMPLATE.md +14 -0
- data/LICENSE.md +15 -17
- data/README.md +52 -14
- data/Rakefile +10 -7
- data/features/article_dirs.feature +34 -0
- data/features/blog_sources.feature +35 -6
- data/features/filename_date.feature +4 -2
- data/features/language.feature +108 -77
- data/features/layouts.feature +3 -0
- data/features/multiblog.feature +1 -1
- data/features/next_previous.feature +10 -7
- data/features/permalink.feature +17 -0
- data/features/summary.feature +26 -2
- data/features/support/env.rb +7 -4
- data/features/support/time_steps.rb +7 -3
- data/features/tags.feature +68 -34
- data/fixtures/article-dirs-app/config-directory-indexes.rb +6 -0
- data/fixtures/article-dirs-app/config-permalink-with-dot.rb +6 -0
- data/fixtures/blog-sources-app/config.rb +6 -3
- data/fixtures/blog-sources-app/source/blog/2011-01-01-new-article.html.markdown +5 -3
- data/fixtures/blog-sources-app/source/blog/2013-08-08-slug-from-filename.html.markdown +5 -3
- data/fixtures/blog-sources-app/source/index.html.erb +12 -8
- data/fixtures/blog-sources-app/source/layout.erb +21 -10
- data/fixtures/blog-sources-no-date-app/config.rb +6 -0
- data/fixtures/blog-sources-no-date-app/source/blog/new-article.html.markdown +8 -0
- data/fixtures/blog-sources-no-date-app/source/index.html.erb +13 -0
- data/fixtures/blog-sources-no-date-app/source/layout.erb +24 -0
- data/fixtures/blog-sources-no-day-app/config.rb +6 -0
- data/fixtures/blog-sources-no-day-app/source/2012-08-testing.html.markdown +8 -0
- data/fixtures/blog-sources-no-day-app/source/layout.erb +24 -0
- data/fixtures/{no-title-app → blog-sources-no-title-app}/config.rb +3 -0
- data/fixtures/blog-sources-no-title-app/source/2013-08-07.html.markdown +8 -0
- data/fixtures/blog-sources-no-title-app/source/2013-08-08.html.markdown +9 -0
- data/fixtures/{no-date-app → blog-sources-no-title-app}/source/layout.erb +11 -0
- data/fixtures/blog-sources-subdirs-app/config.rb +6 -3
- data/fixtures/blog-sources-subdirs-app/source/blog.html.erb +6 -3
- data/fixtures/blog-sources-subdirs-app/source/blog/another-post.html.markdown +9 -0
- data/fixtures/blog-sources-subdirs-app/source/blog/subdir/yet-another-post.html.markdown +9 -0
- data/fixtures/blog-sources-subdirs-app/source/layout.erb +24 -1
- data/fixtures/calendar-app/config-directory-indexes.rb +6 -4
- data/fixtures/calendar-app/config-only-year.rb +8 -6
- data/fixtures/calendar-app/config.rb +6 -4
- data/fixtures/calendar-app/source/layout.erb +17 -12
- data/fixtures/language-app/locales/en.yml +5 -4
- data/fixtures/language-app/locales/ru.yml +5 -4
- data/fixtures/language-app/source/2013-09-05-previous-english-article.html.erb +9 -0
- data/fixtures/language-app/source/2013-09-06-previous-russian-article.html.erb +9 -0
- data/fixtures/language-app/source/2013-09-07-english-article-with-lang-in-frontmatter.html.erb +5 -2
- data/fixtures/language-app/source/2013-09-07-russian-article-with-lang-in-frontmatter.html.erb +5 -2
- data/fixtures/language-app/source/2013-09-08-next-russian-article.html.erb +9 -0
- data/fixtures/language-app/source/2013-09-09-next-english-article.html.erb +9 -0
- data/fixtures/language-app/source/layouts/layout.erb +12 -1
- data/fixtures/language-app/source/localizable/index.html.erb +3 -1
- data/fixtures/layouts-app/source/2011/01/01/fourth-article.html.markdown +7 -0
- data/fixtures/paginate-app/config-directory-indexes.rb +14 -12
- data/fixtures/paginate-app/config-paginate-off.rb +14 -12
- data/fixtures/paginate-app/config.rb +16 -13
- data/fixtures/permalink-app/config.rb +7 -0
- data/fixtures/permalink-app/source/index.html.erb +13 -0
- data/fixtures/permalink-app/source/layout.erb +26 -0
- data/fixtures/permalink-app/source/news/2011-01-01-new-article.html.markdown +9 -0
- data/fixtures/summary-app/source/2013-05-08-article-with-custom-separator.html.markdown +1 -1
- data/fixtures/summary-app/source/2016-05-21-article-with-comment-separator.html.markdown +7 -0
- data/fixtures/tags-app/config-directory-indexes.rb +2 -1
- data/fixtures/tags-app/config-filters.rb +8 -0
- data/fixtures/tags-app/config-no-tags.rb +5 -3
- data/fixtures/tags-app/config.rb +2 -1
- data/fixtures/tags-app/source/blog/2011-01-03-no-taga.html.markdown +6 -0
- data/lib/middleman-blog.rb +7 -4
- data/lib/middleman-blog/blog_article.rb +157 -34
- data/lib/middleman-blog/blog_data.rb +83 -29
- data/lib/middleman-blog/calendar_pages.rb +1 -1
- data/lib/middleman-blog/commands/article.rb +88 -30
- data/lib/middleman-blog/commands/article.tt +4 -1
- data/lib/middleman-blog/custom_pages.rb +1 -1
- data/lib/middleman-blog/helpers.rb +2 -2
- data/lib/middleman-blog/paginator.rb +5 -4
- data/lib/middleman-blog/tag_pages.rb +61 -24
- data/lib/middleman-blog/truncate_html.rb +4 -9
- data/lib/middleman-blog/uri_templates.rb +44 -30
- data/lib/middleman-blog/version.rb +3 -1
- data/middleman-blog.gemspec +19 -17
- data/spec/spec_helper.rb +1 -1
- data/spec/uri_templates_spec.rb +21 -6
- metadata +68 -52
- data/.gemtest +0 -0
- data/features/no_date.feature +0 -9
- data/features/permalink-data.feature +0 -12
- data/fixtures/blog-sources-app/source/_article_template.erb +0 -1
- data/fixtures/blog-sources-subdirs-app/source/blog/another-post.html.md.erb +0 -8
- data/fixtures/blog-sources-subdirs-app/source/blog/subdir/yet-another-post.html.md.erb +0 -8
- data/fixtures/no-date-app/config.rb +0 -3
- data/fixtures/no-date-app/source/_article_template.erb +0 -1
- data/fixtures/no-date-app/source/blog/new-article.html.markdown +0 -6
- data/fixtures/no-date-app/source/index.html.erb +0 -9
- data/fixtures/no-day-app/config.rb +0 -3
- data/fixtures/no-day-app/source/2012-08-testing.html.markdown +0 -6
- data/fixtures/no-day-app/source/layout.erb +0 -13
- data/fixtures/no-title-app/source/2013-08-07.html.markdown +0 -6
- data/fixtures/no-title-app/source/2013-08-08.html.markdown +0 -7
- data/fixtures/no-title-app/source/layout.erb +0 -13
- data/fixtures/permalink-data-app/config.rb +0 -5
- data/fixtures/permalink-data-app/source/index.html.erb +0 -3
- data/fixtures/permalink-data-app/source/layout.erb +0 -14
- 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 :
|
20
|
+
task test: [ :spec, :cucumber ]
|
21
21
|
|
22
22
|
require 'rspec/core/rake_task'
|
23
|
+
|
23
24
|
desc "Run RSpec"
|
24
|
-
|
25
|
-
|
26
|
-
spec.
|
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:
|
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
|
-
|
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
|
-
|
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 "
|
28
|
+
Then I should see "/2013/08/07/testing-article.html"
|
20
29
|
|
21
30
|
Scenario: Slug can be specified in frontmatter
|
22
|
-
|
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
|
-
|
data/features/language.feature
CHANGED
@@ -1,78 +1,109 @@
|
|
1
|
+
|
1
2
|
Feature: Internationalized articles
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
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"
|
data/features/layouts.feature
CHANGED
@@ -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"
|
data/features/multiblog.feature
CHANGED
@@ -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
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
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"
|
data/features/summary.feature
CHANGED
@@ -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
|
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
|
-
|
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"
|