middleman-blog 0.1.5 → 3.0.0.beta.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. data/.gemtest +0 -0
  2. data/.gitignore +5 -0
  3. data/.travis.yml +9 -0
  4. data/.yardopts +3 -0
  5. data/Gemfile +19 -0
  6. data/LICENSE +20 -0
  7. data/README.md +62 -0
  8. data/Rakefile +15 -0
  9. data/features/article_cli.feature +7 -0
  10. data/features/blog_sources.feature +9 -0
  11. data/features/calendar.feature +30 -0
  12. data/features/directory_indexes.feature +6 -0
  13. data/features/encoding.feature +0 -0
  14. data/features/filename_date.feature +9 -0
  15. data/features/next_previous.feature +8 -0
  16. data/features/preview.feature +29 -0
  17. data/features/support/env.rb +4 -0
  18. data/features/tags.feature +50 -0
  19. data/fixtures/blog-sources-app/config.rb +3 -0
  20. data/fixtures/blog-sources-app/source/_article_template.erb +1 -0
  21. data/fixtures/blog-sources-app/source/blog/2011-01-01-new-article.html.markdown +6 -0
  22. data/fixtures/blog-sources-app/source/index.html.erb +9 -0
  23. data/fixtures/blog-sources-app/source/layout.erb +13 -0
  24. data/fixtures/calendar-app/config.rb +5 -0
  25. data/fixtures/calendar-app/source/blog/2011-01-01-new-article.html.markdown +7 -0
  26. data/fixtures/calendar-app/source/blog/2011-01-02-another-article.html.markdown +8 -0
  27. data/fixtures/calendar-app/source/calendar.html.erb +13 -0
  28. data/fixtures/calendar-app/source/index.html.erb +3 -0
  29. data/fixtures/calendar-app/source/layout.erb +15 -0
  30. data/fixtures/filename-date-app/config.rb +1 -0
  31. data/fixtures/filename-date-app/source/2011-01-01-new-article.html.markdown +5 -0
  32. data/fixtures/filename-date-app/source/2011-01-03-filename-and-frontmatter.html.markdown +6 -0
  33. data/fixtures/filename-date-app/source/layout.erb +14 -0
  34. data/fixtures/indexes-app/config.rb +5 -0
  35. data/fixtures/indexes-app/source/2011/01/01/new-article.html.markdown +6 -0
  36. data/fixtures/indexes-app/source/_article_template.erb +1 -0
  37. data/fixtures/indexes-app/source/index.html.erb +9 -0
  38. data/fixtures/indexes-app/source/layout.erb +13 -0
  39. data/fixtures/preview-app/config.rb +3 -0
  40. data/fixtures/preview-app/source/2011/01/01/new-article.html.markdown +6 -0
  41. data/fixtures/preview-app/source/_article_template.erb +10 -0
  42. data/fixtures/preview-app/source/index.html.erb +9 -0
  43. data/fixtures/preview-app/source/layout.erb +22 -0
  44. data/fixtures/tags-app/config.rb +6 -0
  45. data/fixtures/tags-app/source/blog/2011-01-01-new-article.html.markdown +7 -0
  46. data/fixtures/tags-app/source/blog/2011-01-02-another-article.html.markdown +8 -0
  47. data/fixtures/tags-app/source/index.html.erb +3 -0
  48. data/fixtures/tags-app/source/layout.erb +13 -0
  49. data/fixtures/tags-app/source/tag.html.erb +7 -0
  50. data/fixtures/utf8ouch/config.rb +17 -0
  51. data/fixtures/utf8ouch/source/2010/11/13/telling-time.html.markdown +73 -0
  52. data/fixtures/utf8ouch/source/2011/01/01/new-article.html.markdown +6 -0
  53. data/{lib/middleman-blog/template → fixtures/utf8ouch}/source/_article_template.erb +0 -0
  54. data/{lib/middleman-blog/template → fixtures/utf8ouch}/source/archives/index.html.erb +0 -0
  55. data/fixtures/utf8ouch/source/feed.xml.builder +23 -0
  56. data/fixtures/utf8ouch/source/index.html.erb +9 -0
  57. data/fixtures/utf8ouch/source/layout.erb +30 -0
  58. data/lib/middleman-blog.rb +10 -2
  59. data/lib/middleman-blog/blog_article.rb +123 -0
  60. data/lib/middleman-blog/blog_data.rb +94 -0
  61. data/lib/middleman-blog/calendar_pages.rb +85 -0
  62. data/lib/middleman-blog/commands/article.rb +52 -0
  63. data/lib/middleman-blog/commands/article.tt +6 -0
  64. data/lib/middleman-blog/extension.rb +170 -0
  65. data/lib/middleman-blog/tag_pages.rb +33 -0
  66. data/lib/middleman-blog/template.rb +19 -8
  67. data/lib/middleman-blog/template/config.tt +101 -5
  68. data/lib/middleman-blog/template/shared/Gemfile.tt +4 -0
  69. data/lib/middleman-blog/template/source/2012-01-01-example-article.html.markdown +7 -0
  70. data/lib/middleman-blog/template/source/calendar.html.erb +15 -0
  71. data/lib/middleman-blog/template/source/feed.xml.builder +2 -2
  72. data/lib/middleman-blog/template/source/index.html.erb +8 -9
  73. data/lib/middleman-blog/template/source/layout.erb +18 -12
  74. data/lib/middleman-blog/template/source/tag.html.erb +7 -0
  75. data/lib/middleman-blog/version.rb +1 -1
  76. data/lib/{middleman_init.rb → middleman_extension.rb} +0 -0
  77. data/middleman-blog.gemspec +1 -2
  78. metadata +110 -63
  79. data/lib/middleman-blog/feature.rb +0 -162
  80. data/lib/middleman-blog/template/config.ru +0 -9
  81. data/lib/middleman-blog/template/source/2011/01/01/new-article.html.markdown +0 -6
