Permalink
Browse files

reorganized directory structure

  • Loading branch information...
1 parent 6c472da commit f9304707fe84188f607cfbc45c76b5d19d75c174 @georgi committed Apr 27, 2009
Showing with 516 additions and 848 deletions.
  1. +76 −0 assets/print.css
  2. +91 −0 assets/styles.css
  3. +14 −8 bin/shinmun
  4. +16 −0 config.ru
  5. +0 −41 example/Rakefile
  6. BIN example/assets/images/favicon.ico
  7. BIN example/assets/images/loading.gif
  8. +0 −32 example/assets/javascripts/1-jquery.min.js
  9. +0 −5 example/assets/javascripts/2-jquery-form.min.js
  10. +0 −45 example/assets/javascripts/3-comments.js
  11. +0 −13 example/assets/javascripts/4-coderay.js
  12. +0 −76 example/assets/print.css
  13. +0 −23 example/assets/stylesheets/1-reset.css
  14. +0 −40 example/assets/stylesheets/2-typo.css
  15. +0 −23 example/assets/stylesheets/3-table.css
  16. +0 −15 example/assets/stylesheets/4-article.css
  17. +0 −20 example/assets/stylesheets/5-comments.css
  18. +0 −25 example/assets/stylesheets/6-diff.css
  19. +0 −33 example/assets/stylesheets/7-blog.css
  20. +0 −6 example/config.ru
  21. +0 −10 example/config/blog.yml
  22. +0 −7 example/pages/about.md
  23. +0 −90 example/templates/_comment_form.rhtml
  24. +0 −10 example/templates/_pagination.rhtml
  25. +0 −1 example/templates/comments.rhtml
  26. +0 −82 example/templates/layout.rhtml
  27. +102 −97 lib/shinmun/blog.rb
  28. +1 −1 lib/shinmun/comment.rb
  29. +1 −1 lib/shinmun/helpers.rb
  30. +4 −7 lib/shinmun/post_handler.rb
  31. +22 −36 lib/shinmun/routes.rb
  32. +4 −0 templates/404.rhtml
  33. +19 −0 templates/_comment_form.rhtml
  34. +1 −1 {example → }/templates/_comments.rhtml
  35. +0 −1 {example → }/templates/archive.rhtml
  36. +1 −2 {example → }/templates/category.rhtml
  37. 0 {example → }/templates/category.rxml
  38. +0 −1 {example → }/templates/index.rhtml
  39. 0 {example → }/templates/index.rxml
  40. +44 −0 templates/layout.rhtml
  41. +0 −2 {example → }/templates/page.rhtml
  42. +6 −21 {example → }/templates/post.rhtml
  43. +32 −73 test/blog_spec.rb
  44. +11 −0 test/templates/templates/_comments.rhtml
  45. +6 −0 test/templates/templates/archive.rhtml
  46. +6 −0 test/templates/templates/category.rhtml
  47. +20 −0 test/templates/templates/category.rxml
  48. +4 −0 test/templates/templates/index.rhtml
  49. +21 −0 test/templates/templates/index.rxml
  50. +9 −0 test/templates/templates/layout.rhtml
  51. +2 −0 test/templates/templates/page.rhtml
  52. +3 −0 test/templates/templates/post.rhtml
