howl 0.5.5 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -23,3 +23,4 @@ pkg
23
23
  ## PROJECT::SPECIFIC
24
24
  test/fixtures/generated
25
25
  sample_site/generated
26
+ test/integration_site/generated
@@ -16,6 +16,16 @@ Howl is a tiny static site generator.
16
16
  /site
17
17
  <generated files go here>
18
18
 
19
+ ### Changing the date format
20
+
21
+ In `config.yml` add a line similar to the following:
22
+
23
+ date_format: "%Y-%m-%d, at %I:%M %p"
24
+
25
+ The above format renders like this:
26
+
27
+ 2010-10-18, at 02:18 PM
28
+
19
29
  ## Note on Patches/Pull Requests
20
30
 
21
31
  * Fork the project.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.5
1
+ 0.6.0
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ $:.push(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+ require 'howl/generator'
4
+
5
+ directory = ARGV.shift
6
+ Howl::Generator.generate(directory)
@@ -5,13 +5,15 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{howl}
8
- s.version = "0.5.5"
8
+ s.version = "0.6.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Clinton R. Nixon"]
12
- s.date = %q{2010-10-17}
12
+ s.date = %q{2010-10-23}
13
+ s.default_executable = %q{howl}
13
14
  s.description = %q{Howl is a tiny static website/blog generator.}
14
15
  s.email = %q{crnixon@gmail.com}
