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.
- checksums.yaml +5 -5
- data/.rubocop.yml +69 -0
- data/.travis.yml +20 -28
- data/CHANGELOG.md +4 -4
- data/Gemfile +20 -21
- data/Gemfile-4.x +38 -0
- data/README.md +0 -6
- data/Rakefile +14 -12
- data/features/summary.feature +3 -6
- data/features/support/env.rb +7 -10
- data/features/support/time_steps.rb +7 -10
- data/features/tags.feature +1 -1
- data/fixtures/article-dirs-app/config-directory-indexes.rb +2 -2
- data/fixtures/article-dirs-app/config-permalink-with-dot.rb +2 -2
- data/fixtures/article-dirs-app/config.rb +2 -2
- data/fixtures/blog-sources-app/config.rb +2 -5
- data/fixtures/blog-sources-no-date-app/config.rb +2 -5
- data/fixtures/blog-sources-no-day-app/config.rb +2 -5
- data/fixtures/blog-sources-no-title-app/config.rb +1 -4
- data/fixtures/blog-sources-subdirs-app/config.rb +3 -6
- data/fixtures/calendar-and-tag-app/config-directory-indexes.rb +3 -3
- data/fixtures/calendar-and-tag-app/config.rb +4 -4
- data/fixtures/calendar-app/config-directory-indexes.rb +5 -7
- data/fixtures/calendar-app/config-only-year.rb +7 -9
- data/fixtures/calendar-app/config.rb +5 -7
- data/fixtures/calendar-multiblog-app/config.rb +12 -12
- data/fixtures/custom-collections-app/config-blog-prefix.rb +7 -7
- data/fixtures/custom-collections-app/config-directory-indexes.rb +6 -6
- data/fixtures/custom-collections-app/config.rb +6 -6
- data/fixtures/custom-collections-multiblog-app/config.rb +14 -14
- data/fixtures/custom-collections-sources-app/config.rb +5 -5
- data/fixtures/custom-permalinks-app/config-directory-indexes.rb +3 -3
- data/fixtures/custom-permalinks-app/config.rb +3 -3
- data/fixtures/default-template-app/Gemfile +5 -5
- data/fixtures/default-template-app/config.rb +11 -11
- data/fixtures/filename-date-app/config.rb +1 -1
- data/fixtures/future-date-app/config.rb +2 -2
- data/fixtures/indexes-app/config.rb +2 -2
- data/fixtures/lang-path-app/config.rb +2 -2
- data/fixtures/layouts-app/config.rb +1 -1
- data/fixtures/paginate-app/config-directory-indexes.rb +12 -14
- data/fixtures/paginate-app/config-paginate-off.rb +12 -14
- data/fixtures/paginate-app/config.rb +12 -14
- data/fixtures/paginate-multiblog-app/config.rb +13 -13
- data/fixtures/permalink-app/config.rb +3 -6
- data/fixtures/preview-app/config.rb +2 -2
- data/fixtures/published-app/config.rb +2 -2
- data/fixtures/tags-app/config-directory-indexes.rb +5 -5
- data/fixtures/tags-app/config.rb +5 -5
- data/fixtures/tags-multiblog-app/config.rb +10 -10
- data/lib/middleman-blog.rb +6 -8
- data/lib/middleman-blog/blog_article.rb +20 -40
- data/lib/middleman-blog/blog_data.rb +20 -27
- data/lib/middleman-blog/calendar_pages.rb +8 -14
- data/lib/middleman-blog/commands/article.rb +54 -63
- data/lib/middleman-blog/custom_pages.rb +8 -9
- data/lib/middleman-blog/extension.rb +7 -8
- data/lib/middleman-blog/helpers.rb +17 -26
- data/lib/middleman-blog/paginator.rb +5 -4
- data/lib/middleman-blog/tag_pages.rb +11 -23
- data/lib/middleman-blog/truncate_html.rb +8 -7
- data/lib/middleman-blog/uri_templates.rb +31 -17
- data/lib/middleman-blog/version.rb +1 -3
- data/lib/middleman_extension.rb +1 -1
- data/middleman-blog.gemspec +15 -15
- data/spec/spec_helper.rb +1 -4
- data/spec/uri_templates_spec.rb +23 -30
- metadata +10 -9
@@ -1,8 +1,8 @@
|
|
1
|
-
Time.zone =
|
1
|
+
Time.zone = 'Pacific Time (US & Canada)'
|
2
2
|
|
3
3
|
activate :blog do |blog|
|
4
|
-
blog.sources =
|
5
|
-
blog.permalink =
|
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 =
|
1
|
+
Time.zone = 'Pacific Time (US & Canada)'
|
2
2
|
|
3
3
|
activate :blog do |blog|
|
4
|
-
blog.sources =
|
5
|
-
blog.permalink =
|
6
|
-
blog.calendar_template = blog.tag_template =
|
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 =
|
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 =
|
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 =
|
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 =
|
1
|
+
Time.zone = 'Pacific Time (US & Canada)'
|
2
2
|
|
3
3
|
activate :blog do |blog|
|
4
|
-
blog.name =
|
5
|
-
blog.prefix =
|
6
|
-
blog.sources =
|
7
|
-
blog.permalink =
|
8
|
-
blog.calendar_template =
|
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 =
|
13
|
-
blog.prefix =
|
14
|
-
blog.sources =
|
15
|
-
blog.permalink =
|
16
|
-
blog.calendar_template =
|
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
|
1
|
+
require 'middleman-blog'
|
2
2
|
activate :blog do |blog|
|
3
|
-
blog.prefix =
|
4
|
-
blog.sources =
|
5
|
-
blog.permalink =
|
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
|
-
:
|
9
|
-
:
|
10
|
-
:
|
8
|
+
category: {
|
9
|
+
link: '/categories/:category.html',
|
10
|
+
template: '/category.html'
|
11
11
|
}
|
12
12
|
}
|
13
13
|
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
require
|
1
|
+
require 'middleman-blog'
|
2
2
|
activate :blog do |blog|
|
3
|
-
blog.sources =
|
4
|
-
blog.permalink =
|
3
|
+
blog.sources = 'blog/:year-:month-:day-:title.html'
|
4
|
+
blog.permalink = 'blog/:year-:month-:day-:title.html'
|
5
5
|
blog.custom_collections = {
|
6
|
-
:
|
7
|
-
:
|
8
|
-
:
|
6
|
+
category: {
|
7
|
+
link: '/categories/:category.html',
|
8
|
+
template: '/category.html'
|
9
9
|
}
|
10
10
|
}
|
11
11
|
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
require
|
1
|
+
require 'middleman-blog'
|
2
2
|
activate :blog do |blog|
|
3
|
-
blog.sources =
|
4
|
-
blog.permalink =
|
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
|
-
:
|
8
|
-
:
|
9
|
-
:
|
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 =
|
3
|
-
blog.prefix =
|
4
|
-
blog.sources =
|
5
|
-
blog.permalink =
|
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
|
-
:
|
9
|
-
:
|
10
|
-
:
|
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 =
|
17
|
-
blog.prefix =
|
18
|
-
blog.sources =
|
19
|
-
blog.permalink =
|
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
|
-
:
|
23
|
-
:
|
24
|
-
:
|
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 =
|
3
|
-
blog.permalink =
|
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
|
-
:
|
7
|
-
:
|
8
|
-
:
|
6
|
+
category: {
|
7
|
+
link: '/categories/:category.html',
|
8
|
+
template: '/category.html'
|
9
9
|
}
|
10
10
|
}
|
11
11
|
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
1
|
+
require 'middleman-blog'
|
2
2
|
activate :blog do |blog|
|
3
|
-
blog.sources =
|
4
|
-
blog.permalink =
|
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
|
1
|
+
require 'middleman-blog'
|
2
2
|
activate :blog do |blog|
|
3
|
-
blog.sources =
|
4
|
-
blog.permalink =
|
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
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
gem
|
4
|
-
gem
|
5
|
-
gem
|
6
|
-
gem
|
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(
|
4
|
-
set :js_assets_paths, [File.join(spec.gem_dir,
|
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,
|
11
|
-
set :blog_author,
|
12
|
-
set :blog_avatar,
|
13
|
-
set :top_nav_title,
|
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
|
-
{ :
|
16
|
-
{ :
|
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 =
|
33
|
-
link_to(title, url, :
|
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,19 +1,17 @@
|
|
1
|
-
activate :blog do |
|
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
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
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 |
|
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
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
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
|