Permalink
Browse files

完成博客基本功能

  • Loading branch information...
1 parent 385391f commit fab04a06224353d6a483b8f4661f8b67fc5bca60 caoxh committed Jan 1, 2012
View
1 .rvmrc
@@ -0,0 +1 @@
+rvm use ree@mangege
View
8 Gemfile
@@ -0,0 +1,8 @@
+source "http://rubygems.org"
+
+group :development do
+ gem 'rake'
+ gem 'jekyll'
+ gem 'rdiscount'
+ gem 'stringex'
+end
View
34 Gemfile.lock
@@ -0,0 +1,34 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ albino (1.3.3)
+ posix-spawn (>= 0.3.6)
+ classifier (1.3.3)
+ fast-stemmer (>= 1.0.0)
+ directory_watcher (1.4.0)
+ fast-stemmer (1.0.0)
+ jekyll (0.11.0)
+ albino (>= 1.3.2)
+ classifier (>= 1.3.1)
+ directory_watcher (>= 1.1.1)
+ kramdown (>= 0.13.2)
+ liquid (>= 1.9.0)
+ maruku (>= 0.5.9)
+ kramdown (0.13.3)
+ liquid (2.2.2)
+ maruku (0.6.0)
+ syntax (>= 1.0.0)
+ posix-spawn (0.3.6)
+ rake (0.9.2)
+ rdiscount (1.6.8)
+ stringex (1.3.0)
+ syntax (1.0.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ jekyll
+ rake
+ rdiscount
+ stringex
View
45 Rakefile
@@ -0,0 +1,45 @@
+# coding: utf-8
+require "rubygems"
+require "bundler/setup"
+require "stringex"
+
+github_origin = 'git@github.com:mangege/mangege.github.com.git'
+domain = 'www.mangege.com'
+
+task :default => [:deploy]
+
+desc 'deploy to github pages'
+task :deploy do
+ puts "deploy site"
+ system 'rm -rf _site'
+ system 'jekyll'
+ cd '_site' do
+ system "echo -n #{domain} > CNAME"
+ system "git init"
+ system "git add ."
+ system "git commit -m 'site update #{Time.now}'"
+ system "git remote add origin #{github_origin}"
+ system "git push -f origin master"
+ end
+end
+
+# usage rake new_post[my-new-post] or rake new_post['my new post'] or rake new_post (defaults to "new-post")
+desc "Create a new Post"
+task :new_post, :title do |t, args|
+ args.with_defaults(:title => 'new-post')
+ title = args.title
+ filename = "_source/_posts/#{Time.now.strftime('%Y-%m-%d')}-#{title.to_url}.md"
+ if File.exist?(filename)
+ abort("文章 #{filename} 已存在")
+ end
+ puts "Creating new post: #{filename}"
+ open(filename, 'w') do |post|
+ post.puts "---"
+ post.puts "layout: post"
+ post.puts "title: \"#{title.gsub(/&/,'&')}\""
+ post.puts "date: #{Time.now.strftime('%Y-%m-%d %H:%M')}"
+ post.puts "categories: "
+ post.puts "---"
+ end
+ #system("vim #{filename}")
+end
View
5 _config.yml
@@ -9,10 +9,9 @@ destination: ./_site
plugins: ./_plugins
lsi: false
-pygments: false
-markdown: maruku
+pygments: true
+markdown: rdiscount
permalink: /:year/:month/:day/:title.html
paginate: 10 # Posts per page on the blog index
#pagination_dir: blog # Directory base for pagination URLs eg. /blog/page/2/
-
View
1 _plugins/generate_categories.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
# Jekyll category page generator.
# http://recursive-design.com/projects/jekyll-plugins/
#
View
4 _source/_includes/footer.html
@@ -1,5 +1,9 @@
<div id="footer-container">
<div id="footer">
+ <p class="copyright">
+ RSS <a href="/atom.xml" rel="subscribe-rss" title="订阅曹小华的博客">订阅</a> 本博客 |
+ <a href="https://github.com/mangege/mangege" title="本站源码">github</a> |
+ </p>
<p class="credit">Powered by <a class="wp-link" href="https://github.com/mojombo/jekyll" title="Powered by Jekyll, Jekyll is a simple, blog aware, static site generator. "><span>Jekyll</span></a> and <a class="theme-link" href="http://themehybrid.com/themes/hybrid" title="Hybrid"><span>Hybrid</span></a>.</p></div>
</div><!-- #footer -->
</div><!-- #footer-container -->
View
1 _source/_includes/head.html
@@ -4,4 +4,5 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>{% if page.title %}{{ page.title }} - {% endif %}曹小华的博客</title>
<link rel="stylesheet" href="/stylesheets/style.css" type="text/css" media="all" />
+<link href="/atom.xml" rel="alternate" title="曹小华的博客" type="application/atom+xml">
</head>
View
2 _source/_includes/post.html
@@ -1,6 +1,6 @@
<div class="hentry post publish">
<h2 class="entry-title"><a href="{{post.url}}" rel="bookmark">{{post.title}}</a></h2>
- <p class="byline"><abbr class="published">{{post.date}}</abbr>
+ <p class="byline"><abbr class="published">{{post.date || date: "%Y/%m/%d %H:%M"}}</abbr>
{% unless post.categories == empty %}| <span class="category">{{ post.categories | category_links }}</span>{% endunless %}
</p>
<div class="entry-content">
View
2 _source/_layouts/post.html
@@ -4,7 +4,7 @@
<div class="hentry post publish">
<h1 class="post-title entry-title"><a href="{{page.url}}" rel="bookmark">{{page.title}}</a></h1>
- <p class="byline"><abbr class="published">{{page.date}}</abbr>
+ <p class="byline"><abbr class="published">{{page.date || date: "%Y/%m/%d %H:%M"}}</abbr>
{% unless page.categories == empty %}| <span class="category">{{ page.categories | category_links }}</span>{% endunless %}
</p>
<div class="entry-content">
View
8 _source/_posts/2012-01-01-di-yi-pian-ji-zhu-wen-zhang.md
@@ -0,0 +1,8 @@
+---
+layout: post
+title: "第一篇技术文章"
+date: 2012-01-01 21:42
+categories: tech
+---
+
+用于初始化技术分类页
View
8 _source/_posts/2012-01-01-di-yi-pian-sheng-huo-wen-zhang.md
@@ -0,0 +1,8 @@
+---
+layout: post
+title: "第一篇生活文章"
+date: 2012-01-01 21:43
+categories: life
+---
+
+用于初始化生活分类页
View
6 _source/_posts/2012-1-1-hello.markdown
@@ -1,6 +0,0 @@
----
-layout: post
-categories: tech
----
-
-hello my blog
View
9 _source/_posts/2012-1-1-kitty.md
@@ -1,9 +0,0 @@
----
-layout: post
-title: KITTY猫
-categories: life
----
-
-hello kitty
-
- my love
View
23 _source/about.html
@@ -2,4 +2,25 @@
layout: default
title: 关于
---
-about me
+
+<h1>关于</h1>
+<pre>
+《长歌行》
+青青园中葵,朝露待日唏。
+阳春布德泽,万物生光辉。
+常恐秋节至,焜黄华叶衰。
+百川东到海,何时复西归。
+少壮不努力,老大徒伤悲。
+ ——出自汉乐府《长歌行》
+</pre>
+
+<h4>简介</h4>
+<p>
+一个程序员的博客,主要做Web开发方面.学过JAVA,现做RUBY.<br />
+待续...
+</p>
+
+<h4>联系</h4>
+<p>
+Gmail &amp; Gtalk &amp; Gplus: <strong>mr.mangege</strong>
+</p>
View
25 _source/atom.xml
@@ -0,0 +1,25 @@
+---
+layout: nil
+---
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+
+ <title><![CDATA[曹小华的博客]]></title>
+ <link href="http://www.mangege.com/atom.xml" rel="self"/>
+ <link href="http://www.mangege.com/"/>
+ <updated>{{ site.time | date_to_xmlschema }}</updated>
+ <id>http://www.mangege.com/</id>
+ <author>
+ <name><![CDATA[曹小华]]></name>
+ </author>
+
+ {% for post in site.posts limit: 20 %}
+ <entry>
+ <title type="html"><![CDATA[{{ post.title }}]]></title>
+ <link href="http://www.mangege.com/{{ post.url }}"/>
+ <updated>{{ post.date | date_to_xmlschema }}</updated>
+ <id>http://www.mangege.com/{{ post.id }}</id>
+ <content type="html"><![CDATA[{{ post.content }}]]></content>
+ </entry>
+ {% endfor %}
+</feed>

0 comments on commit fab04a0

Please sign in to comment.