16
+ s.executables = ["howl"]
15
17
  s.extra_rdoc_files = [
16
18
  "LICENSE",
17
19
  "README.markdown"
@@ -19,28 +21,33 @@ Gem::Specification.new do |s|
19
21
  s.files = [
20
22
  ".gitignore",
21
23
  "Gemfile",
22
- "Gemfile.lock",
23
24
  "LICENSE",
24
25
  "README.markdown",
25
26
  "Rakefile",
26
27
  "VERSION",
28
+ "bin/howl",
27
29
  "howl.gemspec",
28
30
  "lib/howl.rb",
29
31
  "lib/howl/converter.rb",
30
32
  "lib/howl/converters/markdown.rb",
31
33
  "lib/howl/converters/sass.rb",
32
34
  "lib/howl/core_ext.rb",
35
+ "lib/howl/generator.rb",
33
36
  "lib/howl/page.rb",
34
37
  "lib/howl/plugin.rb",
35
38
  "lib/howl/post.rb",
39
+ "lib/howl/sample_site/.gitignore",
40
+ "lib/howl/sample_site/Rakefile",
41
+ "lib/howl/sample_site/config.yml",
42
+ "lib/howl/sample_site/posts/first_post.md",
43
+ "lib/howl/sample_site/site/css/screen.scss",
44
+ "lib/howl/sample_site/site/index.html",
45
+ "lib/howl/sample_site/templates/default.html",
46
+ "lib/howl/sample_site/templates/post.html",
47
+ "lib/howl/sample_site/templates/site.html",
36
48
  "lib/howl/site.rb",
37
49
  "lib/howl/template.rb",
38
50
  "lib/howl/view.rb",
39
- "sample_site/Rakefile",
40
- "sample_site/posts/first_post.md",
41
- "sample_site/site/index.html",
42
- "sample_site/templates/default.html",
43
- "sample_site/templates/site.html",
44
51
  "test/fixtures/config.yml",
45
52
  "test/fixtures/posts/first_post.html",
46
53
  "test/fixtures/posts/markdown_post.md",
@@ -58,10 +65,6 @@ Gem::Specification.new do |s|
58
65
  "test/fixtures/templates/site.html",
59
66
  "test/howl_test.rb",
60
67
  "test/integration_site/config.yml",
61
- "test/integration_site/generated/images/logo.png",
62
- "test/integration_site/generated/index.html",
63
- "test/integration_site/generated/posts/2010/10/17/post.html",
64
- "test/integration_site/generated/stylesheets/screen.css",
65
68
  "test/integration_site/posts/post.md",
66
69
  "test/integration_site/site/images/logo.png",
67
70
  "test/integration_site/site/index.html",
@@ -0,0 +1,25 @@
1
+ require 'fileutils'
2
+
3
+ module Howl
4
+ module Generator
5
+ def self.generate(directory)
6
+ directory = File.expand_path(directory)
7
+
8
+ if file_in_the_way?(directory)
9
+ puts "#{directory} already exists and is not an empty directory."
10
+ exit
11
+ end
12
+
13
+ FileUtils.mkdir_p(directory)
14
+ FileUtils.cp_r(File.join(File.dirname(__FILE__), 'sample_site', '.'), directory)
15
+ end
16
+
17
+ private
18
+
19
+ def self.file_in_the_way?(directory)
20
+ File.exists?(directory) &&
21
+ (!(File.directory?(directory) &&
22
+ Dir[File.join(directory, '*')].empty?))
23
+ end
24
+ end
25
+ end
@@ -0,0 +1 @@
1
+ generated
@@ -0,0 +1,2 @@
1
+ site_name: My Very Own Site
2
+
@@ -0,0 +1,57 @@
1
+ body {
2
+ width: 500px;
3
+ margin: 0 auto;
4
+ font: 14px / 1.5 Georgia, sans-serif;
5
+ }
6
+
7
+ footer {
8
+ margin-top: 60px;
9
+ padding-top: 30px;
10
+ border-top: 1px dotted #999;
11
+ text-align: center;
12
+ }
13
+
14
+ h1, h2, h3 {
15
+ font-weight: normal;
16
+ }
17
+
18
+ a {
19
+ text-decoration: none;
20
+ background-color: #eff1f7;
21
+ color: black;
22
+ padding: 3px;
23
+ &:hover {
24
+ border-bottom: 1px solid black;
25
+ }
26
+ }
27
+
28
+ article.post {
29
+ position: relative;
30
+ margin-top: 60px;
31
+ span.sidebar {
32
+ position: absolute;
33
+ top: 5px;
34
+ left: -225px;
35
+ width: 200px;
36
+ text-align: right;
37
+ border-right: 1px dotted #999;
38
+ padding-right: 10px;
39
+ display: block;
40
+ }
41
+ }
42
+
43
+ .meta {
44
+ font-size: .8em;
45
+ color: #999;
46
+ font-style: italic;
47
+ }
48
+
49
+ a.image-link {
50
+ background: none;
51
+ padding: none;
52
+ border: none;
53
+ img {
54
+ border: 1px solid #999;
55
+ vertical-align: middle;
56
+ }
57
+ }
@@ -0,0 +1,12 @@
1
+ template: site
2
+
3
+ {{#posts}}
4
+ <article id="{{dom_id}}" class="post">
5
+ <h2><a href="{{link}}">{{title}}</a></h2>
6
+ <span class="meta sidebar">
7
+ {{#format_date}}{{date}}{{/format_date}}<br/>
8
+ </span>
9
+ {{& rendered_content}}
10
+ <p class="meta"><a href="{{link}}">Permalink</a></p>
11
+ </article>
12
+ {{/posts}}
@@ -0,0 +1,10 @@
1
+ template: site
2
+
3
+ <article class="post">
4
+ <h2>{{title}}</h2>
5
+ <span class="meta sidebar">
6
+ {{#format_date}}{{date}}{{/format_date}}<br/>
7
+ </span>
8
+ {{& content}}
9
+ <p class="meta"><a href="{{link}}">Permalink</a></p>
10
+ </article>
@@ -0,0 +1,24 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>{{site_title}} - {{title}}</title>
6
+ <link rel="stylesheet" href="/css/screen.css" type="text/css" />
7
+ <!--[if IE]>
8
+ <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
9
+ <![endif]-->
10
+ <style>
11
+ article, aside, dialog, figure, footer, header,
12
+ hgroup, menu, nav, section { display: block; }
13
+ </style>
14
+ </head>
15
+ <body>
16
+ <header><h1><a href="/">{{site_name}}</a></h1></header>
17
+ <section id="content">
18
+ {{& content}}
19
+ </section>
20
+ <footer>
21
+ <span class="meta">Powered by Howl; Theme inspired by <a href="http://www.tumblr.com/theme/325">langer</a></span>
22
+ </footer>
23
+ </body>
24
+ </html>
@@ -15,7 +15,7 @@ module Howl
15
15
  site.posts
16
16
  end
17
17
  end
18
-
18
+
19
19
  # filters
20
20
 
21
21
  def format_date
@@ -1,2 +1,3 @@
1
1
  site_name: dce.gitwrite.com
2
2
  site_url: "http://dce.gitwrite.com"
3
+ date_format: "%Y-%m-%d, at %I:%M %p"
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 5
8
- - 5
9
- version: 0.5.5
7
+ - 6
8
+ - 0
9
+ version: 0.6.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Clinton R. Nixon
@@ -14,8 +14,8 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-10-17 00:00:00 -04:00
18
- default_executable:
17
+ date: 2010-10-23 00:00:00 -04:00
18
+ default_executable: howl
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: riot
@@ -98,8 +98,8 @@ dependencies:
98
98
  version_requirements: *id006
99
99
  description: Howl is a tiny static website/blog generator.
100
100
  email: crnixon@gmail.com
101
- executables: []
102
-
101
+ executables:
102
+ - howl
103
103
  extensions: []
104
104
 
105
105
  extra_rdoc_files:
@@ -108,28 +108,33 @@ extra_rdoc_files:
108
108
  files:
109
109
  - .gitignore
110
110
  - Gemfile
111
- - Gemfile.lock
112
111
  - LICENSE
113
112
  - README.markdown
114
113
  - Rakefile
115
114
  - VERSION
115
+ - bin/howl
116
116
  - howl.gemspec
117
117
  - lib/howl.rb
118
118
  - lib/howl/converter.rb
119
119
  - lib/howl/converters/markdown.rb
120
120
  - lib/howl/converters/sass.rb
121
121
  - lib/howl/core_ext.rb
122
+ - lib/howl/generator.rb
122
123
  - lib/howl/page.rb
123
124
  - lib/howl/plugin.rb
124
125
  - lib/howl/post.rb
126
+ - lib/howl/sample_site/.gitignore
127
+ - lib/howl/sample_site/Rakefile
128
+ - lib/howl/sample_site/config.yml
129
+ - lib/howl/sample_site/posts/first_post.md
130
+ - lib/howl/sample_site/site/css/screen.scss
131
+ - lib/howl/sample_site/site/index.html
132
+ - lib/howl/sample_site/templates/default.html
133
+ - lib/howl/sample_site/templates/post.html
134
+ - lib/howl/sample_site/templates/site.html
125
135
  - lib/howl/site.rb
126
136
  - lib/howl/template.rb
127
137
  - lib/howl/view.rb
128
- - sample_site/Rakefile
129
- - sample_site/posts/first_post.md
130
- - sample_site/site/index.html
131
- - sample_site/templates/default.html
132
- - sample_site/templates/site.html
133
138
  - test/fixtures/config.yml
134
139
  - test/fixtures/posts/first_post.html
135
140
  - test/fixtures/posts/markdown_post.md
@@ -147,10 +152,6 @@ files:
147
152
  - test/fixtures/templates/site.html
148
153
  - test/howl_test.rb
149
154
  - test/integration_site/config.yml
150
- - test/integration_site/generated/images/logo.png
151
- - test/integration_site/generated/index.html
152
- - test/integration_site/generated/posts/2010/10/17/post.html
153
- - test/integration_site/generated/stylesheets/screen.css
154
155
  - test/integration_site/posts/post.md
155
156
  - test/integration_site/site/images/logo.png
156
157
  - test/integration_site/site/index.html
@@ -1,34 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- howl (0.5.0)
5
- haml
6
- hashie
7
- mustache
8
- rdiscount
9
-
10
- GEM
11
- remote: http://rubygems.org/
12
- specs:
13
- haml (3.0.17)
14
- hashie (0.4.0)
15
- mustache (0.11.2)
16
- nokogiri (1.4.3.1)
17
- rdiscount (1.6.5)
18
- riot (0.11.4)
19
- rr
20
- term-ansicolor
21
- rr (1.0.0)
22
- term-ansicolor (1.0.5)
23
-
24
- PLATFORMS
25
- ruby
26
-
27
- DEPENDENCIES
28
- haml
29
- hashie
30
- howl!
31
- mustache
32
- nokogiri
33
- rdiscount
34
- riot (>= 0.11)
@@ -1,10 +0,0 @@
1
- template: default.html
2
-
3
- {{#posts}}
4
- <article id="{{dom_id}}" class="post">
5
- <h2 class="post-title"><a href="{{link}}">{{title}}</a></h2>
6
- <div class="post-content">
7
- {{& rendered_content}}
8
- </div>
9
- </article>
10
- {{/posts}}
@@ -1,17 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset=utf-8 />
5
- <title>{{title}}</title>
6
- <!--[if IE]>
7
- <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
8
- <![endif]-->
9
- <style>
10
- article, aside, dialog, figure, footer, header,
11
- hgroup, menu, nav, section { display: block; }
12
- </style>
13
- </head>
14
- <body>
15
- {{& content}}
16
- </body>
17
- </html>
@@ -1,44 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <title>dce.gitwrite.com</title>
6
- <link rel="stylesheet" href="/stylesheets/screen.css" type="text/css" />
7
- <!--[if IE]>
8
- <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
9
- <![endif]-->
10
- </head>
11
-
12
- <body>
13
- <div id="container">
14
- <div id="header">
15
- <h1><a href="http://dce.gitwrite.com">dce.gitwrite.com</a></h1>
16
- </div>
17
-
18
- <div id="content">
19
- <div class="post">
20
- <h2>
21
- <a href="/posts/2010/10/17/post.html">Welcome to GitWrite</a>
22
- </h2>
23
- <span class="meta sidebar">
24
- Oct 17, 2010 at 1:24 pm<br />
25
- </span>
26
- <p>Thank you for trying out GitWrite. Your blog lives in a repository at</p>
27
-
28
- <blockquote><p><code>git://gitwrite.com/blogs/dce.git</code></p></blockquote>
29
-
30
- <p>Pull it down (with <code>git checkout</code>), make some updates, and push it back.
31
- In a few moments, your blog will be regenerated to include your new content. Of
32
- course, you can always make edits through our <a href="http://gitwrite.com/site">web interface</a>, as well.</p>
33
-
34
- <p class="meta"><a href="/posts/2010/10/17/post.html">Permalink</a></p>
35
- </div>
36
-
37
- </div>
38
-
39
- <div id="footer" class="meta">
40
- Powered by <a href="http://gitwrite.com" class="image-link"><img src="/images/logo.png" width="100"/></a> &#182; Theme inspired by <a href="http://www.tumblr.com/theme/325">langer</a>
41
- </div>
42
- </div>
43
- </body>
44
- </html>
@@ -1,44 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <title>dce.gitwrite.com</title>
6
- <link rel="stylesheet" href="/stylesheets/screen.css" type="text/css" />
7
- <!--[if IE]>
8
- <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
9
- <![endif]-->
10
- </head>
11
-
12
- <body>
13
- <div id="container">
14
- <div id="header">
15
- <h1><a href="http://dce.gitwrite.com">dce.gitwrite.com</a></h1>
16
- </div>
17
-
18
- <div id="content">
19
- <div class="post">
20
- <h2>Welcome to GitWrite</h2>
21
- <span class="meta sidebar">
22
- Oct 17, 2010 at 1:24 pm<br />
23
- </span>
24
-
25
- <p>Thank you for trying out GitWrite. Your blog lives in a repository at</p>
26
-
27
- <blockquote><p><code>git://gitwrite.com/blogs/dce.git</code></p></blockquote>
28
-
29
- <p>Pull it down (with <code>git checkout</code>), make some updates, and push it back.
30
- In a few moments, your blog will be regenerated to include your new content. Of
31
- course, you can always make edits through our <a href="http://gitwrite.com/site">web interface</a>, as well.</p>
32
-
33
-
34
- <p class="meta"><a href="/posts/2010/10/17/post.html">Permalink</a></p>
35
- </div>
36
-
37
- </div>
38
-
39
- <div id="footer" class="meta">
40
- Powered by <a href="http://gitwrite.com" class="image-link"><img src="/images/logo.png" width="100"/></a> &#182; Theme inspired by <a href="http://www.tumblr.com/theme/325">langer</a>
41
- </div>
42
- </div>
43
- </body>
44
- </html>
@@ -1,60 +0,0 @@
1
- h1, h2, h3 {
2
- font-weight: normal;
3
- }
4
-
5
- a {
6
- text-decoration: none;
7
- background-color: #FF9;
8
- color: black;
9
- padding: 3px;
10
- }
11
-
12
- a:hover {
13
- border-bottom: 1px solid black;
14
- }
15
-
16
- #container {
17
- width: 500px;
18
- margin: 0 auto;
19
- font: 14px/1.5 Georgia, sans-serif;
20
- }
21
-
22
- #footer {
23
- margin-top: 60px;
24
- padding-top: 30px;
25
- border-top: 1px dotted #999;
26
- text-align: center;
27
- }
28
-
29
- div.post {
30
- position: relative;
31
- margin-top: 60px;
32
- }
33
-
34
- .meta {
35
- font-size: .8em;
36
- color: #999;
37
- font-style: italic;
38
- }
39
-
40
- div.post span.sidebar {
41
- position: absolute;
42
- top: 5px;
43
- left: -225px;
44
- width: 200px;
45
- text-align: right;
46
- border-right: 1px dotted #999;
47
- padding-right: 10px;
48
- display: block;
49
- }
50
-
51
- a.image-link {
52
- background: none;
53
- padding: none;
54
- border: none;
55
- }
56
-
57
- a.image-link img {
58
- border: 1px solid #999;
59
- vertical-align: middle;
60
- }