@@ -1,10 +1,95 @@
1
- activate :blog
2
- # set :blog_permalink, ":year/:month/:day/:title.html"
3
- # set :blog_summary_separator, /READMORE/
4
- # set :blog_summary_length, 500
1
+ ###
2
+ # Blog settings
3
+ ###
4
+
5
+ activate :blog do |blog|
6
+ # blog.permalink = ":year/:month/:day/:title.html"
7
+ # blog.sources = ":year-:month-:day-:title.html"
8
+ # blog.taglink = "tags/:tag.html"
9
+ # blog.layout = "layout"
10
+ # blog.summary_separator = /(READMORE)/
11
+ # blog.summary_length = 250
12
+ # blog.year_link = ":year.html"
13
+ # blog.month_link = ":year/:month.html"
14
+ # blog.day_link = ":year/:month/:day.html"
15
+ # blog.default_extension = ".markdown"
16
+
17
+ blog.tag_template = "tag.html"
18
+ blog.calendar_template = "calendar.html"
19
+ end
5
20
 
6
21
  page "/feed.xml", :layout => false
7
22
 
23
+ ###
24
+ # Compass
25
+ ###
26
+
27
+ # Susy grids in Compass
28
+ # First: gem install compass-susy-plugin
29
+ # require 'susy'
30
+
31
+ # Change Compass configuration
32
+ # compass_config do |config|
33
+ # config.output_style = :compact
34
+ # end
35
+
36
+ ###
37
+ # Page options, layouts, aliases and proxies
38
+ ###
39
+
40
+ # Per-page layout changes:
41
+ #
42
+ # With no layout
43
+ # page "/path/to/file.html", :layout => false
44
+ #
45
+ # With alternative layout
46
+ # page "/path/to/file.html", :layout => :otherlayout
47
+ #
48
+ # A path which all have the same layout
49
+ # with_layout :admin do
50
+ # page "/admin/*"
51
+ # end
52
+
53
+ # Proxy (fake) files
54
+ # page "/this-page-has-no-template.html", :proxy => "/template-file.html" do
55
+ # @which_fake_page = "Rendering a fake page with a variable"
56
+ # end
57
+
58
+ ###
59
+ # Helpers
60
+ ###
61
+
62
+ # Automatic image dimensions on image_tag helper
63
+ # activate :automatic_image_sizes
64
+
65
+ # Methods defined in the helpers block are available in templates
66
+ # helpers do
67
+ # def some_helper
68
+ # "Helping"
69
+ # end
70
+ # end
71
+
72
+ <% if options[:css_dir] -%>
73
+ set :css_dir, '<%= options[:css_dir] -%>'
74
+ <% else -%>
75
+ # Change the CSS directory
76
+ # set :css_dir, "alternative_css_directory"
77
+ <% end -%>
78
+
79
+ <% if options[:js_dir] -%>
80
+ set :js_dir, '<%= options[:js_dir] -%>'
81
+ <% else -%>
82
+ # Change the JS directory
83
+ # set :js_dir, "alternative_js_directory"
84
+ <% end -%>
85
+
86
+ <% if options[:images_dir] -%>
87
+ set :images_dir, '<%= options[:images_dir] -%>'
88
+ <% else -%>
89
+ # Change the images directory
90
+ # set :images_dir, "alternative_image_directory"
91
+ <% end -%>
92
+
8
93
  # Build-specific configuration
