middleman-blog 4.0.2 → 4.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +69 -0
  3. data/.travis.yml +20 -28
  4. data/CHANGELOG.md +4 -4
  5. data/Gemfile +20 -21
  6. data/Gemfile-4.x +38 -0
  7. data/README.md +0 -6
  8. data/Rakefile +14 -12
  9. data/features/summary.feature +3 -6
  10. data/features/support/env.rb +7 -10
  11. data/features/support/time_steps.rb +7 -10
  12. data/features/tags.feature +1 -1
  13. data/fixtures/article-dirs-app/config-directory-indexes.rb +2 -2
  14. data/fixtures/article-dirs-app/config-permalink-with-dot.rb +2 -2
  15. data/fixtures/article-dirs-app/config.rb +2 -2
  16. data/fixtures/blog-sources-app/config.rb +2 -5
  17. data/fixtures/blog-sources-no-date-app/config.rb +2 -5
  18. data/fixtures/blog-sources-no-day-app/config.rb +2 -5
  19. data/fixtures/blog-sources-no-title-app/config.rb +1 -4
  20. data/fixtures/blog-sources-subdirs-app/config.rb +3 -6
  21. data/fixtures/calendar-and-tag-app/config-directory-indexes.rb +3 -3
  22. data/fixtures/calendar-and-tag-app/config.rb +4 -4
  23. data/fixtures/calendar-app/config-directory-indexes.rb +5 -7
  24. data/fixtures/calendar-app/config-only-year.rb +7 -9
  25. data/fixtures/calendar-app/config.rb +5 -7
  26. data/fixtures/calendar-multiblog-app/config.rb +12 -12
  27. data/fixtures/custom-collections-app/config-blog-prefix.rb +7 -7
  28. data/fixtures/custom-collections-app/config-directory-indexes.rb +6 -6
  29. data/fixtures/custom-collections-app/config.rb +6 -6
  30. data/fixtures/custom-collections-multiblog-app/config.rb +14 -14
  31. data/fixtures/custom-collections-sources-app/config.rb +5 -5
  32. data/fixtures/custom-permalinks-app/config-directory-indexes.rb +3 -3
  33. data/fixtures/custom-permalinks-app/config.rb +3 -3
  34. data/fixtures/default-template-app/Gemfile +5 -5
  35. data/fixtures/default-template-app/config.rb +11 -11
  36. data/fixtures/filename-date-app/config.rb +1 -1
  37. data/fixtures/future-date-app/config.rb +2 -2
  38. data/fixtures/indexes-app/config.rb +2 -2
  39. data/fixtures/lang-path-app/config.rb +2 -2
  40. data/fixtures/layouts-app/config.rb +1 -1
  41. data/fixtures/paginate-app/config-directory-indexes.rb +12 -14
  42. data/fixtures/paginate-app/config-paginate-off.rb +12 -14
  43. data/fixtures/paginate-app/config.rb +12 -14
  44. data/fixtures/paginate-multiblog-app/config.rb +13 -13
  45. data/fixtures/permalink-app/config.rb +3 -6
  46. data/fixtures/preview-app/config.rb +2 -2
  47. data/fixtures/published-app/config.rb +2 -2
  48. data/fixtures/tags-app/config-directory-indexes.rb +5 -5
  49. data/fixtures/tags-app/config.rb +5 -5
  50. data/fixtures/tags-multiblog-app/config.rb +10 -10
  51. data/lib/middleman-blog.rb +6 -8
  52. data/lib/middleman-blog/blog_article.rb +20 -40
  53. data/lib/middleman-blog/blog_data.rb +20 -27
  54. data/lib/middleman-blog/calendar_pages.rb +8 -14
  55. data/lib/middleman-blog/commands/article.rb +54 -63
  56. data/lib/middleman-blog/custom_pages.rb +8 -9
  57. data/lib/middleman-blog/extension.rb +7 -8
  58. data/lib/middleman-blog/helpers.rb +17 -26
  59. data/lib/middleman-blog/paginator.rb +5 -4
  60. data/lib/middleman-blog/tag_pages.rb +11 -23
  61. data/lib/middleman-blog/truncate_html.rb +8 -7
  62. data/lib/middleman-blog/uri_templates.rb +31 -17
  63. data/lib/middleman-blog/version.rb +1 -3
  64. data/lib/middleman_extension.rb +1 -1
  65. data/middleman-blog.gemspec +15 -15
  66. data/spec/spec_helper.rb +1 -4
  67. data/spec/uri_templates_spec.rb +23 -30
  68. metadata +10 -9
