简介
Jekyll 一个静态博客网站生成器,方便展示自己的内容,支持 Markdown 标记语言,其也可以在 GitHub Page 上运行,并且完全免费。FEALPy 的主页就是基于 Jeklly 来搭建的。
安装
-
用 apt 命令安装相应的依赖
$ sudo apt install ruby-full build-essential zlib1g-dev
-
将 ruby 的环境变量信息添加到
~/.bashrc
中$ echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc $ echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc $ echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc $ source ~/.bashrc
-
通过
gem
安装jekyll
$ gem install jekyll bundler $ gem update --system
使用
以FEALPy为例,进入 fealpy/docs
文件中,利用 bundle
安装静态网站的相应的依赖
$ cd fealpy/docs
$ bundle install
运行本地 jekyll
网站服务
$ bundle exec jekyll serve
Configuration file: /home/why/git/fealpy/docs/_config.yml
Source: /home/why/git/fealpy/docs
Destination: /home/why/git/fealpy/docs/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
done in 1.579 seconds.
Auto-regeneration: enabled for '/home/why/git/fealpy/docs'
Server address: http://127.0.0.1:4000
Server running... press ctrl-c to stop.
打开输出信息中的网址 http://127.0.0.1:4000
, 即看在你的浏览器中浏览生成的网站.