middleman-blog 3.2.0 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -1
- data/.travis.yml +5 -7
- data/CHANGELOG.md +21 -0
- data/CONTRIBUTING.md +43 -0
- data/Gemfile +22 -14
- data/Gemfile-3.0 +27 -0
- data/{LICENSE → LICENSE.md} +2 -2
- data/README.md +33 -28
- data/Rakefile +17 -1
- data/features/blog_sources.feature +13 -0
- data/features/calendar_multiblog.feature +153 -0
- data/features/multiblog.feature +51 -0
- data/features/paginate_multiblog.feature +270 -0
- data/features/summary.feature +43 -0
- data/features/support/env.rb +6 -1
- data/features/tags_multiblog.feature +125 -0
- data/features/time_zone.feature +5 -0
- data/fixtures/blog-sources-app/source/blog/2013-08-08-slug-from-filename.html.markdown +7 -0
- data/fixtures/calendar-multiblog-app/config.rb +17 -0
- data/fixtures/calendar-multiblog-app/source/blog1/2011-01-01-new-article.html.markdown +7 -0
- data/fixtures/calendar-multiblog-app/source/blog1/2011-01-02-another-article.html.markdown +8 -0
- data/fixtures/calendar-multiblog-app/source/blog2/2011-01-01-new-article.html.markdown +7 -0
- data/fixtures/calendar-multiblog-app/source/blog2/2011-01-02-another-article.html.markdown +8 -0
- data/fixtures/calendar-multiblog-app/source/calendar1.html.erb +13 -0
- data/fixtures/calendar-multiblog-app/source/calendar2.html.erb +13 -0
- data/fixtures/calendar-multiblog-app/source/index.html.erb +15 -0
- data/fixtures/calendar-multiblog-app/source/layout.erb +15 -0
- data/fixtures/default-template-app/Gemfile +6 -0
- data/fixtures/default-template-app/config.rb +35 -0
- data/fixtures/default-template-app/source/2013-04-01-new-article.html.markdown +25 -0
- data/{features/encoding.feature → fixtures/default-template-app/source/about-me.html.erb} +0 -0
- data/fixtures/default-template-app/source/archives.html.erb +10 -0
- data/fixtures/default-template-app/source/index.html.erb +11 -0
- data/fixtures/default-template-app/source/javascripts/_zepto.pjax.js +744 -0
- data/fixtures/default-template-app/source/javascripts/app.js +11 -0
- data/fixtures/default-template-app/source/javascripts/modernizr.js +1 -0
- data/fixtures/default-template-app/source/layouts/layout.erb +62 -0
- data/fixtures/default-template-app/source/stylesheets/app.css.scss +109 -0
- data/fixtures/multiblog-app/config.rb +0 -0
- data/fixtures/multiblog-app/source/blog1/2012-12-12-other-article.html.markdown +5 -0
- data/fixtures/multiblog-app/source/blog2/2011/01/01/new-article.html.markdown +6 -0
- data/fixtures/multiblog-app/source/index.html.erb +7 -0
- data/fixtures/multiblog-app/source/layout.erb +30 -0
- data/fixtures/no-title-app/config.rb +3 -0
- data/fixtures/no-title-app/source/2013-08-07.html.markdown +6 -0
- data/fixtures/no-title-app/source/2013-08-08.html.markdown +7 -0
- data/fixtures/no-title-app/source/layout.erb +13 -0
- data/fixtures/paginate-multiblog-app/config.rb +31 -0
- data/fixtures/paginate-multiblog-app/source/blog1/2011-01-01-test-article.html.markdown +6 -0
- data/fixtures/paginate-multiblog-app/source/blog1/2011-01-02-test-article.html.markdown +6 -0
- data/fixtures/paginate-multiblog-app/source/blog1/2011-01-03-test-article.html.markdown +6 -0
- data/fixtures/paginate-multiblog-app/source/blog1/2011-01-04-test-article.html.markdown +6 -0
- data/fixtures/paginate-multiblog-app/source/blog1/2011-01-05-test-article.html.markdown +6 -0
- data/fixtures/paginate-multiblog-app/source/blog1/2011-02-01-test-article.html.markdown +6 -0
- data/fixtures/paginate-multiblog-app/source/blog1/index.html.erb +27 -0
- data/fixtures/paginate-multiblog-app/source/blog2/2011-01-01-test-article.html.markdown +6 -0
- data/fixtures/paginate-multiblog-app/source/blog2/2011-01-02-test-article.html.markdown +6 -0
- data/fixtures/paginate-multiblog-app/source/blog2/2011-01-03-test-article.html.markdown +6 -0
- data/fixtures/paginate-multiblog-app/source/blog2/2011-01-04-test-article.html.markdown +6 -0
- data/fixtures/paginate-multiblog-app/source/blog2/2011-01-05-test-article.html.markdown +6 -0
- data/fixtures/paginate-multiblog-app/source/blog2/index.html.erb +27 -0
- data/fixtures/paginate-multiblog-app/source/blog3/2011-01-01-test-article.html.markdown +6 -0
- data/fixtures/paginate-multiblog-app/source/blog3/2011-01-02-test-article.html.markdown +6 -0
- data/fixtures/paginate-multiblog-app/source/blog3/2011-01-03-test-article.html.markdown +6 -0
- data/fixtures/paginate-multiblog-app/source/blog3/2011-01-04-test-article.html.markdown +6 -0
- data/fixtures/paginate-multiblog-app/source/blog3/2011-01-05-test-article.html.markdown +6 -0
- data/fixtures/paginate-multiblog-app/source/blog3/2011-02-01-test-article.html.markdown +6 -0
- data/fixtures/paginate-multiblog-app/source/blog3/2011-02-02-test-article.html.markdown +6 -0
- data/fixtures/paginate-multiblog-app/source/blog3/index.html.erb +28 -0
- data/fixtures/paginate-multiblog-app/source/calendar1.html.erb +28 -0
- data/fixtures/paginate-multiblog-app/source/calendar2.html.erb +28 -0
- data/fixtures/paginate-multiblog-app/source/calendar3.html.erb +28 -0
- data/fixtures/paginate-multiblog-app/source/layout.erb +15 -0
- data/fixtures/paginate-multiblog-app/source/tag1.html.erb +23 -0
- data/fixtures/paginate-multiblog-app/source/tag2.html.erb +23 -0
- data/fixtures/paginate-multiblog-app/source/tag3.html.erb +19 -0
- data/fixtures/summary-app/config.rb +1 -0
- data/fixtures/summary-app/source/2011-01-01-article-with-no-summary-separator-and-comments-in-the-summary.html.erb +10 -0
- data/fixtures/summary-app/source/2011-01-01-article-with-standard-summary-separator.html.markdown +7 -0
- data/fixtures/summary-app/source/2012-06-19-article-with-no-summary-separator.html.markdown +9 -0
- data/fixtures/summary-app/source/2013-05-08-article-with-custom-separator.html.markdown +7 -0
- data/fixtures/summary-app/source/index.html.erb +5 -0
- data/fixtures/tags-multiblog-app/config.rb +15 -0
- data/fixtures/tags-multiblog-app/source/blog1/2011-01-01-new-article.html.markdown +7 -0
- data/fixtures/tags-multiblog-app/source/blog1/2011-01-02-another-article.html.markdown +9 -0
- data/fixtures/tags-multiblog-app/source/blog2/2011-01-01-new-article.html.markdown +7 -0
- data/fixtures/tags-multiblog-app/source/blog2/2011-01-02-another-article.html.markdown +9 -0
- data/fixtures/tags-multiblog-app/source/index.html.erb +8 -0
- data/fixtures/tags-multiblog-app/source/layout.erb +13 -0
- data/fixtures/tags-multiblog-app/source/tag1.html.erb +7 -0
- data/fixtures/tags-multiblog-app/source/tag2.html.erb +7 -0
- data/fixtures/time-zone-app/config.rb +5 -0
- data/fixtures/time-zone-app/source/blog/2013-06-24-hello.html.erb +5 -0
- data/lib/middleman-blog.rb +9 -4
- data/lib/middleman-blog/blog_article.rb +47 -21
- data/lib/middleman-blog/blog_data.rb +11 -4
- data/lib/middleman-blog/calendar_pages.rb +40 -25
- data/lib/middleman-blog/{extension.rb → extension_3_0.rb} +20 -16
- data/lib/middleman-blog/extension_3_1.rb +208 -0
- data/lib/middleman-blog/paginator.rb +33 -7
- data/lib/middleman-blog/tag_pages.rb +26 -9
- data/lib/middleman-blog/template/shared/Gemfile.tt +4 -2
- data/lib/middleman-blog/template/source/calendar.html.erb +1 -1
- data/lib/middleman-blog/template/source/feed.xml.builder +8 -7
- data/lib/middleman-blog/template/source/index.html.erb +1 -1
- data/lib/middleman-blog/template/source/tag.html.erb +1 -1
- data/lib/middleman-blog/truncate_html.rb +10 -1
- data/lib/middleman-blog/version.rb +1 -1
- data/middleman-blog.gemspec +12 -15
- metadata +180 -14
@@ -0,0 +1,11 @@
|
|
1
|
+
/*
|
2
|
+
=require vendor/zepto
|
3
|
+
=require foundation/foundation
|
4
|
+
=require foundation/foundation.section
|
5
|
+
=require foundation/foundation.tooltips
|
6
|
+
=require foundation/foundation.topbar
|
7
|
+
=require _zepto.pjax
|
8
|
+
*/
|
9
|
+
|
10
|
+
$(document).foundation();
|
11
|
+
$(document).pjax('a', '#container', { fragment: '#container' });
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require "vendor/custom.modernizr"
|
@@ -0,0 +1,62 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
|
3
|
+
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
|
4
|
+
<head>
|
5
|
+
<meta charset="utf-8">
|
6
|
+
<meta name="viewport" content="width=device-width">
|
7
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
8
|
+
<title><%= page_title %></title>
|
9
|
+
<%= javascript_include_tag :modernizr %>
|
10
|
+
<%= stylesheet_link_tag :app %>
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
<div class="contain-to-grid">
|
14
|
+
<nav class="top-bar">
|
15
|
+
<ul class="title-area">
|
16
|
+
<li class="name">
|
17
|
+
<h1><%= link_to_with_active top_nav_title[:title], top_nav_title[:target] %></h1>
|
18
|
+
</li>
|
19
|
+
<li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>
|
20
|
+
</ul>
|
21
|
+
|
22
|
+
<section class="top-bar-section">
|
23
|
+
<ul class="left">
|
24
|
+
<% top_nav_items.each do |item| %>
|
25
|
+
<li><%= link_to_with_active item[:title], item[:target] %></li>
|
26
|
+
<% end %>
|
27
|
+
</ul>
|
28
|
+
</section>
|
29
|
+
</nav>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<header>
|
33
|
+
<div class="row">
|
34
|
+
<div class="large-12 columns">
|
35
|
+
<div class="bar large-2 columns large-centered hide-for-small"></div>
|
36
|
+
<h1><%= blog_name %> <small>by <%= blog_author %></small></h1>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
</header>
|
40
|
+
|
41
|
+
<div id="container">
|
42
|
+
<% if is_blog_article? %>
|
43
|
+
<article class="row">
|
44
|
+
<div class="large-12 columns">
|
45
|
+
<time class="updated"><%= current_article.date.strftime('%b %e %Y') %></time>
|
46
|
+
<h1 class="entry-title">
|
47
|
+
<%= current_article.title %>
|
48
|
+
</h1>
|
49
|
+
|
50
|
+
<div class="entry-content">
|
51
|
+
<%= yield %>
|
52
|
+
</div>
|
53
|
+
</div>
|
54
|
+
</article>
|
55
|
+
<% else %>
|
56
|
+
<%= yield %>
|
57
|
+
<% end %>
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<%= javascript_include_tag :app %>
|
61
|
+
</body>
|
62
|
+
</html>
|
@@ -0,0 +1,109 @@
|
|
1
|
+
@import "normalize";
|
2
|
+
@import url(http://fonts.googleapis.com/css?family=Lato:400,700,900,400italic,700italic);
|
3
|
+
|
4
|
+
// Make sure the charset is set appropriately
|
5
|
+
@charset "UTF-8";
|
6
|
+
|
7
|
+
// This includes all of the foundation global elements that are needed to work with any of the other files.
|
8
|
+
@import "foundation/variables";
|
9
|
+
|
10
|
+
$topbar-bg: #262626;
|
11
|
+
$topbar-height: 35px;
|
12
|
+
$topbar-margin-bottom: 0;
|
13
|
+
$topbar-breakpoint: emCalc(767px);
|
14
|
+
|
15
|
+
$topbar-title-font-size: emCalc(12px);
|
16
|
+
$topbar-link-color: #999999;
|
17
|
+
$topbar-link-font-size: emCalc(12px);
|
18
|
+
|
19
|
+
$body-font-color: #444;
|
20
|
+
$body-font-family: "Lato", sans-serif;
|
21
|
+
|
22
|
+
$row-width: emCalc(768px);
|
23
|
+
|
24
|
+
// Foundation Components
|
25
|
+
@import
|
26
|
+
"foundation/components/global",
|
27
|
+
"foundation/components/grid",
|
28
|
+
"foundation/components/visibility",
|
29
|
+
"foundation/components/block-grid",
|
30
|
+
"foundation/components/type",
|
31
|
+
"foundation/components/buttons",
|
32
|
+
"foundation/components/forms",
|
33
|
+
"foundation/components/custom-forms",
|
34
|
+
"foundation/components/button-groups",
|
35
|
+
"foundation/components/dropdown-buttons",
|
36
|
+
"foundation/components/split-buttons",
|
37
|
+
"foundation/components/flex-video",
|
38
|
+
"foundation/components/section",
|
39
|
+
"foundation/components/top-bar",
|
40
|
+
"foundation/components/orbit",
|
41
|
+
"foundation/components/reveal",
|
42
|
+
"foundation/components/joyride",
|
43
|
+
"foundation/components/clearing",
|
44
|
+
"foundation/components/alert-boxes",
|
45
|
+
"foundation/components/breadcrumbs",
|
46
|
+
"foundation/components/keystrokes",
|
47
|
+
"foundation/components/labels",
|
48
|
+
"foundation/components/inline-lists",
|
49
|
+
"foundation/components/pagination",
|
50
|
+
"foundation/components/panels",
|
51
|
+
"foundation/components/pricing-tables",
|
52
|
+
"foundation/components/progress-bars",
|
53
|
+
"foundation/components/side-nav",
|
54
|
+
"foundation/components/sub-nav",
|
55
|
+
"foundation/components/switch",
|
56
|
+
"foundation/components/magellan",
|
57
|
+
"foundation/components/tables",
|
58
|
+
"foundation/components/thumbs",
|
59
|
+
"foundation/components/tooltips",
|
60
|
+
"foundation/components/dropdown";
|
61
|
+
|
62
|
+
body {
|
63
|
+
}
|
64
|
+
|
65
|
+
nav {
|
66
|
+
-webkit-font-smoothing: antialiased;
|
67
|
+
}
|
68
|
+
|
69
|
+
header {
|
70
|
+
background: #333333;
|
71
|
+
|
72
|
+
.row {
|
73
|
+
padding: emCalc(15px) 0;
|
74
|
+
@media #{$small} {
|
75
|
+
padding: emCalc(55px) 0;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
.bar {
|
80
|
+
border-top: 2px solid white;
|
81
|
+
height: 0;
|
82
|
+
overflow: hidden;
|
83
|
+
margin-bottom: emCalc(10px);
|
84
|
+
}
|
85
|
+
|
86
|
+
h1 {
|
87
|
+
text-align: center;
|
88
|
+
font-size: emCalc(40px);
|
89
|
+
@media #{$small} {
|
90
|
+
font-size: emCalc(60px);
|
91
|
+
}
|
92
|
+
line-height: 1em;
|
93
|
+
font-weight: 900;
|
94
|
+
color: white;
|
95
|
+
text-transform: uppercase;
|
96
|
+
margin: 0 0 10px 0;
|
97
|
+
-webkit-font-smoothing: antialiased;
|
98
|
+
|
99
|
+
small {
|
100
|
+
display: block;
|
101
|
+
margin-top: 10px;
|
102
|
+
font-size: 14px;
|
103
|
+
font-weight: 700;
|
104
|
+
font-style: italic;
|
105
|
+
color: white;
|
106
|
+
text-transform: none;
|
107
|
+
}
|
108
|
+
}
|
109
|
+
}
|
File without changes
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<p>Default blog length: <%= blog.articles.length %></p>
|
2
|
+
|
3
|
+
<p>blog_number_1 length: <%= blog(:blog_number_1).articles.length %></p>
|
4
|
+
<p>blog_number_1 title: <%= blog(:blog_number_1).articles[0].data.title %></p>
|
5
|
+
|
6
|
+
<p>blog_number_2 length: <%= blog("blog_number_2").articles.length %></p>
|
7
|
+
<p>blog_number_2 title: <%= blog("blog_number_2").articles[0].data.title %></p>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8" />
|
5
|
+
<meta http-equiv='X-UA-Compatible' content='IE=edge;chrome=1' />
|
6
|
+
|
7
|
+
<% if is_blog_article? %>
|
8
|
+
<title><%= current_article.title %></title>
|
9
|
+
<% end %>
|
10
|
+
</head>
|
11
|
+
<body>
|
12
|
+
|
13
|
+
<div id="main" role="main">
|
14
|
+
<% if is_blog_article? %>
|
15
|
+
<article class="hentry">
|
16
|
+
<h1 class="entry-title">
|
17
|
+
<%= current_article.title %>
|
18
|
+
<time class="updated"><%= current_article.date.strftime('%b %e %Y') %></time>
|
19
|
+
</h1>
|
20
|
+
|
21
|
+
<div class="entry-content">
|
22
|
+
<%= yield %>
|
23
|
+
</div>
|
24
|
+
</article>
|
25
|
+
<% else %>
|
26
|
+
<%= yield %>
|
27
|
+
<% end %>
|
28
|
+
</div>
|
29
|
+
</body>
|
30
|
+
</html>
|
@@ -0,0 +1,31 @@
|
|
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"
|
6
|
+
blog.calendar_template = 'calendar1.html'
|
7
|
+
blog.tag_template = 'tag1.html'
|
8
|
+
blog.paginate = true
|
9
|
+
blog.per_page = 5
|
10
|
+
end
|
11
|
+
|
12
|
+
activate :blog do |blog2|
|
13
|
+
blog2.name = "blog_name_2"
|
14
|
+
blog2.prefix = "blog2"
|
15
|
+
blog2.sources = ":year-:month-:day-:title.html"
|
16
|
+
blog2.permalink = ":year-:month-:day-:title.html"
|
17
|
+
blog2.calendar_template = 'calendar2.html'
|
18
|
+
blog2.tag_template = 'tag2.html'
|
19
|
+
blog2.paginate = true
|
20
|
+
blog2.per_page = 3
|
21
|
+
end
|
22
|
+
|
23
|
+
activate :blog do |blog3|
|
24
|
+
blog3.name = "blog_name_3"
|
25
|
+
blog3.prefix = "blog3"
|
26
|
+
blog3.sources = ":year-:month-:day-:title.html"
|
27
|
+
blog3.permalink = ":year-:month-:day-:title.html"
|
28
|
+
blog3.calendar_template = 'calendar3.html'
|
29
|
+
blog3.tag_template = 'tag3.html'
|
30
|
+
blog3.paginate = false
|
31
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
---
|
2
|
+
blog: blog_name_1
|
3
|
+
pageable: true
|
4
|
+
---
|
5
|
+
Index: blog1
|
6
|
+
|
7
|
+
Paginate1: <%= paginate %>
|
8
|
+
Article Count1: <%= page_articles.size %>
|
9
|
+
<% if paginate %>
|
10
|
+
Page Num1: <%= page_number %>
|
11
|
+
Num Pages1: <%= num_pages %>
|
12
|
+
Per Page1: <%= per_page %>
|
13
|
+
Page Start1: <%= page_start %>
|
14
|
+
Page End1: <%= page_end %>
|
15
|
+
Next Page1: '<%= next_page.url if next_page %>'
|
16
|
+
Prev Page1: '<%= prev_page.url if prev_page %>'
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<% page_articles.each_with_index do |article, i| %>
|
20
|
+
<article class="<%= (i == 0) ? 'first' : '' %>">
|
21
|
+
<h1><a href="<%= article.url %>"><%= article.title %></a> <span><%= article.date.strftime('%b %e %Y') %></span></h1>
|
22
|
+
|
23
|
+
<%= article.summary %>
|
24
|
+
|
25
|
+
<div class="more"><a href="<%= article.url %>">read on »</a></div>
|
26
|
+
</article>
|
27
|
+
<% end %>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
---
|
2
|
+
blog: blog_name_2
|
3
|
+
pageable: true
|
4
|
+
---
|
5
|
+
Index: blog2
|
6
|
+
|
7
|
+
Paginate2: <%= paginate %>
|
8
|
+
Article Count2: <%= page_articles.size %>
|
9
|
+
<% if paginate %>
|
10
|
+
Page Num2: <%= page_number %>
|
11
|
+
Num Pages2: <%= num_pages %>
|
12
|
+
Per Page2: <%= per_page %>
|
13
|
+
Page Start2: <%= page_start %>
|
14
|
+
Page End2: <%= page_end %>
|
15
|
+
Next Page2: '<%= next_page.url if next_page %>'
|
16
|
+
Prev Page2: '<%= prev_page.url if prev_page %>'
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<% page_articles.each_with_index do |article, i| %>
|
20
|
+
<article class="<%= (i == 0) ? 'first' : '' %>">
|
21
|
+
<h1><a href="<%= article.url %>"><%= article.title %></a> <span><%= article.date.strftime('%b %e %Y') %></span></h1>
|
22
|
+
|
23
|
+
<%= article.summary %>
|
24
|
+
|
25
|
+
<div class="more"><a href="<%= article.url %>">read on »</a></div>
|
26
|
+
</article>
|
27
|
+
<% end %>
|