shinmun 0.9.2 → 1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,26 +1,24 @@
1
- Shinmun - a git-based blog engine
1
+ Shinmun - a file based blog engine
2
2
  =================================
3
3
 
4
- Shinmun is a small git-based blog engine. Write posts in your favorite
5
- editor, git-push it and serve your blog straight from a repository.
4
+ Shinmun is a small file based blog engine. Write posts in your favorite
5
+ editor, track them with git and deploy to Heroku. Small, fast and simple.
6
6
 
7
7
  ### Features
8
8
 
9
9
  * Posts are text files formatted with [Markdown][8], [Textile][9] or [HTML][10]
10
- * Runs on [Rack][6], [Kontrol][3] and [GitStore][7]
11
10
  * Deploy via [git-push][11]
11
+ * Easy and fast deploying on Heroku
12
12
  * Index, category and archive listings
13
13
  * RSS feeds
14
14
  * Syntax highlighting provided by [CodeRay][4]
15
- * Markdown comments
16
15
 
17
16
 
18
17
  ### Quickstart
19
18
 
20
19
  Install the gems:
21
20
 
22
- $ gem sources -a http://gems.github.com
23
- $ gem install rack BlueCloth rubypants coderay georgi-git_store georgi-kontrol georgi-shinmun
21
+ $ gem install shinmun
24
22
 
25
23
  Create a sample blog:
26
24
 
@@ -47,14 +45,13 @@ folder:
47
45
  shinmun post 'The title of the post'
48
46
 
49
47
  Shinmun will then create a post file in the right place, for example
50
- in `posts/2008/9/the-title-of-the-post.md` and open it with $EDITOR.
48
+ in `posts/2008/9/the-title-of-the-post.md`.
51
49
 
52
50
 
53
51
  ### Post Format
54
52
 
55
53
  Each blog post is just a text file with a YAML header and a body. The
56
- YAML header is surrounded with 2 lines of 3 dashes. This format is
57
- compatible with [Jekyll][13] and [Github Pages][14].
54
+ YAML header is surrounded with 2 lines of 3 dashes.
58
55
 
59
56
  The YAML header has following attributes:
60
57
 
@@ -97,9 +94,6 @@ in lower case:
97
94
 
98
95
  ### Directory layout
99
96
 
100
- + assets
101
- + print.css
102
- + styles.css
103
97
  + config.ru
104
98
  + pages
105
99
  + about.md
@@ -108,16 +102,14 @@ in lower case:
108
102
  + 2008
109
103
  + 9
110
104
  + my-article.md
105
+ + public
106
+ + styles.css
111
107
  + templates
112
108
  + 404.rhtml
113
109
  + archive.rhtml
114
110
  + category.rhtml
115
- + category.rxml
116
- + _comments.rhtml
117
- + _comment_form.rhtml
118
111
  + index.rhtml
119
112
  + index.rxml
120
- + index.rhtml
121
113
  + layout.rhtml
122
114
  + page.rhtml
123
115
  + post.rhtml
@@ -168,67 +160,38 @@ The attributes of a post are accessible via the @post variable:
168
160
  </div>
169
161
 
170
162
 
171
- ### Commenting System
172
-
173
- Comments are stored as flat files and encoded as YAML objects. Each
174
- post has a corresponding comment file located at `comments/<path to
175
- post>`. So administration of comments is possible by editing the YAML
176
- file, which can be done on your local machine, as you can just pull
177
- the comments from your live server.
178
-
179
-
180
- ### Deployment
181
-
182
- Shinmun can server the blog straight from the git repository. So on
183
- your webserver initialize a new git repo like:
184
-
185
- $ cd /var/www
186
- $ mkdir myblog
187
- $ cd myblog
188
- $ git init
189
-
190
- Now on your local machine, you add a new remote repository and push
191
- your blog to your server:
192
-
193
- $ cd ~/myblog
194
- $ git remote add live ssh://myserver.com/var/www/myblog
195
- $ git push live
196
-
163
+ ### Deployment on Heroku
197
164
 