@@ -1,6 +1,3 @@
1
-
2
- activate :blog do | blog |
3
-
4
- blog.sources = "blog/:year-:month-:day-:title.html"
5
-
1
+ activate :blog do |blog|
2
+ blog.sources = 'blog/:year-:month-:day-:title.html'
6
3
  end
@@ -1,6 +1,3 @@
1
-
2
- activate :blog do | blog |
3
-
4
- blog.sources = "blog/:title.html"
5
-
1
+ activate :blog do |blog|
2
+ blog.sources = 'blog/:title.html'
6
3
  end
@@ -1,6 +1,3 @@
1
-
2
- activate :blog do | blog |
3
-
4
- blog.sources = ":year-:month-:title.html"
5
-
1
+ activate :blog do |blog|
2
+ blog.sources = ':year-:month-:title.html'
6
3
  end
@@ -1,6 +1,3 @@
1
-
2
1
  activate :blog do |blog|
3
-
4
- blog.sources = ":year-:month-:day.html"
5
-
2
+ blog.sources = ':year-:month-:day.html'
6
3
  end
@@ -1,7 +1,4 @@
1
-
2
- activate :blog do | blog |
3
-
4
- blog.sources = "blog/:title.html"
5
- blog.permalink = "blog/{title}.html"
6
-
1
+ activate :blog do |blog|
2
+ blog.sources = 'blog/:title.html'
3
+ blog.permalink = 'blog/{title}.html'
7
4
  end
@@ -1,8 +1,8 @@
1
- Time.zone = "Pacific Time (US & Canada)"
1
+ Time.zone = 'Pacific Time (US & Canada)'
2
2
 
3
3
  activate :blog do |blog|
4
- blog.sources = "blog/:year-:month-:day-:title.html"
5
- blog.permalink = "blog/:year-:month-:day-:title.html"
4
+ blog.sources = 'blog/:year-:month-:day-:title.html'
5
+ blog.permalink = 'blog/:year-:month-:day-:title.html'
6
6
  blog.calendar_template = 'calendar.html'
7
7
  end
8
8
 
@@ -1,7 +1,7 @@
1
- Time.zone = "Pacific Time (US & Canada)"
1
+ Time.zone = 'Pacific Time (US & Canada)'
2
2
 
3
3
  activate :blog do |blog|
4
- blog.sources = "blog/:year-:month-:day-:title.html"
5
- blog.permalink = "blog/:year-:month-:day-:title.html"
6
- blog.calendar_template = blog.tag_template = "archive.html"
4
+ blog.sources = 'blog/:year-:month-:day-:title.html'
5
+ blog.permalink = 'blog/:year-:month-:day-:title.html'
6
+ blog.calendar_template = blog.tag_template = 'archive.html'
7
7
  end
@@ -1,11 +1,9 @@
1
- Time.zone = "Pacific Time (US & Canada)"
2
-
3
- activate :blog do | blog |
4
-
5
- blog.sources = "blog/:year-:month-:day-:title.html"
6
- blog.permalink = "blog/:year-:month-:day-:title.html"
7
- blog.calendar_template = 'calendar.html'
1
+ Time.zone = 'Pacific Time (US & Canada)'
8
2
 
3
+ activate :blog do |blog|
4
+ blog.sources = 'blog/:year-:month-:day-:title.html'
5
+ blog.permalink = 'blog/:year-:month-:day-:title.html'
6
+ blog.calendar_template = 'calendar.html'
9
7
  end
10
8
 
11
9
  activate :directory_indexes
@@ -1,11 +1,9 @@
1
- Time.zone = "Pacific Time (US & Canada)"
2
-
3
- activate :blog do | blog |
4
-
5
- blog.sources = "blog/:year-:month-:day-:title.html"
6
- blog.permalink = "blog/:year-:month-:day-:title.html"
7
- blog.calendar_template = 'calendar.html'
8
- blog.generate_month_pages = false
9
- blog.generate_day_pages = false
1
+ Time.zone = 'Pacific Time (US & Canada)'
10
2
 
3
+ activate :blog do |blog|
4
+ blog.sources = 'blog/:year-:month-:day-:title.html'
5
+ blog.permalink = 'blog/:year-:month-:day-:title.html'
6
+ blog.calendar_template = 'calendar.html'
7
+ blog.generate_month_pages = false
8
+ blog.generate_day_pages = false
11
9
  end
@@ -1,9 +1,7 @@
1
- Time.zone = "Pacific Time (US & Canada)"
2
-
3
- activate :blog do | blog |
4
-
5
- blog.sources = "blog/:year-:month-:day-:title.html"
6
- blog.permalink = "blog/:year-:month-:day-:title.html"
7
- blog.calendar_template = 'calendar.html'
1
+ Time.zone = 'Pacific Time (US & Canada)'
8
2
 
