JekyII Content Generate(1)Installation and Introduction

阅读更多
JekyII Content Generate(1)Installation and Introduction

Check ruby version and other tools on my MAC
> ruby -v
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]

> gem -v
2.5.2.3


> gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1


> g++ -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1

> make -v
GNU Make 3.81

https://jekyllrb.com/docs/installation/macos/

Installation
> xcode-select --install
I already have that

> sudo gem install bundler
> sudo gem install jekyll

Exception
ERROR:  Error installing jekyll:
ERROR: Failed to build gem native extension.

Solution:
https://github.com/jekyll/jekyll-help/issues/209
https://stackoverflow.com/questions/10725767/error-installing-jekyll-native-extension-build
People are saying xcode and Xcode-select —install will fix that. But it does not work for me. I will directly try that in Ubuntu.

https://jekyllrb.com/docs/installation/ubuntu/

> sudo apt-get install build-essential
> sudo apt-get install ruby-full

Check the Path
> vi ~/.profile
export GEM_HOME="$HOME/gems"
export PATH="$HOME/gems/bin:$PATH"

> gem -v
2.5.2.1

> ruby -v
ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]

> make -v
GNU Make 4.1

> g++ -v
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10)

> gcc -v
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10)

> sudo gem install bundler
> sudo gem install jekyll

Once the installation is done. Let’s try.

Create a project
> jekyll new myblog

Start the service
> bundle exec jekyll serve
Then you can visit this URL
http://127.0.0.1:4000/

Change the configuration file _config.yml
host: 0.0.0.0

Start again,
>bundle exec jekyll serve

Then. We can use
http://ubuntu-master:4000/

Under the _post directory, I can copy and write a similar blog files
> cat 2018-12-03-java-blog.markdown
---
layout: post
title:  "Java Blog!"
date:   2018-12-03 18:00:58 -0600
categories: java
---
Hello, I will write some java codes and blog here.

In the root directory
> jekyll serve

We can see the changes in the simple HTTP server.

Command to generate to _site
> jekyll build

More configuration
https://jekyllrb.com/docs/configuration/default/

That is useful and clean. But you need to understand the formats and provide the data in markdown format in _post directory.

References:
https://github.com/jekyll/jekyll
https://jekyllrb.com/
https://www.cnblogs.com/baiyangcao/p/jekyll_basic.html




你可能感兴趣的:(JekyII Content Generate(1)Installation and Introduction)