9
94
  configure :build do
10
95
  # For example, change the Compass output style for deployment
@@ -15,4 +100,15 @@ configure :build do
15
100
 
16
101
  # Enable cache buster
17
102
  # activate :cache_buster
18
- end
103
+
104
+ # Use relative URLs
105
+ # activate :relative_assets
106
+
107
+ # Compress PNGs after build
108
+ # First: gem install middleman-smusher
109
+ # require "middleman-smusher"
110
+ # activate :smusher
111
+
112
+ # Or use a different image path
113
+ # set :http_path, "/Content/images/"
114
+ end
@@ -0,0 +1,4 @@
1
+ source :rubygems
2
+
3
+ gem "middleman", "~> <%= Middleman::VERSION %>"
4
+ gem "middleman-blog", "~> <%= Middleman::Blog::VERSION %>"
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: Example Article
3
+ date: 2012-01-01
4
+ tags: example
5
+ ---
6
+
7
+ This is an example article. You probably want to delete it and write your own articles!
@@ -0,0 +1,15 @@
1
+ <h1>Archive for
2
+ <% if @day %>
3
+ <%= Date.new(@year, @month, @day).strftime('%b %e %Y') %>
4
+ <% elsif @month %>
5
+ <%= Date.new(@year, @month, 1).strftime('%b %Y') %>
6
+ <% else %>
7
+ <%= @year %>
8
+ <% end %>
9
+ </h1>
10
+
11
+ <ul>
12
+ <% @articles.each_with_index do |article, i| %>
13
+ <li><a href="<%= article.url %>"><%= article.title %></a> <span><%= article.date.strftime('%b %e') %></span></li>
14
+ <% end %>
15
+ </ul>
@@ -5,10 +5,10 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
5
5
  xml.id "http://blog.url.com/"
6
6
  xml.link "href" => "http://blog.url.com/"
7
7
  xml.link "href" => "http://blog.url.com/feed.xml", "rel" => "self"
8
- xml.updated data.blog.articles.first.date.to_time.iso8601
8
+ xml.updated blog.articles.first.date.to_time.iso8601
9
9
  xml.author { xml.name "Blog Author" }
10
10
 
11
- data.blog.articles.each do |article|
11
+ blog.articles[0..5].each do |article|
12
12
  xml.entry do
13
13
  xml.title article.title
14
14
  xml.link "rel" => "alternate", "href" => article.url
@@ -1,9 +1,8 @@
1
- <% data.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
+ <ul>
2
+ <% blog.articles[0...10].each do |article| %>
3
+ <li>
4
+ <h2><a href="<%= article.url %>"><%= article.title %></a> <span><%= article.date.strftime('%b %e') %></span></h2>
5
+ <p><%= article.summary %></p>
6
+ </li>
7
+ <% end %>
8
+ </ul>
@@ -7,24 +7,30 @@
7
7
  <body>
8
8
 
9
9
  <div id="main" role="main">
10
- <% if is_blog_article? %>
11
- <% content_for :blog_article, yield %>
12
- <%= partial settings.blog_article_template %>
13
- <% else %>
14
- <%= yield %>
15
- <% end %>
10
+ <%= yield %>
16
11
  </div>
17
12
 
18
13
  <aside>
19
- <h2>
20
- Recent Articles
21
- <a href="/archives">Archive</a>
22
- </h2>
14
+ <h2>Recent Articles</h2>
23
15
  <ol>
24
- <% data.blog.articles[0...10].each do |article| %>
16
+ <% blog.articles[0...10].each do |article| %>
25
17
  <li><a href="<%= article.url %>"><%= article.title %></a> <span><%= article.date.strftime('%b %e') %></span></li>
26
18
  <% end %>
27
- </li>
19
+ </ol>
20
+
21
+ <h2>Tags</h2>
22
+ <ol>
23
+ <% blog.tags.each do |tag, articles| %>
24
+ <li><a href="<%= tag_path tag %>"><%= tag %> (<%= articles.size %>)</a></li>
25
+ <% end %>
26
+ </ol>
27
+
28
+ <h2>By Year</h2>
29
+ <ol>
30
+ <% blog.articles.group_by {|a| a.date.year }.each do |year, articles| %>
31
+ <li><a href="<%= blog_year_path year %>"><%= year %> (<%= articles.size %>)</a></li>
32
+ <% end %>
33
+ </ol>
28
34
  </aside>