198
- On your production server, you just need the rackup file `config.ru`
199
- to run the blog:
165
+ Install the Heroku gem:
200
166
 
201
- $ git checkout config.ru
167
+ $ gem install heroku
202
168
 
203
- Now you can run just a pure ruby server or something like Phusion
204
- Passenger. Anytime you want to publish a post on your blog, you
205
- just write, commit and finally push a post by:
169
+ Installing your public key:
206
170
 
207
- $ git commit -a -m 'new post'
208
- $ git push live
171
+ $ heroku keys:add
209
172
 
173
+ Enter your Heroku credentials.
174
+ Email: joe@example.com
175
+ Password:
176
+ Uploading ssh public key /Users/joe/.ssh/id_rsa.pub
210
177
 
211
- ### Phusion Passenger
178
+ Create an app on Heroku.
212
179
 
213
- Shinmun is compatible with [Phusion Passenger][5]. Install Phusion
214
- Passenger as described in my [blog post][2].
180
+ $ heroku create myblog
181
+ Created http://myblog.heroku.com/ | git@heroku.com:mybblog.git
182
+ Git remote heroku added
215
183
 
216
- Assuming that you are on a Debian or Ubuntu system, you can create a
217
- file named `/etc/apache2/sites-available/blog`:
184
+ Now on your local machine, you create a new remote repository and push
185
+ your blog to Heroku:
218
186
 
219
- <VirtualHost *:80>
220
- ServerName myblog.com
221
- DocumentRoot /var/www/blog/public
222
- </VirtualHost>
223
-
224
- Enable the new virtual host:
225
-
226
- $ a2ensite myapp
187
+ $ cd ~/myblog
188
+ $ git init
189
+ $ git add .
190
+ $ git commit -m 'initial commit'
191
+ $ git push heroku
227
192
 
228
- After restarting Apache your blog should run on Apache on your desired
229
- domain:
193
+ That's it. Your blog is deployed.
230
194
 
231
- $ /etc/init.d/apache2 restart
232
195
 
233
196
 
234
197
  ### GitHub Project
data/lib/shinmun.rb CHANGED
@@ -1,3 +1,5 @@
1
+ $:.unshift '../../kontrol/lib'
2
+
1
3
  require 'rubygems'
2
4
  require 'fileutils'
3
5
  require 'bluecloth'
data/lib/shinmun/blog.rb CHANGED
@@ -30,7 +30,6 @@ module Shinmun
30
30
  FileUtils.cp_r "#{ROOT}/public", path
31
31
  FileUtils.cp_r "#{ROOT}/templates", path
32
32
  FileUtils.cp "#{ROOT}/config.ru", path
33
- FileUtils.cp "#{ROOT}/.gems", path
34
33
 
35
34
  Dir.mkdir("#{path}/posts")
36
35
  Dir.mkdir("#{path}/pages")
data/lib/shinmun/post.rb CHANGED
@@ -88,6 +88,7 @@ module Shinmun
88
88
  end
89
89
 
90
90
  def save
91
+ FileUtils.mkpath(File.dirname(path))
91
92
  File.open(path, 'w') do |io|
92
93
  io << dump
93
94
  end
@@ -69,23 +69,3 @@ hr {
69
69
  color: #69c;
70
70
  text-decoration: none;
71
71
  }
72
-
73
- .comments {
74
- margin-bottom: 2em;
75
- }
76
-
77
- .comments .comment, .preview .comment {
78
- margin-top: 2em;
79
- border: 1px solid #ccc;
80
- }
81
-
82
- .comments .comment .top, .preview .comment .top {
83
- background: #F0F0F0;
84
- color: #333;
85
- padding: 3px 5px;
86
- }
87
-
88
- .comments .comment .body, .preview .comment .body {
89
- background: #F8F8F8;
90
- padding: 3px 5px;
91
- }
data/templates/index.rxml CHANGED
@@ -12,7 +12,7 @@
12
12
  <title><%= post.title %></title>
13
13
  <category><%= post.category %></category>
14
14
  <description><%= strip_tags post.summary %></description>