View
@@ -0,0 +1,76 @@
+body {
+ line-height:1.5;
+ font-family:"Helvetica Neue", "Lucida Grande", Arial, Verdana, sans-serif;
+ color:#000;
+ background:none;
+ font-size:10pt;
+}
+
+.container {
+ background:none;
+}
+
+h1,h2,h3,h4,h5,h6 {
+ font-family:"Helvetica Neue", Arial, "Lucida Grande", sans-serif;
+}
+
+code {
+ font:.9em "Courier New", Monaco, Courier, monospace;
+}
+
+img {
+ float:left;
+ margin:1.5em 1.5em 1.5em 0;
+}
+
+a img {
+ border:none;
+}
+
+p img.top {
+ margin-top:0;
+}
+
+hr {
+ background:#ccc;
+ color:#ccc;
+ width:100%;
+ height:2px;
+ border:none;
+ margin:2em 0;
+ padding:0;
+}
+
+blockquote {
+ font-style:italic;
+ font-size:.9em;
+ margin:1.5em;
+ padding:1em;
+}
+
+.small {
+ font-size:.9em;
+}
+
+.large {
+ font-size:1.1em;
+}
+
+.quiet {
+ color:#999;
+}
+
+.hide {
+ display:none;
+}
+
+a:link,a:visited {
+ background:transparent;
+ font-weight:700;
+ text-decoration:underline;
+}
+
+a:link:after,a:visited:after {
+ content:" (" attr(href) ") ";
+ font-size:90%;
+}
View
@@ -0,0 +1,91 @@
+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;
+}
+
+.comments {
+ margin-bottom: 2em;
+}
+
+.comments .comment, .preview .comment {
+ margin-top: 2em;
+ border: 1px solid #ccc;
+}
+
+.comments .comment .top, .preview .comment .top {
+ background: #F0F0F0;
+ color: #333;
+ padding: 3px 5px;
+}
+
+.comments .comment .body, .preview .comment .body {
+ background: #F8F8F8;
+ padding: 3px 5px;
+}
View
@@ -7,16 +7,22 @@ when 'init'
Shinmun::Blog.init ARGV[1]
when 'post'
- post = Shinmun::Post.new(:title => ARGV[1], :date => Date.today)
- FileUtils.mkpath(File.dirname(post.path))
- open(post.path, 'w') { |io| io.write post.dump }
- puts "created #{post.path}"
+ blog = Shinmun::Blog.new('.')
+ post = blog.create_post(:title => ARGV[1], :date => Date.today)
+ path = blog.post_file(post)
+
+ `git checkout #{path}`
+
+ exec "#{ENV['EDITOR']} #{path}"
when 'page'
- post = Shinmun::Post.new(:title => ARGV[1])
- FileUtils.mkpath(File.dirname(post.path))
- open(post.path, 'w') { |io| io.write post.dump }
- puts "created #{post.path}"
+ blog = Shinmun::Blog.new('.')
+ post = blog.create_page(:title => ARGV[1])
+ path = blog.post_file(post)
+
+ `git checkout #{path}`
+
+ exec "#{ENV['EDITOR']} #{path}"
else
puts "Usage:"
View
@@ -0,0 +1,16 @@
+require 'shinmun'
+
+use Rack::Session::Cookie
+use Rack::Reloader
+
+blog = Shinmun::Blog.new(File.dirname(__FILE__))
+
+blog.config = {
+ :language => 'en',
+ :title => "Blog Title",
+ :author => "The Author",
+ :categories => ["Ruby", "Javascript"],
+ :description => "Blog description"
+}
+
+run blog
View
@@ -1,41 +0,0 @@
-require 'shinmun'
-
-blog = Shinmun::Blog.new
-
-task :index do
- blog.write "index.html", "index.rhtml"
- blog.write "index.rss", "index.rxml"
-end
-
-blog.pages.each do |page|
- task page.path do
- blog.write page.path, "page.rhtml", :page => page
- end
-end
-
-blog.posts.each do |post|
- task "#{post.path}.html" do
- blog.write "#{post.path}.html", "post.rhtml", :post => post
- end
-end
-
-blog.archives.each do |year, month|
- task "#{year}/#{month}" do
- blog.write "#{year}/#{month}/index.html", "archive.rhtml", :year => year, :month => month
- end
-end
-
-blog.categories.each do |name|
- category = blog.find_category(name)
- task "categories/#{category[:permalink]}" do
- blog.write "categories/#{category[:permalink]}.html", "category.rhtml", category
- blog.write "categories/#{category[:permalink]}.rss", "category.rxml", category
- end
-end
-
-task :pages => blog.pages.map { |p| p.path }
-task :posts => blog.posts.map { |p| p.path }
-task :archives => blog.archives.map { |y,m| "#{y}/#{m}" }
-task :categories => blog.categories.map { |name| "categories/#{blog.urlify name}" }
-
-task :default => [:index, :pages, :posts, :archives, :categories]
Binary file not shown.
Deleted file not rendered
Oops, something went wrong.

0 comments on commit f930470

Please sign in to comment.