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/.gemtest DELETED
File without changes
@@ -1,9 +0,0 @@
1
- Feature: Flexible article sources
2
- Scenario: Blog sources may not include the date in the filename
3
- Given the Server is running at "no-date-app"
4
- When I go to "/2011/01/01/new-article.html"
5
- Then I should see "/2011/01/01/new-article.html"
6
- When I go to "/blog/new-article.html"
7
- Then I should see "Not Found"
8
- When I go to "/"
9
- Then I should see "/2011/01/01/new-article.html"
@@ -1,12 +0,0 @@
1
- Feature: Permalinks can include arbitrary data from frontmatter
2
-
3
- Scenario: Articles list links using permalink with frontmatter data
4
- Given the Server is running at "permalink-data-app"
5
- When I go to "/index.html"
6
- Then I should see "news/a-custom-string-2011-01-01-new-article.html"
7
-
8
- Scenario: Articles can be accessed through permalinks with frontmatter data
9
- Given the Server is running at "permalink-data-app"
10
- When I go to "news/a-custom-string-2011-01-01-new-article.html"
11
- Then I should see "Newer Article Content"
12
- And I should see "Category: news"
@@ -1 +0,0 @@
1
- <%= current_article.url %>
@@ -1,8 +0,0 @@
1
- ---
2
- title: "Another post"
3
- published: true
4
- date: 2014/01/15
5
- ---
6
-
7
- Lorem ipsum dolor sit amet
8
-
@@ -1,8 +0,0 @@
1
- ---
2
- title: "Yet another post"
3
- published: true
4
- date: 2014/01/15
5
- ---
6
-
7
- Lorem ipsum dolor sit amet
8
-
@@ -1,3 +0,0 @@
1
- activate :blog do |blog|
2
- blog.sources = "blog/:title.html"
3
- end
@@ -1 +0,0 @@
1
- <%= current_article.url %>
@@ -1,6 +0,0 @@
1
- ---
2
- title: "Newer Article"
3
- date: 2011-01-01
4
- ---
5
-
6
- Newer Article Content
@@ -1,9 +0,0 @@
1
- <% blog.articles[0...5].each_with_index do |article, i| %>
2
- <article class="<%= (i == 0) ? 'first' : '' %>">
3
- <h1><a href="<%= article.url %>"><%= article.title %></a> <span><%= article.date.strftime('%b %e %Y') %></span></h1>
4
-
5
- <%= article.summary %>
6
-
7
- <div class="more"><a href="<%= article.url %>">read on &raquo;</a></div>
8
- </article>
9
- <% end %>
@@ -1,3 +0,0 @@
1
- activate :blog do |blog|
2
- blog.sources = ":year-:month-:title.html"
3
- end
@@ -1,6 +0,0 @@
1
- ---
2
- title: "Testing Article"
3
- date: 2012-08-01
4
- ---
5
-
6
- Testing Article Content
@@ -1,13 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- </head>
5
- <body>
6
- <% if is_blog_article? %>
7
- <%= yield %>
8
- <%= current_article.url %>
9
- <% else %>
10
- <%= yield %>
11
- <% end %>
12
- </body>
13
- </html>
@@ -1,6 +0,0 @@
1
- ---
2
- title: "Testing Article"
3
- date: 2013-08-07
4
- ---
5
-
6
- Testing Article Content
@@ -1,7 +0,0 @@
1
- ---
2
- title: "Testing Article"
3
- slug: slug-from-frontmatter
4
- date: 2013-08-08
5
- ---
6
-
7
- Article with slug specified in frontmatter
@@ -1,13 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- </head>
5
- <body>
6
- <% if is_blog_article? %>
7
- <%= yield %>
8
- <%= current_article.url %>
9
- <% else %>
10
- <%= yield %>
11
- <% end %>
12
- </body>
13
- </html>
@@ -1,5 +0,0 @@
1
- require "middleman-blog"
2
- activate :blog do |blog|
3
- blog.sources = ":category/:year-:month-:day-:title.html"
4
- blog.permalink = ":category/:custom-:year-:month-:day-:title.html"
5
- end
@@ -1,3 +0,0 @@
1
- <% blog.articles[0...12].each do |article| %>
2
- <li><a href="<%= article.url %>"><%= article.title %></a> <time><%= article.date.strftime('%b %e') %></time></li>
3
- <% end %>
@@ -1,14 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- </head>
5
- <body>
6
- <% if is_blog_article? %>
7
- URL: <%= current_article.url %>
8
- Category: <%= current_article.data[:category] %>
9
- <%= yield %>
10
- <% else %>
11
- <%= yield %>
12
- <% end %>
13
- </body>
14
- </html>
@@ -1,7 +0,0 @@
1
- ---
2
- title: "Newer Article"
3
- date: 2011-01-01
4
- custom: "A custom string"
5
- ---
6
-
7
- Newer Article Content