15
- <author><%= @blog.author %></author>
15
+ <author><%= @author || @blog.author %></author>
16
16
  <link><%= @blog.url %><%= post_path post %></link>
17
17
  <pubDate><%= rfc822 post.date %></pubDate>
18
18
  </item>
@@ -5,8 +5,7 @@
5
5
  <meta http-equiv="Content-Language" content="English" />
6
6
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
7
7
  <link rel="alternate" type="application/rss+xml" title="RSS" href="/index.rss" />
8
- <link rel="stylesheet" media="screen" type="text/css" href="/assets/styles.css" />
9
- <link rel="stylesheet" media="print" type="text/css" href="/assets/print.css" />
8
+ <link rel="stylesheet" media="screen" type="text/css" href="/styles.css" />
10
9
  </head>
11
10
  <body>
12
11
  <div class="container">
@@ -23,20 +22,20 @@
23
22
  <hr/>
24
23
 
25
24
  <p>
26
- <h4>Categories</h4>
27
- <ul>
28
- <li><%= link_to 'Ruby', '/categories/ruby' %></li>
29
- <li><%= link_to 'Javascript', '/categories/javascript' %></li>
30
- </ul>
25
+ <h4>Categories</h4>
26
+ <ul>
27
+ <li><%= link_to 'Ruby', '/categories/ruby' %></li>
28
+ <li><%= link_to 'Javascript', '/categories/javascript' %></li>
29
+ </ul>
31
30
  </p>
32
31
 
33
32
  <p>
34
- <h4>Archive</h4>
35
- <ul>
33
+ <h4>Archive</h4>
34
+ <ul>
36
35
  <% for year, month in @blog.archives %>
37
36
  <li><%= archive_link year, month %></li>
38
37
  <% end %>
39
- </ul>
38
+ </ul>
40
39
  </p>
41
40
 
42
41
  </div>
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shinmun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ hash: 15
5
+ prerelease:
6
+ segments:
7
+ - 1
8
+ - 0
9
+ version: "1.0"
5
10
  platform: ruby
6
11
  authors:
7
12
  - Matthias Georgi
@@ -9,60 +14,85 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-02-08 00:00:00 +01:00
17
+ date: 2011-06-06 00:00:00 +02:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: BlueCloth
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
20
25
  requirements:
21
26
  - - ">="
22
27
  - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
23
31
  version: "0"
24
- version:
32
+ type: :runtime
33
+ version_requirements: *id001
25
34
  - !ruby/object:Gem::Dependency
26
35
  name: rubypants
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
30
39
  requirements:
31
40
  - - ">="
32
41
  - !ruby/object:Gem::Version
42
+ hash: 3
43
+ segments:
44
+ - 0
33
45
  version: "0"
34
- version:
46
+ type: :runtime
47
+ version_requirements: *id002
35
48
  - !ruby/object:Gem::Dependency
36
49
  name: rack
37
- type: :runtime
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ none: false
40
53
  requirements:
41
54
  - - ">="
42
55
  - !ruby/object:Gem::Version
56
+ hash: 15
57
+ segments:
58
+ - 1
59
+ - 0
43
60
  version: "1.0"
44
- version:
61
+ type: :runtime
62
+ version_requirements: *id003
45
63
  - !ruby/object:Gem::Dependency
46
64
  name: coderay
47
- type: :runtime
48
- version_requirement:
49
- version_requirements: !ruby/object:Gem::Requirement
65
+ prerelease: false
66
+ requirement: &id004 !ruby/object:Gem::Requirement
67
+ none: false
50
68
  requirements:
51
69
  - - ">="
52
70
  - !ruby/object:Gem::Version
71
+ hash: 57
72
+ segments:
73
+ - 0
74
+ - 9
75
+ - 1
53
76
  version: 0.9.1
54
- version:
77
+ type: :runtime
78
+ version_requirements: *id004
55
79
  - !ruby/object:Gem::Dependency
56
80
  name: kontrol
