ruhoh 2.1 → 2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/Gemfile +7 -2
  2. data/README.md +50 -7
  3. data/Rakefile +1 -9
  4. data/cucumber.yml +1 -0
  5. data/features/categories.feature +38 -0
  6. data/features/conversion.feature +35 -0
  7. data/features/data.feature +32 -0
  8. data/features/drafts.feature +21 -0
  9. data/features/javascripts.feature +42 -0
  10. data/features/layouts.feature +41 -0
  11. data/features/pagination.feature +55 -0
  12. data/features/partials.feature +13 -0
  13. data/features/permalinks.feature +118 -0
  14. data/features/step_defs.rb +70 -0
  15. data/features/stylesheets.feature +42 -0
  16. data/features/summary.feature +119 -0
  17. data/features/support/env.rb +8 -0
  18. data/features/support/helpers.rb +74 -0
  19. data/features/tags.feature +39 -0
  20. data/features/themes.feature +0 -0
  21. data/features/widgets/google_prettify.feature +12 -0
  22. data/features/widgets/syntax.feature +35 -0
  23. data/features/widgets/widgets.feature +83 -0
  24. data/history.json +23 -0
  25. data/lib/ruhoh/base/model.rb +29 -9
  26. data/lib/ruhoh/base/model_view.rb +64 -32
  27. data/lib/ruhoh/programs/watch.rb +1 -0
  28. data/lib/ruhoh/resources/pages/collection.rb +2 -1
  29. data/lib/ruhoh/resources/pages/collection_view.rb +9 -7
  30. data/lib/ruhoh/resources/pages/previewer.rb +11 -10
  31. data/lib/ruhoh/resources/widgets/collection_view.rb +2 -4
  32. data/lib/ruhoh/resources/widgets/compiler.rb +19 -3
  33. data/lib/ruhoh/version.rb +1 -1
  34. data/ruhoh.gemspec +4 -0
  35. data/system/plugins/sprockets/compiler.rb +38 -0
  36. data/system/plugins/sprockets/javascripts/compiler.rb +3 -24
  37. data/system/plugins/sprockets/javascripts/previewer.rb +4 -12
  38. data/system/plugins/sprockets/previewer.rb +17 -0
  39. data/system/plugins/sprockets/stylesheets/compiler.rb +2 -25
  40. data/system/plugins/sprockets/stylesheets/previewer.rb +3 -12
  41. data/system/widgets/analytics/google.html +14 -6
  42. data/system/widgets/google_prettify/default.html +1 -1
  43. data/system/widgets/syntax/javascripts/prettify.js +30 -0
  44. data/system/widgets/syntax/prettify.html +18 -0
  45. metadata +80 -5
  46. data/spec/spec_helper.rb +0 -29
  47. data/spec/support/shared_contexts.rb +0 -25
data/Gemfile CHANGED
@@ -3,11 +3,16 @@ gemspec
3
3
 
4
4
  gem 'rack', "~> 1.4"
5
5
  gem 'directory_watcher', "~> 1.4.0"
6
- gem 'psych', "~> 1.3"#, :platforms => [:ruby_18, :mingw_18]
6
+ gem 'psych', "~> 1.3", :platforms => [:ruby_18, :mingw_18]
7
7
  gem 'redcarpet', "~> 2.1"
8
8
  gem 'nokogiri', "~> 1.5"
9
9
 
10
10
  group :development do
11
- gem 'rspec', "~> 2"
12
11
  gem 'rake'
13
12
  end
