-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUsing Jekyll and Github to Blog.html
222 lines (213 loc) · 12.6 KB
/
Using Jekyll and Github to Blog.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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Using Jekyll and Github to Blog v0.1 (Failed)</title>
<link rel="stylesheet" href="/theme/css/main.css" />
<!--[if IE]>
<script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body id="index" class="home">
<a href="https://github.com/we-taper">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub" />
</a>
<header id="banner" class="body">
<h1><a href="/">A Blog <strong>about coding & physics</strong></a></h1>
<nav><ul>
<li><a href="/pages/who-am-i.html">Who am I?</a></li>
<li class="active"><a href="/category/blogging.html">Blogging</a></li>
<li><a href="/category/many-boby-physics.html">Many Boby Physics</a></li>
<li><a href="/category/misc-course-notes.html">Misc Course Notes</a></li>
<li><a href="/category/programming.html">Programming</a></li>
</ul></nav>
</header><!-- /#banner -->
<section id="content" class="body">
<article>
<header>
<h1 class="entry-title">
<a href="/Using Jekyll and Github to Blog.html" rel="bookmark"
title="Permalink to Using Jekyll and Github to Blog v0.1 (Failed)">Using Jekyll and Github to Blog v0.1 (Failed)</a></h1>
</header>
<div class="entry-content">
<footer class="post-info">
<abbr class="published" title="2014-02-21T14:00:00+08:00">
Published: 周五 21 二月 2014
</abbr>
<address class="vcard author">
By <a class="url fn" href="/author/wetaper.html">we.taper</a>
</address>
<p>In <a href="/category/blogging.html">Blogging</a>.</p>
<p>tags: <a href="/tag/jykell.html">Jykell</a> <a href="/tag/unpolished.html">unPolished</a> </p>
</footer><!-- /.post-info --> <h1>Using Jekyll and Github to Blog v0.1 (Failed)</h1>
<p><strong>Note :</strong><br />
At last, i got myself furious by using Jykell. Ruby and Python's Pygments modulus
just don't work with each other. And installing these softwares on windows is just
another nightmare for me. If you are a windows user, I sincerely advise you stop
trying Jekyll now! Another option is: Pelican!<br />
If you really want to continue, please do refer to my recommended blogs and websites
before you start rock, especially the <a href="https://github.com/juthilo/run-jekyll-on-windows/#install-the-jekyll-gem">official guide</a></p>
<h2>What??</h2>
<p>Jekyll is a static website generator. Github Page is a service provided by github.com which hosts user-uploaded static websites and display them, for <strong>free</strong>! This two combined - <strong>A Free Web blog host under perfect control</strong>. (Note: Everything on Github is open unless you purchase some plans. So there is no privacy concerns - You simply don't put private content on it!)</p>
<p>Github officially support Jykell. Everything hosted on Github Pages will be processed by Jykell. Since standard HTML files is also Jykell capable, you can use Github Pages without Jykell of course.</p>
<p><em>Note :</em> </p>
<p>This is a hardcore, time-consuming task which require much patience and time. Never try this if you are not a geek.</p>
<p><em>Note 2:</em> </p>
<p>Because I want to blog something but is tired of using existing blog services, I searched for a bit and find Jekyll
as well as Hyde. They are both "static webpage generator" (See: <a href="https://github.com/hyde/hyde">Wikipedia Static Webpage</a>). Jekyll is based on Ruby while Hyde is based on python. There are two excellent articles comparing these two engines: 1.<a href="http://www.distractable.net/tech/static-site-generators-jekyll-vs-hyde">Static Website Generators - Jekyll vs Hyde</a>, and 2.<a href="http://philipm.at/2011/jekyll_vs_hyde.html">Jekyll vs. Hyde - A Comparison Of Two Static Site Generators</a> (Both stored in my Evernote for backup). </p>
<p>I choosed Jekyll because: </p>
<ol>
<li>It is under active development, the <a href="https://github.com/jekyll/jekyll">Github Jekyll</a> has many recent commits just days ago. The last commit of Hyde is somewhat 6 months ago! </li>
<li>There are many default templetes that I can simply <code>git clone xxx</code> to use for Jykell. As for Hyde, few were found. </li>
<li>Author of Jekyll is also co-founder of Github! Therefore the future maintenance is guaranteed. </li>
</ol>
<h2>Pre-requirements (Important)</h2>
<ol>
<li>
<p>Installed Ruby<br />
For simplicity, I choosed <a href="http://rubyinstaller.org">RubyInstaller</a> to install Ruby on my Windows. Once installed, you will got a powerful tool: <code>gem</code> to install ruby modulus.</p>
<ul>
<li>
<p>Switch <strong>gem</strong> Source to <em>http://ruby.taobao.org/</em> to improve downloading speed. <br />
See: <a href="http://ruby.taobao.org/">RubyGems 镜像 - 淘宝网</a> for more.</p>
</li>
<li>
<p>Installed DevKit
Otherwise you can't just install Jykell with bundle (see below). See <a href="https://github.com/oneclick/rubyinstaller/wiki/Development-Kit">Github DevKit</a>.</p>
</li>
</ul>
</li>
<li>
<p>Installed Python<br />
Compared with Ruby, installing python on windows is just simple. As for Linux and Mac, they already have python come within system. See: <a href="http://www.python.org/download/">Python Download</a></p>
</li>
</ol>
<h2>Let's Rock</h2>
<ol>
<li>
<p>Installed Bundler<br />
Yet another ruby modulus installation tool. Recommended on <a href="https://help.github.com/articles/using-jekyll-with-pages#installing-jekyll">Github Official help</a>. It said,<em>"You can still install Jekyll with the command gem install github-pages, but you may run into trouble down the line."</em>, But I haven't tried that.
Follow the tips on <a href="https://help.github.com/articles/using-jekyll-with-pages#installing-jekyll">Github Official help</a>.</p>
</li>
<li>
<p>Install Jekyll with Bundler<br />
Just folow tips on <a href="https://help.github.com/articles/using-jekyll-with-pages#installing-jekyll">Github Official help</a>. Becareful that your should <code>cd</code> into the directory where the <code>Gemfile</code> exists, or you will always get a <code>Bundler::GemfileNotFound</code> error. Also, remember to change the source to ruby.taobao.org as mentioned in <strong>Pre-requirements</strong>.</p>
</li>
<li>
<p>Install easy_install and Pygments
Using the right python (2.7.x) and install Pygments through easy_install scripts.
See <a href="https://pypi.python.org/pypi/setuptools#windows">Link 1</a> to install easy_install and find easy_install inside python
installation directory (usually under folder "Scripts"), run <code>easy_install Pygments</code>.</p>
</li>
<li>
<p>Cook the Git Book<br />
Learn about git from <a href="http://git-scm.com/book/en/">Git Guide</a>, I also wrote an article about it: <a href="/git-book-note.html">My Git Guide</a>
<!-- Here is a internal link to Git Book Note.md --> </p>
</li>
<li>
<p>Clone others' work<br />
Well, My time is limited (I've already spent a whole day on it). And open source is fascinating. Why not copy?</p>
<p>Some personal recommendations:<br />
1. <a href="https://github.com/JeremyWei/jeremywei.github.com">https://github.com/JeremyWei/jeremywei.github.com</a>
2. <a href="http://www.madhur.co.in">http://www.madhur.co.in</a></p>
<p>A really good List of Websites build on Jekyll:<a href="https://github.com/jekyll/jekyll/wiki/Sites">Jekyll Sites</a></p>
</li>
</ol>
<h2>Some Notes to solve problems:</h2>
<p><strong>Note :</strong> The error message below have been simplified to save space. Watch your error output carefully, perhaps mine solution applies to your too!</p>
<ul>
<li>
<p>Error: <code>... fileutils.rb:247:in</code>mkdir': Invalid argument ...` </p>
<p>Problem: The new versioin of jekyll (>1.4.2) isn't stable enough! Downgrade!<br />
Solution:
gem uninstall jekyll<br />
gem install jekyll --version "=1.4.2"<br />
See: <a href="http://stackoverflow.com/questions/21137096/jekyll-error-running-jekyll-serve">StackOverflow Ask</a></p>
</li>
<li>
<p>Error: <code>Liquid Exception: Failed to get header. in xxx.markdown</code> <br />
or <code>spawn.rb:162: warning: cannot close fd before spawn</code></p>
<p>Problem: </p>
<ol>
<li>The new version of pygments.rb (>0.5.0) doesn't cooperate with this Jekyll. Downgrade!<br />
Note: According the official guide (<a href="https://github.com/juthilo/run-jekyll-on-windows/#install-the-jekyll-gem">Link</a>), version 0.5.0 and o.5.4 are OK.</li>
<li>The new Python 3 don't work with Jekyll. Use Python 2.7.5.</li>
</ol>
<p>Solution:
1.
gem uninstall pygments.rb<br />
gem install pygments.rb --version "=0.5.0"<br />
2. Install Python 2.7.x (remember to install Pygments later)<br />
You can with both 2.7.x and 3.x version installed but use %PATH% environment to change the default python intepretor. Google about "Changing Path on Windows"</p>
<p>See: <a href="http://stackoverflow.com/questions/17364028/jekyll-on-windows-pygments-not-working">Jekyll on Windows: Pygments not working</a></p>
</li>
<li>
<p>Note: Do not install Ruby in a complicated path including characters like "(", ")", etc. I got errors when doing so. Instead installing to the default "X:\Rubyxx\" is OK.</p>
</li>
</ul>
<h2>Some Good Articles to help you smooth through this process:</h2>
<h1>Resources</h1>
<ol>
<li>
<p>A blog by 阮一峰<a href="http://www.ruanyifeng.com/blog/2012/08/blogging_with_jekyll.html">搭建一个免费的,无限流量的Blog----github Pages和Jekyll入门</a><br />
Contains much about how to setup standard Jekyll websites. Good for those who want to hack the Websites themselves.</p>
</li>
<li>
<p>A blog teaches installing Jykell on Windows:<a href="http://www.madhur.co.in/blog/2011/09/01/runningjekyllwindows.html">Running Jekyll on Windows</a></p>
</li>
<li>
<p>A comprehensive tutor to run Jykell on Windows (also Official): <a href="https://github.com/juthilo/run-jekyll-on-windows/#install-the-jekyll-gem">How to Run Jekyll on Windows</a>
<strong>Recommended!</strong></p>
</li>
<li>
<p><a href="http://site.douban.com/196781/widget/notes/12161495/note/264946576/">写作环境搭建(git+github+markdown+jekyll)</a></p>
</li>
<li>
<p><a href="http://beiyuu.com/github-pages/">使用Github Pages建独立博客</a></p>
</li>
<li>
<p><a href="http://blog.skydark.info/programming/2012/03/23/play-with-jekyll/">Play with Jekyll</a></p>
</li>
<li>
<p><a href="http://www.cnblogs.com/yevon/p/3310857.html">完善本地搭建的jekyll环境(Windows)</a>
<strong>Recommended!</strong></p>
</li>
<li>
<p><a href="http://www.cnblogs.com/aleda/articles/Jekyll-in-Windows-following-Chinese-encoding-problem-solutions.html">Jekyll在Windows下面中文编码问题解决方案</a></p>
</li>
</ol>
</div><!-- /.entry-content -->
</article>
</section>
<section id="extras" class="body">
<div class="blogroll">
<h2>blogroll</h2>
<ul>
<li><a href="http://getpelican.com/">Pelican</a></li>
<li><a href="http://ovelinux.blog.sohu.com/">My Previous Blog</a></li>
</ul>
</div><!-- /.blogroll -->
<div class="social">
<h2>social</h2>
<ul>
<li><a href="we.taper[WhateverInsideIsUseless]gmail.com">My E-Mail (Don't click, copy link and alter it to correct form, thx)</a></li>
</ul>
</div><!-- /.social -->
</section><!-- /#extras -->
<footer id="contentinfo" class="body">
<address id="about" class="vcard body">
Proudly powered by <a href="http://getpelican.com/">Pelican</a>, which takes great advantage of <a href="http://python.org">Python</a>.
</address><!-- /#about -->
<p>The theme is by <a href="http://coding.smashingmagazine.com/2009/08/04/designing-a-html-5-layout-from-scratch/">Smashing Magazine</a>, thanks!</p>
</footer><!-- /#contentinfo -->
<script type="text/javascript">
var disqus_shortname = 'taper';
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = 'https://' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
</body>
</html>