57
- type: :runtime
58
- version_requirement:
59
- version_requirements: !ruby/object:Gem::Requirement
81
+ prerelease: false
82
+ requirement: &id005 !ruby/object:Gem::Requirement
83
+ none: false
60
84
  requirements:
61
85
  - - ">="
62
86
  - !ruby/object:Gem::Version
63
- version: 0.3.3
64
- version:
65
- description: git-based blog engine.
87
+ hash: 17
88
+ segments:
89
+ - 0
90
+ - 3
91
+ - 1
92
+ version: 0.3.1
93
+ type: :runtime
94
+ version_requirements: *id005
95
+ description: file based blog engine.
66
96
  email: matti.georgi@gmail.com
67
97
  executables:
68
98
  - shinmun
@@ -71,12 +101,10 @@ extensions: []
71
101
  extra_rdoc_files:
72
102
  - README.md
73
103
  files:
74
- - .gems
75
104
  - README.md
76
105
  - LICENSE
77
106
  - Rakefile
78
- - public/stylesheets/print.css
79
- - public/stylesheets/styles.css
107
+ - public/styles.css
80
108
  - bin/shinmun
81
109
  - config.ru
82
110
  - lib/shinmun.rb
@@ -106,23 +134,29 @@ rdoc_options: []
106
134
  require_paths:
107
135
  - lib
108
136
  required_ruby_version: !ruby/object:Gem::Requirement
137
+ none: false
109
138
  requirements:
110
139
  - - ">="
111
140
  - !ruby/object:Gem::Version
141
+ hash: 3
142
+ segments:
143
+ - 0
112
144
  version: "0"
113
- version:
114
145
  required_rubygems_version: !ruby/object:Gem::Requirement
146
+ none: false
115
147
  requirements:
116
148
  - - ">="
117
149
  - !ruby/object:Gem::Version
150
+ hash: 3
151
+ segments:
152
+ - 0
118
153
  version: "0"
119
- version:
120
154
  requirements: []
121
155
 
122
156
  rubyforge_project:
123
- rubygems_version: 1.3.5
157
+ rubygems_version: 1.4.2
124
158
  signing_key:
125
159
  specification_version: 3
126
- summary: git-based blog engine
160
+ summary: file based blog engine
127
161
  test_files: []
128
162
 
data/.gems DELETED
@@ -1 +0,0 @@
1
- shinmun --version 0.9.2
@@ -1,76 +0,0 @@
1
- body {
2
- line-height:1.5;
3
- font-family:"Helvetica Neue", "Lucida Grande", Arial, Verdana, sans-serif;
4
- color:#000;
5
- background:none;
6
- font-size:10pt;
7
- }
8
-
9
- .container {
10
- background:none;
11
- }
12
-
13
- h1,h2,h3,h4,h5,h6 {
14
- font-family:"Helvetica Neue", Arial, "Lucida Grande", sans-serif;
15
- }
16
-
17
- code {
18
- font:.9em "Courier New", Monaco, Courier, monospace;
19
- }
20
-
21
- img {
22
- float:left;
23
- margin:1.5em 1.5em 1.5em 0;
24
- }
25
-
26
- a img {
27
- border:none;
28
- }
29
-
30
- p img.top {
31
- margin-top:0;
32
- }
33
-
34
- hr {
35
- background:#ccc;
36
- color:#ccc;
37
- width:100%;
38
- height:2px;
39
- border:none;
40
- margin:2em 0;
41
- padding:0;
42
- }
43
-
44
- blockquote {
45
- font-style:italic;
46
- font-size:.9em;
47
- margin:1.5em;
48
- padding:1em;
49
- }
50
-
51
- .small {
52
- font-size:.9em;
53
- }
54
-
55
- .large {
56
- font-size:1.1em;
57
- }
58
-
59
- .quiet {
60
- color:#999;
61
- }
62
-
63
- .hide {
64
- display:none;
65
- }
66
-
67
- a:link,a:visited {
68
- background:transparent;
69
- font-weight:700;
70
- text-decoration:underline;
71
- }
72
-
73
- a:link:after,a:visited:after {
74
- content:" (" attr(href) ") ";
75
- font-size:90%;
76
- }