• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Shinmun: Shinmun是基于文件的小而美博客引擎,在喜欢的编辑器中编写帖子,使用 git ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

Shinmun

开源软件地址:

https://gitee.com/mirrors/Shinmun

开源软件介绍:

Shinmun - a file based blog engine

Shinmun 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

  • Posts are text files formatted with Markdown, Textile or HTML
  • Deploy via git-push
  • Easy and fast deploying on Heroku
  • Index, category and archive listings
  • RSS feeds
  • Syntax highlighting provided by CodeRay

Quickstart

Install 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 Posts

Posts can be created by using the shinmun command inside your blogfolder:

shinmun post 'The title of the post'

Shinmun will then create a post file in the right place, for examplein posts/2008/9/the-title-of-the-post.md.

Post Format

Each 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:

  • title: mandatory
  • date: posts need one, pages not
  • category: a post belongs to one category
  • tags: a comma separated list of tags

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 highlighting

Thanks to the fantastic highlighting library CodeRay, highlightedcode blocks can be embedded easily in Markdown. For Textile supportyou have to require coderay/for_redcloth. These languages aresupported: C, Diff, Javascript, Scheme, CSS, HTML, XML, Java, JSON,RHTML, YAML, Delphi

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 configuation

In config.ru you can set the properties of your blog:

blog.config = {  :language => 'en',  :title => "Blog Title",  :author => "The Author",  :categories => ["Ruby", "Javascript"],  :description => "Blog description"}

Templates

Layout and templates are rendered by ERB. The layout is defined intemplates/layout.rhtml. The content will be provided in the variable@content. A minimal example:

<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 Heroku

Install 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 Project

Download or fork the package at my github repository


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
gulimall: 谷粒商城发布时间:2022-03-25
下一篇:
Eric1689/shop-wechat发布时间:2022-03-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap