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
@@ -1,13 +1,24 @@
|
|
1
1
|
<!doctype html>
|
2
|
+
|
2
3
|
<html>
|
4
|
+
|
3
5
|
<head>
|
6
|
+
<title>Blog sources no title app</title>
|
4
7
|
</head>
|
8
|
+
|
5
9
|
<body>
|
10
|
+
|
6
11
|
<% if is_blog_article? %>
|
12
|
+
|
7
13
|
<%= yield %>
|
8
14
|
<%= current_article.url %>
|
15
|
+
|
9
16
|
<% else %>
|
17
|
+
|
10
18
|
<%= yield %>
|
19
|
+
|
11
20
|
<% end %>
|
21
|
+
|
12
22
|
</body>
|
23
|
+
|
13
24
|
</html>
|
@@ -1 +1,24 @@
|
|
1
|
-
|
1
|
+
<!doctype html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
|
5
|
+
<head>
|
6
|
+
<title>Blog sources no title app</title>
|
7
|
+
</head>
|
8
|
+
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<% if is_blog_article? %>
|
12
|
+
|
13
|
+
<%= yield %>
|
14
|
+
<%= current_article.url %>
|
15
|
+
|
16
|
+
<% else %>
|
17
|
+
|
18
|
+
<%= yield %>
|
19
|
+
|
20
|
+
<% end %>
|
21
|
+
|
22
|
+
</body>
|
23
|
+
|
24
|
+
</html>
|
@@ -1,9 +1,11 @@
|
|
1
1
|
Time.zone = "Pacific Time (US & Canada)"
|
2
2
|
|
3
|
-
activate :blog do |blog|
|
4
|
-
|
5
|
-
|
6
|
-
|
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
|
+
|
7
9
|
end
|
8
10
|
|
9
11
|
activate :directory_indexes
|
@@ -1,9 +1,11 @@
|
|
1
1
|
Time.zone = "Pacific Time (US & Canada)"
|
2
2
|
|
3
|
-
activate :blog do |blog|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
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
|
10
|
+
|
9
11
|
end
|
@@ -1,7 +1,9 @@
|
|
1
1
|
Time.zone = "Pacific Time (US & Canada)"
|
2
2
|
|
3
|
-
activate :blog do |blog|
|
4
|
-
|
5
|
-
|
6
|
-
|
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
|
+
|
7
9
|
end
|
@@ -1,15 +1,20 @@
|
|
1
1
|
<!doctype html>
|
2
2
|
<html>
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
3
|
+
<head></head>
|
4
|
+
|
5
|
+
<body>
|
6
|
+
|
7
|
+
<% if is_blog_article? %>
|
8
|
+
|
9
|
+
<%= yield %>
|
10
|
+
Url: <%= current_article.url %>
|
11
|
+
Previous: <%= current_article.previous_article.try( :url ) %>
|
12
|
+
Next: <%= current_article.next_article.try( :url ) %>
|
13
|
+
|
14
|
+
<% else %>
|
15
|
+
<%= yield %>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
</body>
|
19
|
+
|
15
20
|
</html>
|
@@ -1,4 +1,5 @@
|
|
1
|
-
en:
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
en :
|
2
|
+
|
3
|
+
hello : "Hello, world!"
|
4
|
+
language : "Language"
|
5
|
+
ok : "OK"
|
@@ -1,4 +1,5 @@
|
|
1
|
-
ru:
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
ru :
|
2
|
+
|
3
|
+
hello : "Привет, мир!"
|
4
|
+
language : "Язык"
|
5
|
+
ok : "отлично"
|
@@ -1,8 +1,19 @@
|
|
1
1
|
<html>
|
2
|
+
|
2
3
|
<head></head>
|
4
|
+
|
3
5
|
<body>
|
6
|
+
|
4
7
|
<h1><%= t :hello %></h1>
|
5
8
|
<p><%= t :language %>: <%= lang %></p>
|
9
|
+
|
6
10
|
<%= yield %>
|
11
|
+
|
12
|
+
<% if is_blog_article? %>
|
13
|
+
Previous: <%= current_article.article_locale_previous.try( :url ) %>
|
14
|
+
Next: <%= current_article.article_locale_next.try( :url ) %>
|
15
|
+
<% end %>
|
16
|
+
|
7
17
|
</body>
|
8
|
-
|
18
|
+
|
19
|
+
</html>
|
@@ -1,17 +1,19 @@
|
|
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
|
1
|
+
activate :blog do | blog |
|
8
2
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
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
|
+
}
|
13
15
|
}
|
14
|
-
|
16
|
+
|
15
17
|
end
|
16
18
|
|
17
19
|
activate :directory_indexes
|
@@ -1,15 +1,17 @@
|
|
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
|
1
|
+
activate :blog do | blog |
|
8
2
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
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
|
+
}
|
13
15
|
}
|
14
|
-
|
16
|
+
|
15
17
|
end
|
@@ -1,15 +1,18 @@
|
|
1
|
-
activate :blog do |blog|
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
1
|
+
activate :blog do | blog |
|
2
|
+
|
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
|
+
|
12
|
+
:category => {
|
13
|
+
:link => '/categories/:category.html',
|
14
|
+
:template => '/category.html'
|
15
|
+
}
|
13
16
|
}
|
14
|
-
|
17
|
+
|
15
18
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<% blog.articles[ 0...5 ].each_with_index do | article, i | %>
|
2
|
+
|
3
|
+
<article class="<%= ( i == 0 ) ? 'first' : '' %>">
|
4
|
+
|
5
|
+
<h1><a href="<%= article.url %>"><%= article.title %></a> <span><%= article.date.strftime( '%b %e %Y' ) %></span></h1>
|
6
|
+
|
7
|
+
<%= article.summary %>
|
8
|
+
|
9
|
+
<div class="more"><a href="<%= article.url %>">read on »</a></div>
|
10
|
+
|
11
|
+
</article>
|
12
|
+
|
13
|
+
<% end %>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
|
5
|
+
<head>
|
6
|
+
<title>Blog sources app</title>
|
7
|
+
</head>
|
8
|
+
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<% if is_blog_article? %>
|
12
|
+
|
13
|
+
<%= yield %>
|
14
|
+
|
15
|
+
URL : <%= current_article.url %>
|
16
|
+
Category : <%= current_article.data[ :category ] %>
|
17
|
+
|
18
|
+
<% else %>
|
19
|
+
|
20
|
+
<%= yield %>
|
21
|
+
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
</body>
|
25
|
+
|
26
|
+
</html>
|