3
+ activate :blog do |blog|
4
+ blog.sources = 'blog/:year-:month-:day-:title.html'
5
+ blog.permalink = 'blog/:year-:month-:day-:title.html'
6
+ blog.calendar_template = 'calendar.html'
9
7
  end
@@ -1,17 +1,17 @@
1
- Time.zone = "Pacific Time (US & Canada)"
1
+ Time.zone = 'Pacific Time (US & Canada)'
2
2
 
3
3
  activate :blog do |blog|
4
- blog.name = "blog_name_1"
5
- blog.prefix = "blog1"
6
- blog.sources = ":year-:month-:day-:title.html"
7
- blog.permalink = ":year-:month-:day-:title.html"
8
- blog.calendar_template = "calendar1.html"
4
+ blog.name = 'blog_name_1'
5
+ blog.prefix = 'blog1'
6
+ blog.sources = ':year-:month-:day-:title.html'
7
+ blog.permalink = ':year-:month-:day-:title.html'
8
+ blog.calendar_template = 'calendar1.html'
9
9
  end
10
10
 
11
11
  activate :blog do |blog|
12
- blog.name = "blog_name_2"
13
- blog.prefix = "blog2"
14
- blog.sources = ":year-:month-:day-:title.html"
15
- blog.permalink = ":year-:month-:day-:title.html"
16
- blog.calendar_template = "calendar2.html"
17
- end
12
+ blog.name = 'blog_name_2'
13
+ blog.prefix = 'blog2'
14
+ blog.sources = ':year-:month-:day-:title.html'
15
+ blog.permalink = ':year-:month-:day-:title.html'
16
+ blog.calendar_template = 'calendar2.html'
17
+ end
@@ -1,13 +1,13 @@
1
- require "middleman-blog"
1
+ require 'middleman-blog'
2
2
  activate :blog do |blog|
3
- blog.prefix = "blog/"
4
- blog.sources = ":year-:month-:day-:title.html"
5
- blog.permalink = ":year-:month-:day-:title.html"
3
+ blog.prefix = 'blog/'
4
+ blog.sources = ':year-:month-:day-:title.html'
5
+ blog.permalink = ':year-:month-:day-:title.html'
6
6
 
