受《像黑客一样写博客》的启发和《像黑客一样写博客——Jekyll入门》的技术指导,打算把bioops迁移到github上。不怎么懂github和jekyll。搞了半天,基本上follow jekyllbootstrap上的文档。模版用make-reid;代码高亮用google-code-prettify;参照Markdown语法说明开始写博客。暂不打算整站迁移,先练练手。
补充:github+jekyll太nerdy了。现在的处理办法是两个都保留,但github只发原创,欢迎访问(RSS)。
大部分时间在折腾这个代码高亮,走了很多弯路,现将最后简易可行的方法记录如下:
- 在
/_includes/themes/mark-reid/default.html
中的</head>
前加入
<body>
tag中加入onload="prettyPrint()"
<pre class="prettyprint">...</pre>
标识高亮另外,按照jekyll wiki上迁移wordpress文档的时候在安装mysqlplus会报错
ERROR: Error installing mysqlplus: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.rb checking for mysql_query() in -lmysqlclient... no checking for main() in -lm... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lz... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lsocket... no checking for mysql_query() in -lmysqlclient... no checking for main() in -lnsl... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lmygcc... no checking for mysql_query() in -lmysqlclient... no *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/bin/ruby1.8 --with-mysql-config --without-mysql-config --with-mysql-dir --without-mysql-dir --with-mysql-include --without-mysql-include=${mysql-dir}/include --with-mysql-lib --without-mysql-lib=${mysql-dir}/lib --with-mysqlclientlib --without-mysqlclientlib --with-mlib --without-mlib --with-mysqlclientlib --without-mysqlclientlib --with-zlib --without-zlib --with-mysqlclientlib --without-mysqlclientlib --with-socketlib --without-socketlib --with-mysqlclientlib --without-mysqlclientlib --with-nsllib --without-nsllib --with-mysqlclientlib --without-mysqlclientlib --with-mygcclib --without-mygcclib --with-mysqlclientlib --without-mysqlclientlib Gem files will remain installed in /var/lib/gems/1.8/gems/mysqlplus-0.1.2 for inspection. Results logged to /var/lib/gems/1.8/gems/mysqlplus-0.1.2/ext/gem_make.out
解决办法参照https://github.com/lorensr/mysqlplus/tree/及自己琢磨:
sudo apt-get install libmysql++-dev sudo gem install hpricot转换成功后生成的是html文件,并且换行符显示的是^M(dos下的回车符),为了让转换后的文章正确分段,可先将html后缀变成md,然后批量去掉^M
rename -v s/\.html/\.md/ * dos2unix *.md