29
35
  </body>
30
36
  </html>
@@ -0,0 +1,7 @@
1
+ <h1>Articles tagged '<%= @tag %>'</h1>
2
+
3
+ <% if @articles %>
4
+ <% @articles[0...12].each do |article| %>
5
+ <li><a href="<%= article.url %>"><%= article.title %></a> <time><%= article.date.strftime('%b %e') %></time></li>
6
+ <% end %>
7
+ <% end %>
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module Blog
3
- VERSION = "0.1.5"
3
+ VERSION = "3.0.0.beta.3"
4
4
  end
5
5
  end
@@ -19,6 +19,5 @@ Gem::Specification.new do |s|
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
21
 
22
- s.add_development_dependency("rake")
23
- # s.add_runtime_dependency("middleman", ["~> 2.0.13"])
22
+ s.add_runtime_dependency("middleman-core", [">= 3.0.0.beta.3"])
24
23
  end
metadata CHANGED
@@ -1,99 +1,146 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: middleman-blog
3
- version: !ruby/object:Gem::Version
4
- hash: 17
5
- prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 5
10
- version: 0.1.5
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.0.0.beta.3
5
+ prerelease: 6
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Thomas Reynolds
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-12-10 00:00:00 -08:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- prerelease: false
23
- type: :development
24
- requirement: &id001 !ruby/object:Gem::Requirement
12
+ date: 2012-05-21 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: middleman-core
16
+ requirement: &70247567085260 !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
33
- name: rake
34
- version_requirements: *id001
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 3.0.0.beta.3
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70247567085260
35
25
  description: A blog foundation using Middleman
36
- email:
26
+ email:
37
27
  - me@tdreyno.com
38
28
  executables: []
39
-
40
29
  extensions: []
41
-
42
30
  extra_rdoc_files: []
43
-
44
- files:
31
+ files:
32
+ - .gemtest
45
33
  - .gitignore
34
+ - .travis.yml
35
+ - .yardopts
46
36
  - Gemfile
37
+ - LICENSE
38
+ - README.md
47
39
  - Rakefile
48
- - lib/.DS_Store
40
+ - features/article_cli.feature
41
+ - features/blog_sources.feature
42
+ - features/calendar.feature
43
+ - features/directory_indexes.feature
44
+ - features/encoding.feature
45
+ - features/filename_date.feature
46
+ - features/next_previous.feature
47
+ - features/preview.feature
48
+ - features/support/env.rb
49
+ - features/tags.feature
50
+ - fixtures/blog-sources-app/config.rb
51
+ - fixtures/blog-sources-app/source/_article_template.erb
52
+ - fixtures/blog-sources-app/source/blog/2011-01-01-new-article.html.markdown
53
+ - fixtures/blog-sources-app/source/index.html.erb
54
+ - fixtures/blog-sources-app/source/layout.erb
55
+ - fixtures/calendar-app/config.rb
56
+ - fixtures/calendar-app/source/blog/2011-01-01-new-article.html.markdown
57
+ - fixtures/calendar-app/source/blog/2011-01-02-another-article.html.markdown
58
+ - fixtures/calendar-app/source/calendar.html.erb
59
+ - fixtures/calendar-app/source/index.html.erb
60
+ - fixtures/calendar-app/source/layout.erb
61
+ - fixtures/filename-date-app/config.rb
62
+ - fixtures/filename-date-app/source/2011-01-01-new-article.html.markdown
63
+ - fixtures/filename-date-app/source/2011-01-03-filename-and-frontmatter.html.markdown
64
+ - fixtures/filename-date-app/source/layout.erb
65
+ - fixtures/indexes-app/config.rb
66
+ - fixtures/indexes-app/source/2011/01/01/new-article.html.markdown
67
+ - fixtures/indexes-app/source/_article_template.erb
68
+ - fixtures/indexes-app/source/index.html.erb
69
+ - fixtures/indexes-app/source/layout.erb
70
+ - fixtures/preview-app/config.rb
71
+ - fixtures/preview-app/source/2011/01/01/new-article.html.markdown
72
+ - fixtures/preview-app/source/_article_template.erb
73
+ - fixtures/preview-app/source/index.html.erb
74
+ - fixtures/preview-app/source/layout.erb
75
+ - fixtures/tags-app/config.rb
76
+ - fixtures/tags-app/source/blog/2011-01-01-new-article.html.markdown
77
+ - fixtures/tags-app/source/blog/2011-01-02-another-article.html.markdown
78
+ - fixtures/tags-app/source/index.html.erb
79
+ - fixtures/tags-app/source/layout.erb
80
+ - fixtures/tags-app/source/tag.html.erb
81
+ - fixtures/utf8ouch/config.rb
82
+ - fixtures/utf8ouch/source/2010/11/13/telling-time.html.markdown
83
+ - fixtures/utf8ouch/source/2011/01/01/new-article.html.markdown
84
+ - fixtures/utf8ouch/source/_article_template.erb
85
+ - fixtures/utf8ouch/source/archives/index.html.erb
86
+ - fixtures/utf8ouch/source/feed.xml.builder
87
+ - fixtures/utf8ouch/source/index.html.erb
88
+ - fixtures/utf8ouch/source/layout.erb
49
89
  - lib/middleman-blog.rb
