在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:Shinmun开源软件地址:https://gitee.com/mirrors/Shinmun开源软件介绍:Shinmun - a file based blog engineShinmun is a small file based blog engine. Write posts in your favoriteeditor, track them with git and deploy to Heroku. Small, fast and simple. Features
QuickstartInstall the gems: $ gem install shinmun Create a sample blog: $ shinmun init myblog This will create a directory with all necessary files. Now start theweb server: $ cd myblog$ rackup Browse to the following url: http://localhost:9292 Voilà, your first blog is up and running! Writing PostsPosts can be created by using the shinmun post 'The title of the post' Shinmun will then create a post file in the right place, for examplein Post FormatEach blog post is just a text file with a YAML header and a body. TheYAML header is surrounded with 2 lines of 3 dashes. The YAML header has following attributes:
Example post: --- date: 2008-09-05category: Rubytags: bluecloth, markdowntitle: BlueCloth, a Markdown library---This is the summary, which is by definition the first paragraph of thearticle. The summary shows up in category listings or the index listing. Syntax highlightingThanks to the fantastic highlighting library CodeRay, highlightedcode blocks can be embedded easily in Markdown. For Textile supportyou have to require To activate CodeRay for a code block, you have to declare the languagein lower case: @@rubydef method_missing(id, *args, &block) puts "#{id} was called with #{args.inspect}"end Note that the declaration MUST be followed by a blank line! Directory layout+ config.ru+ pages + about.md+ posts + 2007 + 2008 + 9 + my-article.md+ public + styles.css+ templates + 404.rhtml + archive.rhtml + category.rhtml + index.rhtml + index.rxml + layout.rhtml + page.rhtml + post.rhtml Blog configuationIn blog.config = { :language => 'en', :title => "Blog Title", :author => "The Author", :categories => ["Ruby", "Javascript"], :description => "Blog description"} TemplatesLayout and templates are rendered by ERB. The layout is defined in <html> <head> <title><%= @blog.title %></title> <%= stylesheet_link_tag 'style' %> </head> <body> <%= @content %> </body> </html> The attributes of a post are accessible via the @post variable: <div class="article"> <h1><%= @post.title %></h1> <div class="date"> <%= human_date @post.date %> </div> <%= @post.body_html %> ... </div> Deployment on HerokuInstall the Heroku gem: $ gem install heroku Installing your public key: $ heroku keys:addEnter your Heroku credentials.Email: [email protected]Password: Uploading ssh public key /Users/joe/.ssh/id_rsa.pub Create an app on Heroku. $ heroku create myblogCreated http://myblog.heroku.com/ | [email protected]:mybblog.gitGit remote heroku added Now on your local machine, you create a new remote repository and pushyour blog to Heroku: $ cd ~/myblog$ git init$ git add .$ git commit -m 'initial commit'$ git push heroku That's it. Your blog is deployed. GitHub ProjectDownload or fork the package at my github repository |
请发表评论