7
7
  blog.custom_collections = {
8
- :category => {
9
- :link => '/categories/:category.html',
10
- :template => '/category.html'
8
+ category: {
9
+ link: '/categories/:category.html',
10
+ template: '/category.html'
11
11
  }
12
12
  }
13
13
  end
@@ -1,11 +1,11 @@
1
- require "middleman-blog"
1
+ require 'middleman-blog'
2
2
  activate :blog do |blog|
3
- blog.sources = "blog/:year-:month-:day-:title.html"
4
- blog.permalink = "blog/:year-:month-:day-:title.html"
3
+ blog.sources = 'blog/:year-:month-:day-:title.html'
4
+ blog.permalink = 'blog/:year-:month-:day-:title.html'
5
5
  blog.custom_collections = {
6
- :category => {
7
- :link => '/categories/:category.html',
8
- :template => '/category.html'
6
+ category: {
7
+ link: '/categories/:category.html',
8
+ template: '/category.html'
9
9
  }
10
10
  }
11
11
  end
@@ -1,12 +1,12 @@
1
- require "middleman-blog"
1
+ require 'middleman-blog'
2
2
  activate :blog do |blog|
3
- blog.sources = "blog/:year-:month-:day-:title.html"
4
- blog.permalink = "blog/:year-:month-:day-:title.html"
3
+ blog.sources = 'blog/:year-:month-:day-:title.html'
4
+ blog.permalink = 'blog/:year-:month-:day-:title.html'
5
5
 
6
6
  blog.custom_collections = {
7
- :category => {
8
- :link => '/categories/:category.html',
9
- :template => '/category.html'
7
+ category: {
8
+ link: '/categories/:category.html',
9
+ template: '/category.html'
10
10
  }
11
11
  }
12
12
  end
@@ -1,27 +1,27 @@
1
1
  activate :blog do |blog|
2
- blog.name = "blog_name_1"
3
- blog.prefix = "blog1"
4
- blog.sources = ":year-:month-:day-:title.html"
5
- blog.permalink = ":year-:month-:day-:title.html"
2
+ blog.name = 'blog_name_1'
3
+ blog.prefix = 'blog1'
4
+ blog.sources = ':year-:month-:day-:title.html'
5
+ blog.permalink = ':year-:month-:day-:title.html'
6
6
 
7
7
  blog.custom_collections = {
8
- :category => {
9
- :link => 'categories/:category.html',
10
- :template => 'category1.html'
8
+ category: {
9
+ link: 'categories/:category.html',
10
+ template: 'category1.html'
11
11
  }
12
12
  }
13
13
  end
14
14
 
15
15
  activate :blog do |blog|
16
- blog.name = "blog_name_2"
17
- blog.prefix = "blog2"
18
- blog.sources = ":year-:month-:day-:title.html"
19
- blog.permalink = ":year-:month-:day-:title.html"
16
+ blog.name = 'blog_name_2'
17
+ blog.prefix = 'blog2'
18
+ blog.sources = ':year-:month-:day-:title.html'
19
+ blog.permalink = ':year-:month-:day-:title.html'
20
20
 
21
21
  blog.custom_collections = {
22
- :category => {
23
- :link => 'categories/:category.html',
24
- :template => 'category2.html'
22
+ category: {
23
+ link: 'categories/:category.html',
24
+ template: 'category2.html'
25
25
  }
26
26
  }
27
27
  end
@@ -1,11 +1,11 @@
1
1
  activate :blog do |blog|
2
- blog.sources = ":category/:year-:month-:day-:title.html"
3
- blog.permalink = "blog/:year-:month-:day-:title.html"
2
+ blog.sources = ':category/:year-:month-:day-:title.html'
3
+ blog.permalink = 'blog/:year-:month-:day-:title.html'
4
4
 
5
5
  blog.custom_collections = {
6
- :category => {
7
- :link => '/categories/:category.html',
8
- :template => '/category.html'
6
+ category: {
7
+ link: '/categories/:category.html',
8
+ template: '/category.html'
9
9
  }
10
10
  }
11
11
  end
@@ -1,7 +1,7 @@
1
- require "middleman-blog"
1
+ require 'middleman-blog'
2
2
  activate :blog do |blog|
3
- blog.sources = "blog/:year-:month-:day-:title.html"
4
- blog.permalink = "blog/:category/:title.html"
3
+ blog.sources = 'blog/:year-:month-:day-:title.html'
4
+ blog.permalink = 'blog/:category/:title.html'
5
5
  end
6
6
 
7
7
  activate :directory_indexes
@@ -1,5 +1,5 @@
1
- require "middleman-blog"
1
+ require 'middleman-blog'
2
2
  activate :blog do |blog|
3
- blog.sources = "blog/:year-:month-:day-:title.html"
4
- blog.permalink = "blog/:category/:title.html"
3
+ blog.sources = 'blog/:year-:month-:day-:title.html'
4
+ blog.permalink = 'blog/:category/:title.html'
5
5
  end
@@ -1,6 +1,6 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
- gem "middleman", :github => "middleman/middleman"
4
- gem "middleman-blog", :github => "middleman/middleman-blog"
5
- gem "middleman-syntax", :github => "middleman/middleman-syntax"
6
- gem "zurb-foundation", "~> 4.1.6"
3
+ gem 'middleman', github: 'middleman/middleman'
4
+ gem 'middleman-blog', github: 'middleman/middleman-blog'
5
+ gem 'middleman-syntax', github: 'middleman/middleman-syntax'
6
+ gem 'zurb-foundation', '~> 4.1.6'
@@ -1,19 +1,19 @@
1
1
  require 'zurb-foundation'
2
2
 
3
- spec = Gem::Specification.find_by_name("zurb-foundation")
4
- set :js_assets_paths, [File.join(spec.gem_dir, "js")]
3
+ spec = Gem::Specification.find_by_name('zurb-foundation')
4
+ set :js_assets_paths, [File.join(spec.gem_dir, 'js')]
5
5
 
6
6
  activate :directory_indexes
7
7
 
8
8
  activate :blog
9
9
 
10
- set :blog_name, "Deep Thoughts"
11
- set :blog_author, "Nick Adams"
12
- set :blog_avatar, "http://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50"
13
- set :top_nav_title, { :title => "Home", :target => "index.html" }
10
+ set :blog_name, 'Deep Thoughts'
11
+ set :blog_author, 'Nick Adams'
12
+ set :blog_avatar, 'http://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50'
13
+ set :top_nav_title, title: 'Home', target: 'index.html'
14
14
  set :top_nav_items, [
15
- { :title => "About Me", :target => "about-me.html" },
16
- { :title => "Archives", :target => "archives.html" }
15
+ { title: 'About Me', target: 'about-me.html' },
16
+ { title: 'Archives', target: 'archives.html' }
17
17
  # { :title => "Other Page", :target => "other-page.html" }
18
18
  ]
19
19
 
@@ -29,7 +29,7 @@ helpers do
29
29
  end
30
30
 
31
31
  def link_to_with_active(title, url, class_name = 'active')
32
- active_class = (current_resource == sitemap.find_resource_by_path(url)) ? class_name : ''
33
- link_to(title, url, :class => active_class)
32
+ active_class = current_resource == sitemap.find_resource_by_path(url) ? class_name : ''
33
+ link_to(title, url, class: active_class)
34
34
  end
35
- end
35
+ end
@@ -1,3 +1,3 @@
1
- Time.zone = "Pacific Time (US & Canada)"
1
+ Time.zone = 'Pacific Time (US & Canada)'
2
2
 
3
3
  activate :blog
@@ -1,5 +1,5 @@
1
- Time.zone = "Pacific Time (US & Canada)"
1
+ Time.zone = 'Pacific Time (US & Canada)'
2
2
 
3
3
  activate :blog do |blog|
4
- blog.sources = "blog/:year-:month-:day-:title.html"
4
+ blog.sources = 'blog/:year-:month-:day-:title.html'
5
5
  end
@@ -1,5 +1,5 @@
1
1
  activate :blog do |blog|
2
- blog.sources = ":year/:month/:day/:title.html"
2
+ blog.sources = ':year/:month/:day/:title.html'
3
3
  end
4
4
 
5
- activate :directory_indexes
5
+ activate :directory_indexes
@@ -1,6 +1,6 @@
1
1
  activate :i18n
2
2
 
3
3
  activate :blog do |blog|
4
- blog.sources = "blog/{year}-{month}-{day}-{title}.{lang}.html"
5
- blog.permalink = "{lang}/{title}.html"
4
+ blog.sources = 'blog/{year}-{month}-{day}-{title}.{lang}.html'
5
+ blog.permalink = '{lang}/{title}.html'
6
6
  end
@@ -1,3 +1,3 @@
1
1
  activate :blog do |blog|
2
- blog.sources = ":year/:month/:day/:title.html"
2
+ blog.sources = ':year/:month/:day/:title.html'
3
3
  end
@@ -1,19 +1,17 @@
1
- activate :blog do | blog |
1
+ activate :blog do |blog|
2
+ blog.sources = 'blog/:year-:month-:day-:title.html'
3
+ blog.permalink = 'blog/:year-:month-:day-:title.html'
4
+ blog.calendar_template = 'calendar.html'
5
+ blog.tag_template = 'tag.html'
6
+ blog.paginate = true
7
+ blog.per_page = 5
2
8
 
3
- blog.sources = "blog/:year-:month-:day-:title.html"
4
- blog.permalink = "blog/:year-:month-:day-:title.html"
5
- blog.calendar_template = 'calendar.html'
6
- blog.tag_template = 'tag.html'
7
- blog.paginate = true
8
- blog.per_page = 5
9
-
10
- blog.custom_collections = {
11
- :category => {
12
- :link => '/categories/:category.html',
13
- :template => '/category.html'
14
- }
9
+ blog.custom_collections = {
10
+ category: {
11
+ link: '/categories/:category.html',
12
+ template: '/category.html'
15
13
  }
16
-
14
+ }
17
15
  end
18
16
 
19
17
  activate :directory_indexes
@@ -1,17 +1,15 @@
1
- activate :blog do | blog |
1
+ activate :blog do |blog|
2
+ blog.sources = 'blog/:year-:month-:day-:title.html'
3
+ blog.permalink = 'blog/:year-:month-:day-:title.html'
4
+ blog.calendar_template = 'calendar.html'
5
+ blog.tag_template = 'tag.html'
6
+ # blog.paginate = true
7
+ blog.per_page = 5
2
8
 
3
- blog.sources = "blog/:year-:month-:day-:title.html"
4
- blog.permalink = "blog/:year-:month-:day-:title.html"
5
- blog.calendar_template = 'calendar.html'
6
- blog.tag_template = 'tag.html'
7
- #blog.paginate = true
8
- blog.per_page = 5
9
-
10
- blog.custom_collections = {
11
- :category => {
12
- :link => '/categories/:category.html',
13
- :template => '/category.html'
14
- }
9
+ blog.custom_collections = {
10
+ category: {
11
+ link: '/categories/:category.html',
12
+ template: '/category.html'
15
13
  }
16
-
14
+ }
17
15
  end