使用jekyll搭建自己的博客系统

方式一

  1. 在上网下载一款Jekyll主题
  2. 修改配置
  3. 在_posts文件夹内写博客,并推送到自己的github page上去。

方式二

这种方法主要是用来在本地预览效果,这样不用每次写完博客或网页后必须上传到github上才可以看到效果。

  1. 下载Ruby
    在官网下载,安装时将ruby添加到环境变量选项勾选。
  2. 下载Ruby DevKit
    将DevKit解压到需要的路径,然后打开命令行进入到这个目录执行如下命令
    cd 解压目录
    ruby dk.rb init
    ruby dk.rb install
    #官方源不可用
    gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/
    gem install jekyll

gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/ 应为ssl无法通过的话,可以使用http协议。 3. 下载主题
4. 预览效果
jekyll --server --auto
http://localhost:4000 预览

以下是本人安装过程中遇到的问题:
Jekyll 3x版本使用主题时,在配置_config.yml时,

    markdown: redcarpet
    redcarpet:
    extensions:
        - hard_wrap
        - no_intra_emphasis
        - autolink
        - strikethrough
        - tables
        - lax_spacing
        - with_toc_data

改变为

    markdown: kramdown
    kramdown:
    input: GFM
    extensions:
        - autolink
        - footnotes
        - smart
        - hard_wrap
        - no_intra_emphasis
        - strikethrough
        - tables
        - lax_spacing
        - with_toc_data
    enable_coderay: true
    syntax_highlighter: rouge
    coderay:
        coderay_line_numbers:  nil

参考链接

  1. Jekyll官方教程
  2. ruby镜像
  3. 参考的博客
  4. Jekyll主题

转载于:https://my.oschina.net/abely/blog/699315

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值