最新消息:专注互联网,专注前端,多分享,多学习!

本地运行Bootstrap例子文档,jeklly

  1. If necessary, install Jekyll (requires v1.5.x).
  • Windows users: Read this unofficial guide to get Jekyll up and running without problems. We use Pygments for syntax highlighting, so make sure to read the sections on installing Python and Pygments.
  1. From the root /bootstrap directory, run jekyll serve in the command line.
  2. Open http://localhost:9001 in your browser, and voilà.

Learn more about using Jekyll by reading its documentation

===============================中文=========================

1.在windows下安装jeklly

为了解决在windows下安装jeklly的繁琐步骤和繁重的工作,在这里我推荐直接采用Madhur Ahuja的portable Jekyll。(http://www.madhur.co.in/blog/2013/07/20/buildportablejekyll.html )下载完成后直接解压到任意路径即可。在管理员CMD下进入解压的portable Jekyll所对应的路径运行setpath.cmd即可。如果喜欢一步一步折腾安装的同学,这里也有方法可供参考。( http://www.madhur.co.in/blog/2011/09/01/runningjekyllwindows.html )

2.在jeklly中运行bootstrap 3.X

根据官方文档( https://github.com/twbs/bootstrap#documentation ),进入bootstrap解压的根目录,然后输入命令jeklly serve;此时会出现一个错误。如下图所示。Deprecation: The ‘pygments’ configuration option has been renamed to ‘highlighter’. Please update your config file accordingly. The allowed values are ‘rouge’, ‘pygments’ or null.  Generating…Liquid Exception: Failed to get header. in components.html

20140606121551828

其实出现这个问题与Failed to get header无关,也就是说这根本就不是版本什么的不兼容的问题,而是我们下载下来的bootstrap的 _config.yml 配置文件的问题。在出现这个错误要么就是版本问题,要么就是配置文件的问题,经过多方Google之后,这个问题是由于一个语法高亮的插件(pygments.rb)引起的,导致编译错误。只需要在bootstrap文档中找到_config.yml,然后将其中的pygments: true修改为highlighter: pygments即可。然后即可正常运行jekyll serve

3.在浏览器中浏览bootstrap文档

20140606122721187

同样,_config.yml也定义了预览地址和端口。默认的端口为9001。我们直接在浏览器中输入 http://localhost:9001 即可预览。

转载请注明:圆点网 » 本地运行Bootstrap例子文档,jeklly

与本文相关文章

网友评论

  1. 我也是醉了

    太古神王2015-05-06 18:01