资源说明:The RubySlippers Engine Library
README ====== RubySlippers, the smartest blogging engine in all of Oz! -------------------------------------------------------- [website](http://ruby-slippers.heroku.com) Introduction ------------ ### To set up a new blog $ git clone git://github.com/dreamr/ruby-slippers.git myblog $ cd myblog $ gem install bundler $ bundle $ rake install $ -> Blog name: My new blog $ Installing your blog to my-new-blog $ Blog installed! ### To create an article $ rake new $ -> Title: My new blog post! $ Creating and opening my-new-blog-post (opens in your text editor!) $ rake publish (commits, pushes, publishes then opens in your browser!) Philosophy ---------- RubySlippers is based on [Toto](http://github.com/cloudhead/toto) and aims to achieve their goals as well as our own. Hosting a ruby based free blog shouldn't be hard. We want to take that a step further and say it should be easy. Easy as pie. Easy as my best friend's Mom. Easy as a 1 click installer. Oh yeah, MRI, bytecode whatever. If it is Ruby, it should run. How it works ------------ - Article management is done with a text editor and git * stored as _.txt_ files, with embeded metadata (in yaml format). * processed through a markdown converter (rdiscount) by default. * can have tags * can have images * can be browsed by date, or tags * comments are handled by [disqus](http://disqus.com) - built for easy use with _ERB_. - built right on top of _Rack_. - built to take advantage of _HTTP caching_. - built with _heroku_ in mind. RubySlippers comes with a basic default theme for you to mangle. I hope to release more themes shortly and will accept your submitted themes. Deployment ========== #### On heroku $ git add . $ git commit -m 'updated blog' $ git push heroku #### On your own server or locally Once you have created the remote git repo, and pushed your changes to it, you can run RubySlippers with any Rack compliant web server, such as **thin**, **mongrel** or **unicorn**. I like to use shotgun as it reloads while I work $ cd myblog $ bundle $ shotgun With thin, you would do something like: $ thin start -R config.ru With unicorn, you can just do: $ unicorn ### Configuration You can configure ruby-slippers, by modifying the _config.ru_ file. For example, if you want to set the blog author to 'John Galt', you could add `set :author, 'John Galt'` inside the `RubySlippers::Engine::App.new` block. Here are the defaults, to get you started: # # Add your settings here # set [:setting], [value] # set :author, "Dreamr" # blog author set :title, "RubySlippers, the smartest blog engine in all of Oz!" # site title # set :root, "index" # page to load on / set :date, lambda {|now| now.strftime("%m/%d/%Y") } # date format for articles # set :markdown, :smart # use markdown + smart-mode # set :disqus, false # disqus id, or false set :summary, :max => 300, :delim => /~/ # length of article summary and delimiter # set :ext, 'txt' # file extension for articles # set :cache, 28800 # cache duration, in seconds set :tag_separator, ', ' # tag separator for articles set :date, lambda {|now| now.strftime("%B #{now.day.ordinal} %Y") } # set this to your local port. I use shotgun, so 9393. set :url, "http://localhost:9393" if ENV['RACK_ENV'] == 'development' # to use haml, add the gem to your Gemfile and bundle, then uncomment this # and redo your templates using haml and renamed to html.haml # set :to_html, lambda { |path, page, binding| # Haml::Engine.new(File.read("#{path}/#{page}.html.haml"), # :attr_wrapper => '"', # :filename => path ).render(binding) # } Thanks ------ * To heroku for making this easy as pie. * To the developers of [Toto](http://github.com/cloudhead/toto), for making such an awesome minimal blog engine in Ruby. Copyright (c) 2011 dreamr. See LICENSE for details.
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。