A sentence A picture A day!

OctopressTips

很久没用Octopress写作了,原本熟悉的命令记不清:(

回归“像黑客一样写作”的战地

创建文章

进入octopress文件夹

1
2
cd octopress
rake new_post["My bolg"]

如果执行后遇到“rake aborted! You have already activated rake 10.1.1, but your Gemfile requires rake 0.9.6. Using bundle exec may solve this.”这样的问题,是因为你安装的版本和octopress所用的不符。 * 你可以按照提示在命令钱直接加bundle exec * 如果不想每次都多敲,就更改一下Gemfile的内容吧:我是把 gem ‘rake’, ‘~> 0.9’ 改成了’10.0’ 此时进入source目录下的_posts文件夹会生成新建的文章,使用文本编辑器打开进行内容的修改

文章写完后(有中文需要保存成UTF-8格式)

保存文件生成预览

1
2
rake generate
rake preview

浏览器中输入http://localhost:4000/ 可查看预览

//创建一个新的页面也与此类似 rake new_page[yummy]

部署到Github上去

1
rake deploy

一些关于octopress的设置可以修改 _config.yml文件内容

推荐一个编辑的网站 https://stackedit.io/ 个人很喜欢