-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgithubshang-da-bo-ke.html
198 lines (179 loc) · 11.8 KB
/
githubshang-da-bo-ke.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Won" />
<meta name="copyright" content="Won" />
<meta name="keywords" content="博客, Life, " />
<title>Github上搭博客 · Tugqi Biz
</title>
<link href="http://cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="http://wbowam.github.io/theme/css/style.css" media="screen">
<link rel="stylesheet" type="text/css" href="http://wbowam.github.io/theme/css/solarizedlight.css" media="screen">
<link rel="shortcut icon" href="http://wbowam.github.io/theme/images/favicon.ico" type="image/x-icon" />
<link rel="apple-touch-icon" href="http://wbowam.github.io/theme/images/apple-touch-icon.png" />
<link rel="apple-touch-icon" sizes="57x57" href="http://wbowam.github.io/theme/images/apple-touch-icon-57x57.png" />
<link rel="apple-touch-icon" sizes="72x72" href="http://wbowam.github.io/theme/images/apple-touch-icon-72x72.png" />
<link rel="apple-touch-icon" sizes="114x114" href="http://wbowam.github.io/theme/images/apple-touch-icon-114x114.png" />
<link rel="apple-touch-icon" sizes="144x144" href="http://wbowam.github.io/theme/images/apple-touch-icon-144x144.png" />
<link rel="icon" href="http://wbowam.github.io/theme/images/apple-touch-icon-144x144.png" />
</head>
<body>
<div id="content-sans-footer">
<div class="navbar navbar-static-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="http://wbowam.github.io/"><span class=site-name>Tugqi Biz</span></a>
<div class="nav-collapse collapse">
<ul class="nav pull-right top-menu">
<li ><a href="http://wbowam.github.io">Home</a></li>
<li ><a href="http://wbowam.github.io/categories.html">Categories</a></li>
<li ><a href="http://wbowam.github.io/tags.html">Tags</a></li>
<li ><a href="http://wbowam.github.io/archives.html">Archives</a></li>
<li><form class="navbar-search" action="http://wbowam.github.io/search.html" onsubmit="return validateForm(this.elements['q'].value);"> <input type="text" class="search-query" placeholder="Search" name="q" id="tipue_search_input"></form></li>
</ul>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span1"></div>
<div class="span10">
<article>
<div class="row-fluid">
<header class="page_header span10">
<h1><a href="http://wbowam.github.io/githubshang-da-bo-ke.html"> Github上搭博客 </a></h1>
</header>
</div>
<div class="row-fluid">
<div class="span10 article-content">
<p>Github上搭博客</p>
<hr />
<h3 id="1">1.过程概要<a class="headerlink" href="#1" title="Permanent link">¶</a></h3>
<ul>
<li>在Github上创建工程</li>
<li>安装配置pelican和git,以及准备工作</li>
<li>开始写博客</li>
</ul>
<h3 id="2">2.详细步骤<a class="headerlink" href="#2" title="Permanent link">¶</a></h3>
<h3 id="github">在GitHub上创建工程<a class="headerlink" href="#github" title="Permanent link">¶</a></h3>
<p>注册,配置github的过程略过</p>
<h5 id="tulpar008githubcomtulpar008">创建一个tulpar008.github.com的库(tulpar008是用户名必须是用户名)<a class="headerlink" href="#tulpar008githubcomtulpar008" title="Permanent link">¶</a></h5>
<h5 id="pelican">安装配置pelican,以及准备工作<a class="headerlink" href="#pelican" title="Permanent link">¶</a></h5>
<h4 id="pelican_1">pelican的安装<a class="headerlink" href="#pelican_1" title="Permanent link">¶</a></h4>
<p><code>sudo pip install pelican</code> </p>
<h4 id="blogblog">电脑上创建一个blog目录,用来存放你的博客文件(我这里目录名直接用的“blog”)<a class="headerlink" href="#blogblog" title="Permanent link">¶</a></h4>
<div class="highlight"><pre><span class="n">mkdir</span> <span class="n">blog</span>
<span class="n">cd</span> <span class="n">blog</span>
<span class="n">pelican</span><span class="o">-</span><span class="n">quickstart</span>
</pre></div>
<p>这个时候你会看到blog目录下多了几个Pelican生成的文件,其中的pelicanconf.py就是配置文件</p>
<h3 id="_1">开始写博客<a class="headerlink" href="#_1" title="Permanent link">¶</a></h3>
<p>现在,就可以用Pelican开始写博客了,具体怎么写可参看Pelican的文档,这里我用Markdown举例。</p>
<h4 id="contentmd">进入content目录,用编辑器创建一个文件,写入博客内容并保存为md文件:<a class="headerlink" href="#contentmd" title="Permanent link">¶</a></h4>
<div class="highlight"><pre><span class="n">Date</span><span class="o">:</span> <span class="mi">2013</span><span class="o">-</span><span class="mi">06</span><span class="o">-</span><span class="mi">06</span> <span class="err">#日期</span>
<span class="n">Title</span><span class="o">:</span> <span class="n">My</span> <span class="n">Super</span> <span class="n">Beginng</span> <span class="err">#标题</span>
<span class="n">Tags</span><span class="o">:</span> <span class="n">Writing</span><span class="o">,</span> <span class="n">Life</span> <span class="err">#标签</span>
<span class="n">Category</span><span class="o">:</span> <span class="n">Life</span> <span class="err">#分类</span>
<span class="err">文章内容</span>
</pre></div>
<h4 id="blogmdhtml">写好之后,回到blog目录,将md文件翻译成html静态页面:<a class="headerlink" href="#blogmdhtml" title="Permanent link">¶</a></h4>
<div class="highlight"><pre><span class="n">cd</span> <span class="p">..</span>
<span class="n">make</span> <span class="n">html</span>
</pre></div>
<h6 id="_2">你还可以用这条命令编译:<a class="headerlink" href="#_2" title="Permanent link">¶</a></h6>
<p><code>pelican content</code></p>
<h4 id="contentgithub">进入content目录,内容上传至github<a class="headerlink" href="#contentgithub" title="Permanent link">¶</a></h4>
<div class="highlight"><pre><span class="n">cd</span> <span class="n">content</span>
<span class="n">git</span> <span class="n">init</span>
<span class="n">git</span> <span class="n">add</span> <span class="p">.</span>
<span class="n">git</span> <span class="n">commit</span> <span class="o">-</span><span class="n">m</span> <span class="s">"first commit"</span>
<span class="n">git</span> <span class="n">remote</span> <span class="n">add</span> <span class="n">origin</span> <span class="n">git</span><span class="err">@</span><span class="n">github</span><span class="p">.</span><span class="n">com</span><span class="o">:</span><span class="n">tulpar008</span><span class="o">/</span><span class="n">tulpar008</span><span class="p">.</span><span class="n">github</span><span class="p">.</span><span class="n">com</span><span class="p">.</span><span class="n">git</span>
<span class="n">git</span> <span class="n">push</span> <span class="o">-</span><span class="n">u</span> <span class="n">origin</span> <span class="n">master</span>
</pre></div>
<hr />
<p>That's all 去访问你的博客吧,<a href="http://tulpar008.github.com">我的</a></p>
<hr />
<h2 id="_3">后续:<a class="headerlink" href="#_3" title="Permanent link">¶</a></h2>
<h3 id="_4">更换主题<a class="headerlink" href="#_4" title="Permanent link">¶</a></h3>
<h4 id="githubpelicanclone">把github上pelican的主题全都clone下来<a class="headerlink" href="#githubpelicanclone" title="Permanent link">¶</a></h4>
<p><code>git clone git://github.com/getpelican/pelican-themes.git</code> <br />
在里面找到一个你喜欢的主题,假如这个主题的目录是 ~/pelican-themes/bootstrap2 ,</p>
<h4 id="pelican-themes">使用pelican-themes安装这个主题<a class="headerlink" href="#pelican-themes" title="Permanent link">¶</a></h4>
<p><code>sudo pelican-themes -i ~/pelican-themes/bootstrap2</code> </p>
<h6 id="pelican-themes_1">随后就可以用pelican-themes查看已安装的主题<a class="headerlink" href="#pelican-themes_1" title="Permanent link">¶</a></h6>
<p><code>pelican-themes --list --verbose</code> </p>
<h4 id="pelicanconfpytheme">要在你的博客中使用安装好的主题,直接在pelicanconf.py文件中修改或者添加THEME项为想要的主题名,例如<a class="headerlink" href="#pelicanconfpytheme" title="Permanent link">¶</a></h4>
<div class="highlight"><pre><span class="n">THEME</span> <span class="o">=</span> <span class="s">"bootstrap2"</span>
</pre></div>
<h4 id="_5">然后执行<a class="headerlink" href="#_5" title="Permanent link">¶</a></h4>
<p><code>make html</code></p>
<aside>
<hr/>
<nav>
<ul class="articles_timeline">
<li class="previous_article">« <a href="http://wbowam.github.io/linux-xiao-ji-qiao-1.html" title="Previous: linux 小技巧(1)">linux 小技巧(1)</a></li>
<li class="next_article"><a href="http://wbowam.github.io/tmux-ru-men.html" title="Next: Tmux 入门">Tmux 入门</a> »</li>
</ul>
</nav>
</aside>
<!-- Duoshuo Comment BEGIN -->
<div class="ds-thread" data-author-key="4433755"></div>
<script type="text/javascript">
var duoshuoQuery = {short_name:"tlbog"};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
ds.src = 'http://static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0]
|| document.getElementsByTagName('body')[0]).appendChild(ds);
})();
</script>
<!-- Duoshuo Comment END -->
</div>
<section>
<div class="span2" style="float:right;font-size:0.9em;">
<h4>Published</h4>
<time pubdate="pubdate" datetime="2013-11-08T00:00:00+08:00">Nov 8, 2013</time>
<h4>Category</h4>
<a class="category-link" href="/categories.html#Life-ref">Life</a>
<h4>Tags</h4>
<ul class="list-of-tags tags-in-article">
<li><a href="/tags.html#博客-ref">博客
<span>2</span>
</a></li>
</ul>
</div>
</section>
</div>
</article>
</div>
<div class="span1"></div>
</div>
</div>
</div>
<footer>
<div id="footer">
<ul class="footer-content">
<li class="elegant-power">Powered by <a href="http://getpelican.com/" title="Pelican Home Page">Pelican</a>. Theme: <a href="http://oncrashreboot.com/pelican-elegant" title="Theme Elegant Home Page">Elegant</a> by <a href="http://oncrashreboot.com" title="Talha Mansoor Home Page">Talha Mansoor</a></li>
</ul>
</div>
</footer> <script src="http://code.jquery.com/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
<script>
function validateForm(query)
{
return (query.length > 0);
}
</script>
</body>
</html>