13
+
14
+ group :test do
15
+ gem 'cucumber'
16
+ gem 'capybara'
17
+ gem "rspec-expectations"
18
+ end
data/README.md CHANGED
@@ -1,19 +1,29 @@
1
+ [![Build Status](https://travis-ci.org/ruhoh/ruhoh.rb.png?branch=master)](https://travis-ci.org/ruhoh/ruhoh.rb)
2
+
1
3
  ## Ruhoh is the Universal Static Blog API
2
4
 
3
- <http://ruhoh.com>
5
+ Usage and quick start information at <http://ruhoh.com>
6
+
7
+ ### Running the Latest Version
4
8
 
5
- ### Usage
9
+ All official releases are pushed out to <http://rubygems.org/gems/ruhoh> which can be used with bundler via Gemfile entry:
6
10
 
7
- This is the new ruhoh 2.x.alpha code.
11
+ ```ruby
12
+ gem 'ruhoh'
13
+ ```
8
14
 
9
- Please follow the directions on the [new 2.0.alpha blog scaffold](https://github.com/ruhoh/blog/tree/2.0.alpha#readme)
15
+ The master branch will refer to the next version and can be used in the Gemfile:
16
+
17
+ ```ruby
18
+ gem 'ruhoh' :git => "git@github.com:ruhoh/ruhoh.rb.git"
19
+ ```
10
20
 
11
21
  ### Platforms
12
22
 
13
- ruhoh is tested with ruby 1.9.2 on mac OSX Lion.
23
+ ruhoh has official support for ruby 1.9.2, 1.9.3, ruby 2.0.0
14
24
  ruhoh runs in production with ruby 1.9.2 on Ubuntu 10.04.4 LTS.
15
25
 
16
- ruby 1.8.7 will not be (consciously) supported unless enough users bother me about it.
26
+ ruby 1.8.7 is not supported.
17
27
 
18
28
  **Windows**
19
29
 
@@ -22,4 +32,37 @@ ruhoh should run on Windows with a few considerations:
22
32
  If you run into trouble with YAML and psych see: https://github.com/ruhoh/ruhoh.rb/issues/54
23
33
  More help is available here: https://github.com/ruhoh/ruhoh.rb/issues/search?q=windows
24
34
 
25
- I can't easily test ruhoh on a Windows machine, so please consider contributing back to the community for running on Windows.
35
+ I can't easily test ruhoh on a Windows machine, so please consider contributing back to the community for running on Windows.
36
+
37
+ ### Contributing
38
+
39
+ I enjoy getting better at managing contributions so all skill levels are welcome.
40
+
41
+ Tips to ensure your work has the best chance of getting merged in:
42
+
43
+ - Feel free to ask for guidance at any time via issues, twitter, or the google group.
44
+ - Code quality does matter, but I'd rather encourage collaboration to make the code better than to scare you away from trying.
45
+ - Always work in a feature branch and periodically rebase this branch with master to keep in sync.
46
+ - Ensure any kind of indent or whitespace formatting is done in a separate commit _first_.
47
+ - The feature branch should be single-purpose and not include wide-reaching changes because it will be too hard to verify your changes.
48
+ - Do not do any version bumping. Bonus points if you are familiar with [semver](http://semver.org) and add features in a backwards compatible manner.
49
+ - Working on major release updates is 100% encouraged, but best to start a dialogue first since it will take time to merge in.
50
+ - **Super Bonus points for adding cucumber tests for your feature or fix.**
51
+
52
+ ### Testing
53
+
54
+ We use [Cucumber](http://cukes.info) for integration tests. Please have a look at <https://github.com/ruhoh/ruhoh.rb/tree/master/features> to see how to quickly write out tests.
55
+ It should be quite fast to make new tests if you take advantage of the current [step_defs](https://github.com/ruhoh/ruhoh.rb/blob/master/features/step_defs.rb).
56
+
57
+ ### Reporting Issues
58
+
59
+ Please use GitHub's issue tracker to report all issues and bugs.
60
+
61
+ If you are familiar enough with cucumber, it's best to include a failing `test.feature` file that sets up your situation and shows how the expected behavior is failing.
62
+ In this way the bug can instantly be verified, a fix can be put in and a regression test will already exist =)
63
+
64
+ ### Community
65
+
66
+ - <http://ruhoh.com>
67
+ - <https://twitter.com/ruhohblog>
68
+ - <https://groups.google.com/forum/?fromgroups#!forum/ruhoh>
data/Rakefile CHANGED
@@ -3,7 +3,6 @@ require 'rubygems'
3
3
  require 'rake'
4
4
  require 'bundler'
5
5
  require 'ruhoh/version'
6
- require 'rspec/core/rake_task'
7
6
 
8
7
  name = Dir['*.gemspec'].first.split('.').first
9
8
  gemspec_file = "#{name}.gemspec"
@@ -21,11 +20,4 @@ task :build do
21
20
  sh "mkdir -p pkg"
22
21
  sh "gem build #{gemspec_file}"
23
22
  sh "mv #{gem_file} pkg"
24
- end
25
-
26
- ## Tests
27
-
28
- RSpec::Core::RakeTask.new('spec')
29
-
30
- desc "Run tests"
31
- task :default => :spec
23
+ end
data/cucumber.yml ADDED
@@ -0,0 +1 @@
1
+ default: -r features
@@ -0,0 +1,38 @@
1
+ Feature: Categories
2
+ As a content publisher
3
+ I want to add categories to pages
4
+ so that I can better organize and provide better access to my content for my readers
5
+
6
+ Scenario: Displaying a page's categories
7
+ Given some files with values:
8
+ | file | categories | body |
9
+ | essays/hello.md | apple, banana, pear | {{# page.categories }} <span>{{ name }}</span> {{/ page.categories }} |
10
+ When I compile my site
11
+ Then my compiled site should have the file "essays/hello/index.html"
12
+ And this file should contain the content node "span|apple"
13
+ And this file should contain the content node "span|banana"
14
+ And this file should contain the content node "span|pear"
15
+
16
+ Scenario: Displaying a collection's categories with counts
17
+ Given some files with values:
18
+ | file | categories | body |
19
+ | _root/index.md | | {{# essays.categories.all }} <span>{{ name }}-{{ count }}</span> {{/ essays.categories.all }} |
20
+ | essays/hello.md | apple, banana, pear | |
21
+ | essays/goodbye.md | apple, banana, pear, watermelon | |
22
+ When I compile my site
23
+ Then my compiled site should have the file "index.html"
24
+ And this file should contain the content node "span|apple-2"
25
+ And this file should contain the content node "span|banana-2"
26
+ And this file should contain the content node "span|pear-2"
27
+ And this file should contain the content node "span|watermelon-1"
28
+
29
+ Scenario: Displaying a specific categories from a collection
30
+ Given some files with values:
31
+ | file | categories | body |
32
+ | _root/index.md | | {{# essays.categories.banana }} <span>{{ name }}-{{ count }}</span> {{/ essays.categories.banana }} |
33
+ | essays/hello.md | apple, banana, pear | |
34
+ | essays/goodbye.md | apple, banana, pear, watermelon | |
35
+ When I compile my site
36
+ Then my compiled site should have the file "index.html"
37
+ And this file should NOT contain the content node "span|apple-2"
38
+ And this file should contain the content node "span|banana-2"
@@ -0,0 +1,35 @@
1
+ Feature: Page Conversion
2
+ As a content publisher
3
+ I want my pages to be converted using the appropriate parser
4
+ so that I can have a more powerful publishing environment to write content.
5
+
6
+ Scenario: Converting a .txt document
7
+ Given some files with values:
8
+ | file | body | blah |
9
+ | essays/hello.txt | cookie dough | tee hee |
10
+ When I compile my site
11
+ Then my compiled site should have the file "essays/hello.txt"
12
+ And this file should contain the content "cookie dough"
13
+
14
+ Scenario: Converting a .json document
15
+ Given some files with values:
16
+ | file | body |
17
+ | essays/hello.json | { "hello" : "world" } |
18
+ When I compile my site
19
+ Then my compiled site should have the file "essays/hello.json"
20
+
21
+ Scenario: Converting a .md document
22
+ Given some files with values:
23
+ | file | body |
24
+ | essays/hello.md | #cookie dough |
25
+ When I compile my site
26
+ Then my compiled site should have the file "essays/hello/index.html"
27
+ And this file should contain the content node "h1|cookie dough"
28
+
29
+ Scenario: Converting a .markdown document
30
+ Given some files with values:
31
+ | file | body |
32
+ | essays/hello.markdown | _cookie dough_ |
33
+ When I compile my site
34
+ Then my compiled site should have the file "essays/hello/index.html"
35
+ And this file should contain the content node "em|cookie dough"
@@ -0,0 +1,32 @@
1
+ Feature: Data
2
+ As a content publisher
3
+ I want to define arbitrary data objects
4
+ so I can quickly display and iterate through this data within my content
5
+
6
+ Scenario: Defining a basic data structure in data.yml
7
+ Given the file "data.yml" with body:
8
+ """
9
+ ---
10
+ name: "jade"
11
+ address:
12
+ city: "alhambra"
13
+ fruits:
14
+ - mango
15
+ - kiwi
16
+ """
17
+ And the file "_root/index.html" with body:
18
+ """
19
+ <name>{{ data.name }}</name>
20
+ <city>{{ data.address.city }}</city>
21
+ <ul>
22
+ {{# data.fruits }}
23
+ <li>{{ . }}</li>
24
+ {{/ data.fruits }}
25
+ </ul>
26
+ """
27
+ When I compile my site
28
+ Then my compiled site should have the file "index.html"
29
+ And this file should contain the content node "name|jade"
30
+ And this file should contain the content node "city|alhambra"
31
+ And this file should contain the content node "li|mango"
32
+ And this file should contain the content node "li|kiwi"
@@ -0,0 +1,21 @@
1
+ Feature: Drafts
2
+ As a content publisher
3
+ I want to maintain drafts
4
+ so that I can manage work-in-progress content alongside published content
5
+
6
+ Scenario: Defining a draft
7
+ Given some files with values:
8
+ | file |
9
+ | essays/drafts/hello.md |
10
+ When I compile my site
11
+ Then my compiled site should NOT have the file "essays/drafts/hello/index.html"
12
+ Then my compiled site should NOT have the file "essays/hello/index.html"
13
+
14
+ Scenario: Defining a nested draft
15
+ Given some files with values:
16
+ | file |
17
+ | essays/one/two/drafts/hello.md |
18
+ When I compile my site
19
+ Then my compiled site should NOT have the file "essays/one/two/drafts/hello/index.html"
20
+ Then my compiled site should NOT have the file "essays/one/two/hello/index.html"
21
+
@@ -0,0 +1,42 @@
1
+ Feature: Javascripts
2
+ As a content publisher
3
+ I want to load javascripts
4
+ so I can make my content interactive
5
+
6
+ Scenario: Defining javascripts
7
+ Given some files with values:
8
+ | file | body |
9
+ | javascripts/base.js | var meep; |
10
+ | javascripts/app.js | console.log('haro world') |
11
+ | javascripts/custom.js | console.log('haro world') |
12
+ And the file "_root/index.html" with body:
13
+ """
14
+ {{# javascripts.load }}
15
+ base.js
16
+ app.js
17
+ custom.js
18
+ {{/ javascripts.load }}",
19
+ """
20
+ When I compile my site
21
+ Then my compiled site should have the file "index.html"
22
+ And this file should have the fingerprinted javascripts "base, app, custom"
23
+
24
+ Scenario: Defining javascripts in a theme
25
+ Given a config file with values:
26
+ | sample_theme | { "use" : "theme" } |
27
+ And some files with values:
28
+ | file | body |
29
+ | javascripts/base.js | var meep; |
30
+ | sample_theme/javascripts/app.js | console.log('haro world') |
31
+ | sample_theme/javascripts/custom.js | (function() {}) |
32
+ And the file "_root/index.html" with body:
33
+ """
34
+ {{# javascripts.load }}
35
+ base.js
36
+ app.js
37
+ custom.js
38
+ {{/ javascripts.load }}",
39
+ """
40
+ When I compile my site
41
+ Then my compiled site should have the file "index.html"
42
+ And this file should have the fingerprinted javascripts "base, app, custom"
@@ -0,0 +1,41 @@
1
+ Feature: Layouts
2
+ As a content publisher
3
+ I want to use layouts
4
+ so that my site can have a unified look and feel while still being highly maintainable.
5
+
6
+ Scenario: Not using a layout
7
+ Given some files with values:
8
+ | file | body | blah |
9
+ | essays/hello.md | cookie dough | tee hee |
10
+ When I compile my site
11
+ Then my compiled site should have the file "essays/hello/index.html"
12
+ And this file should contain the content "cookie dough"
13
+
14
+ Scenario: Defining a default collection layout.
15
+ Given some files with values:
16
+ | file | body |
17
+ | layouts/essays.md | <div id="minimal-layout">{{{ content }}}</div> |
18
+ | essays/hello.md | meepio |
19
+ When I compile my site
20
+ Then my compiled site should have the file "essays/hello/index.html"
21
+ And this file should contain the content node "div#minimal-layout|meepio"
22
+
23
+ Scenario: Defining a layout in page metadata.
24
+ Given some files with values:
25
+ | file | body | layout |
26
+ | layouts/custom.md | <div id="minimal-layout">{{{ content }}}</div> | |
27
+ | essays/hello.md | meepio | custom |
28
+ When I compile my site
29
+ Then my compiled site should have the file "essays/hello/index.html"
30
+ And this file should contain the content node "div#minimal-layout|meepio"
31
+
32
+ Scenario: Defining a layout and sub layout.
33
+ Given some files with values:
34
+ | file | body | layout |
35
+ | layouts/default.md | <div id="minimal-layout">{{{ content }}}</div> | |
36
+ | layouts/essays.md | <div id="minimal-sub-layout">{{{ content }}}</div> | default |
37
+ | essays/hello.md | cookie dough | essays |
38
+ When I compile my site
39
+ Then my compiled site should have the file "essays/hello/index.html"
40
+ And this file should contain the content node "div#minimal-layout|cookie dough"
41
+ And this file should contain the content node "div#minimal-sub-layout|cookie dough"
@@ -0,0 +1,55 @@
1
+ Feature: Pagination
2
+ As a content publisher
3
+ I want to paginate my pages
4
+ so that my audience can better digest my content
5
+
6
+ Scenario: Disabling the paginator for a collection
7
+ Given a config file with values:
8
+ | essays | { "paginator" : { "enable" : false } } |
9
+ And some files with values:
10
+ | file | body |
11
+ | essays/hello.md | some hello content |
12
+ | essays/goodbye.md | some goodbye content |
13
+ | essays/caio.md | some caio content |
14
+ When I compile my site
15
+ Then my compiled site should NOT have the file "essays/index/1/index.html"
16
+
17
+ Scenario: Defining multiple pages in the same collection
18
+ Given some files with values:
19
+ | file | body |
20
+ | essays/hello.md | some hello content |
21
+ | essays/goodbye.md | some goodbye content |
22
+ | essays/caio.md | some caio content |
23
+ When I compile my site
24
+ Then my compiled site should have the file "essays/index/1/index.html"
25
+ And this file should have the links "/essays/hello, /essays/goodbye, /essays/caio"
26
+
27
+ Scenario: Configuring per_page and generating multiple pagination pages.
28
+ Given a config file with values:
29
+ | essays | { "paginator" : { "per_page" : 1 } } |
30
+ And some files with values:
31
+ | file | body |
32
+ | essays/hello.md | some hello content |
33
+ | essays/goodbye.md | some goodbye content |
34
+ | essays/caio.md | some caio content |
35
+ When I compile my site
36
+ Then my compiled site should have the file "essays/index/1/index.html"
37
+ And this file should have the links "/essays/caio, /essays/index/2, /essays/index/3"
38
+ Then my compiled site should have the file "essays/index/2/index.html"
39
+ And this file should have the links "/essays/goodbye, /essays/index/1, /essays/index/3"
40
+ Then my compiled site should have the file "essays/index/3/index.html"
41
+ And this file should have the links "/essays/hello, /essays/index/1, /essays/index/2"
42
+ And this file should NOT have the links "/essays/index/4"
43
+ Then my compiled site should NOT have the file "essays/index/4/index.html"
44
+
45
+ Scenario: Customizing the paginator url
46
+ Given a config file with values:
47
+ | essays | { "paginator" : { "url" : "/coolguy/index" } } |
48
+ And some files with values:
49
+ | file | body |
50
+ | essays/hello.md | some hello content |
51
+ | essays/goodbye.md | some goodbye content |
52
+ | essays/caio.md | some caio content |
53
+ When I compile my site
54
+ Then my compiled site should have the file "coolguy/index/1/index.html"
55
+ And this file should have the links "/essays/hello, /essays/goodbye, /essays/caio"
@@ -0,0 +1,13 @@
1
+ Feature: Partials
2
+ As a content publisher
3
+ I want to maintain partials
4
+ so that I can reuse content without having to write it over and over
5
+
6
+ Scenario: Using a partial
7
+ Given some files with values:
8
+ | file | body |
9
+ | partials/watermelon.html | I like to eat watermelon =) |
10
+ | _root/index.md | {{> watermelon.html }} |
11
+ When I compile my site
12
+ Then my compiled site should have the file "index.html"
13
+ And this file should contain the content "I like to eat watermelon =)"
@@ -0,0 +1,118 @@
1
+ Feature: Page Permalinks
2
+ As a content publisher
3
+ I want to customize the permalinks to my pages
4
+ so that my site is organized and can be accessed in an optimized way.
5
+
6
+ Scenario: Default Permalink format
7
+ Given some files with values:
8
+ | file | body |
9
+ | essays/hello.md | |
10
+ When I compile my site
11
+ Then my compiled site should have the file "essays/hello/index.html"
12
+
13
+ # in-page configuration
14
+
15
+ Scenario: Custom permalink format in page metadata.
16
+ Given some files with values:
17
+ | file | permalink | body |
18
+ | essays/hello.md | /yay/:path/:filename | |
19
+ When I compile my site
20
+ Then my compiled site should have the file "yay/essays/hello/index.html"
21
+
22
+ Scenario: Custom permalink format in page metadata using relative path.
23
+ Given some files with values:
24
+ | file | permalink | body |
25
+ | essays/hello.md | /:relative_path/:filename | |
26
+ When I compile my site
27
+ Then my compiled site should have the file "hello/index.html"
28
+
29
+ Scenario: Custom permalink format in page metadata using title.
30
+ Given some files with values:
31
+ | file | permalink | title | body |
32
+ | essays/hello.md | /:path/:title | Haro World | |
33
+ When I compile my site
34
+ Then my compiled site should have the file "essays/haro-world/index.html"
35
+
36
+ Scenario: Custom permalink format in page metadata using categories.
37
+ Given some files with values:
38
+ | file | permalink | categories | body |
39
+ | essays/hello.md | /:path/:categories/:filename | random stuff | |
40
+ When I compile my site
41
+ Then my compiled site should have the file "essays/random-stuff/hello/index.html"
42
+
43
+ Scenario: Custom permalink format in page metadata using date.
44
+ Given some files with values:
45
+ | file | permalink | date | body |
46
+ | essays/hello.md | /:path/:year/:month/:day/:filename | 2012-01-12 | |
47
+ When I compile my site
48
+ Then my compiled site should have the file "essays/2012/01/12/hello/index.html"
49
+
50
+ Scenario: Custom permalink format in page metadata using date with integer format.
51
+ Given some files with values:
52
+ | file | permalink | date | body |
53
+ | essays/hello.md | /:path/:year/:i_month/:i_day/:filename | 2012-01-02 | |
54
+ When I compile my site
55
+ Then my compiled site should have the file "essays/2012/1/2/hello/index.html"
56
+
57
+ Scenario: Literal permalink format in page metadata.
58
+ Given some files with values:
59
+ | file | permalink | body |
60
+ | essays/hello.md | /literal-page-permalink | |
61
+ When I compile my site
62
+ Then my compiled site should have the file "literal-page-permalink/index.html"
63
+
64
+ ## Collection configuration
65
+
66
+ Scenario: Custom permalink format in collection config.
67
+ Given a config file with values:
68
+ | essays | { "permalink" : "/yay/:path/:filename" } |
69
+ And some files with values:
70
+ | file | body |
71
+ | essays/hello.md | |
72
+ When I compile my site
73
+ Then my compiled site should have the file "yay/essays/hello/index.html"
74
+
75
+ Scenario: Custom permalink format in collection config using relative path.
76
+ Given a config file with values:
77
+ | essays | { "permalink" : "/:relative_path/:filename" } |
78
+ And some files with values:
79
+ | file | body |
80
+ | essays/hello.md | |
81
+ When I compile my site
82
+ Then my compiled site should have the file "hello/index.html"
83
+
84
+ Scenario: Custom permalink format in collection config using title.
85
+ Given a config file with values:
86
+ | essays | { "permalink" : "/:path/:title" } |
87
+ And some files with values:
88
+ | file | title | body |
89
+ | essays/hello.md | Haro World | |
90
+ When I compile my site
91
+ Then my compiled site should have the file "essays/haro-world/index.html"
92
+
93
+ Scenario: Custom permalink format in collection config using categories.
94
+ Given a config file with values:
95
+ | essays | { "permalink" : "/:path/:categories/:filename" } |
96
+ And some files with values:
97
+ | file | categories | body |
98
+ | essays/hello.md | random stuff | |
99
+ When I compile my site
100
+ Then my compiled site should have the file "essays/random-stuff/hello/index.html"
101
+
102
+ Scenario: Custom permalink format in collection config using date.
103
+ Given a config file with values:
104
+ | essays | { "permalink" : "/:path/:year/:month/:day/:filename" } |
105
+ And some files with values:
106
+ | file | date | body |
107
+ | essays/hello.md | 2012-01-12 | |
108
+ When I compile my site
109
+ Then my compiled site should have the file "essays/2012/01/12/hello/index.html"
110
+
111
+ Scenario: Custom permalink format in collection config using date with integer format.
112
+ Given a config file with values:
113
+ | essays | { "permalink" : "/:path/:year/:i_month/:i_day/:filename" } |
114
+ And some files with values:
115
+ | file | date | body |
116
+ | essays/hello.md | 2012-01-02 | |
117
+ When I compile my site
118
+ Then my compiled site should have the file "essays/2012/1/2/hello/index.html"