Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

shinmun command fixed

  • Loading branch information...
commit ea358d16e6b97ad1f0cb55b54b858d444066a24d 1 parent 4969e80
Matthias Georgi authored
1  lib/shinmun/blog.rb
View
@@ -30,7 +30,6 @@ def self.init(path)
FileUtils.cp_r "#{ROOT}/public", path
FileUtils.cp_r "#{ROOT}/templates", path
FileUtils.cp "#{ROOT}/config.ru", path
- FileUtils.cp "#{ROOT}/.gems", path
Dir.mkdir("#{path}/posts")
Dir.mkdir("#{path}/pages")
2  lib/shinmun/routes.rb
View
@@ -26,7 +26,7 @@
end
feed '/index\.rss' do
- render 'index.rxml', :layout => false
+ render 'index.rxml', :layout => false, :posts => posts[0, 20]
end
index '/$' do
71 public/styles.css
View
@@ -0,0 +1,71 @@
+html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p,
+blockquote, pre, a, abbr, acronym, address, del, dfn, img,
+q, fieldset, form, label, legend, table,
+caption, tbody, tfoot, thead, tr, th, td {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ font-weight: inherit;
+ font-style: inherit;
+ font-size: 100%;
+ font-family: inherit;
+ vertical-align: baseline;
+}
+
+body {
+ line-height: 1.5;
+ background: #fff;
+ margin:0.5em 0;
+ font-size: 80%;
+ color: #222;
+ font-family: Arial, sans-serif;
+}
+
+p {
+ margin-bottom: 1em;
+}
+
+a {
+ color: #444;
+}
+
+a:visited {
+ color: #444;
+}
+
+h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
+ text-decoration: none;
+}
+
+h1 { font-size: 2em; line-height: 1; margin-top: 1em; margin-bottom: 1em; }
+h2 { font-size: 1.5em; margin-top: 0.75em; margin-bottom: 0.75em; }
+h3 { font-size: 1.3em; line-height: 1; margin-top: 1.7em; margin-bottom: 1em; }
+h4 { font-size: 1.2em; line-height: 1.25; margin-top: 1.25em; margin-bottom: 1.25em; }
+h5 { font-size: 1em; font-weight: bold; margin-bottom: 1.5em; }
+h6 { font-size: 1em; font-weight: bold; }
+
+hr {
+ height: 1px;
+ color: #ccc;
+}
+
+.container {
+ width: 600px;
+ margin: 0 auto;
+}
+
+.article {
+}
+
+.article h2 {
+ margin-top:0px;
+}
+
+.article .date {
+ color: #666;
+}
+
+.article .tags a {
+ color: #69c;
+ text-decoration: none;
+}
4 shinmun.gemspec
View
@@ -17,12 +17,10 @@ Gem::Specification.new do |s|
s.has_rdoc = true
s.extra_rdoc_files = ['README.md']
s.files = %w{
-.gems
README.md
LICENSE
Rakefile
-public/stylesheets/print.css
-public/stylesheets/styles.css
+public/styles.css
bin/shinmun
config.ru
lib/shinmun.rb
14 templates/index.rxml
View
@@ -7,14 +7,14 @@
<language><%= @blog.language %></language>
<copyright><%= @blog.author %></copyright>
<pubDate><%= rfc822 Time.now %></pubDate>
- <% for post in @blog.recent_posts %>
+ <% for post in @posts %>
<item>
- <title><%= post.title %></title>
- <category><%= post.category %></category>
- <description><%= strip_tags post.summary %></description>
- <author><%= @author || @blog.author %></author>
- <link><%= @blog.url %><%= post_path post %></link>
- <pubDate><%= rfc822 post.date %></pubDate>
+ <title><%= post.title %></title>
+ <category><%= post.category %></category>
+ <description><%= strip_tags post.summary %></description>
+ <author><%= @author || @blog.author %></author>
+ <link><%= @blog.url %><%= post_path post %></link>
+ <pubDate><%= rfc822 post.date %></pubDate>
</item>
<% end %>
</channel>
19 templates/layout.rhtml
View
@@ -5,8 +5,7 @@
<meta http-equiv="Content-Language" content="English" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="/index.rss" />
- <link rel="stylesheet" media="screen" type="text/css" href="/assets/styles.css" />
- <link rel="stylesheet" media="print" type="text/css" href="/assets/print.css" />
+ <link rel="stylesheet" media="screen" type="text/css" href="/styles.css" />
</head>
<body>
<div class="container">
@@ -23,20 +22,20 @@
<hr/>
<p>
- <h4>Categories</h4>
- <ul>
- <li><%= link_to 'Ruby', '/categories/ruby' %></li>
- <li><%= link_to 'Javascript', '/categories/javascript' %></li>
- </ul>
+ <h4>Categories</h4>
+ <ul>
+ <li><%= link_to 'Ruby', '/categories/ruby' %></li>
+ <li><%= link_to 'Javascript', '/categories/javascript' %></li>
+ </ul>
</p>
<p>
- <h4>Archive</h4>
- <ul>
+ <h4>Archive</h4>
+ <ul>
<% for year, month in @blog.archives %>
<li><%= archive_link year, month %></li>
<% end %>
- </ul>
+ </ul>
</p>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.