50
- - lib/middleman-blog/.DS_Store
51
- - lib/middleman-blog/feature.rb
90
+ - lib/middleman-blog/blog_article.rb
91
+ - lib/middleman-blog/blog_data.rb
92
+ - lib/middleman-blog/calendar_pages.rb
93
+ - lib/middleman-blog/commands/article.rb
94
+ - lib/middleman-blog/commands/article.tt
95
+ - lib/middleman-blog/extension.rb
96
+ - lib/middleman-blog/tag_pages.rb
52
97
  - lib/middleman-blog/template.rb
53
- - lib/middleman-blog/template/config.ru
54
98
  - lib/middleman-blog/template/config.tt
55
- - lib/middleman-blog/template/source/2011/01/01/new-article.html.markdown
56
- - lib/middleman-blog/template/source/_article_template.erb
57
- - lib/middleman-blog/template/source/archives/index.html.erb
99
+ - lib/middleman-blog/template/shared/Gemfile.tt
100
+ - lib/middleman-blog/template/source/2012-01-01-example-article.html.markdown
101
+ - lib/middleman-blog/template/source/calendar.html.erb
58
102
  - lib/middleman-blog/template/source/feed.xml.builder
59
103
  - lib/middleman-blog/template/source/index.html.erb
60
104
  - lib/middleman-blog/template/source/layout.erb
105
+ - lib/middleman-blog/template/source/tag.html.erb
61
106
  - lib/middleman-blog/version.rb
62
- - lib/middleman_init.rb
107
+ - lib/middleman_extension.rb
63
108
  - middleman-blog.gemspec
64
- has_rdoc: true
65
109
  homepage: https://github.com/tdreyno/middleman-blog
66
110
  licenses: []
67
-
68
111
  post_install_message:
69
112
  rdoc_options: []
70
-
71
- require_paths:
113
+ require_paths:
72
114
  - lib
73
- required_ruby_version: !ruby/object:Gem::Requirement
115
+ required_ruby_version: !ruby/object:Gem::Requirement
74
116
  none: false
75
- requirements:
76
- - - ">="
77
- - !ruby/object:Gem::Version
78
- hash: 3
79
- segments:
117
+ requirements:
118
+ - - ! '>='
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
121
+ segments:
80
122
  - 0
81
- version: "0"
82
- required_rubygems_version: !ruby/object:Gem::Requirement
123
+ hash: 3403075103366763799
124
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
125
  none: false
84
- requirements:
85
- - - ">="
86
- - !ruby/object:Gem::Version
87
- hash: 3
88
- segments:
89
- - 0
90
- version: "0"
126
+ requirements:
127
+ - - ! '>'
128
+ - !ruby/object:Gem::Version
129
+ version: 1.3.1
91
130
  requirements: []
92
-
93
131
  rubyforge_project: middleman-blog
94
- rubygems_version: 1.6.2
132
+ rubygems_version: 1.8.10
95
133
  signing_key:
96
134
  specification_version: 3
97
135
  summary: A blog foundation using Middleman
98
- test_files: []
99
-
136
+ test_files:
137
+ - features/article_cli.feature
138
+ - features/blog_sources.feature
139
+ - features/calendar.feature
140
+ - features/directory_indexes.feature
141
+ - features/encoding.feature
142
+ - features/filename_date.feature
143
+ - features/next_previous.feature
144
+ - features/preview.feature
145
+ - features/support/env.rb
146
+ - features/tags.feature