Jekyll Server Setup and Test in Window

Jekyll Server Setup and Test in Window

1 Setup Ruby

Download and install Ruby

Open window cmd and check installation correctly.

$ ruby -v
ruby 2.2.4p230 (2015-12-16 revision 53155) [i386-mingw32]

2 Setup jekyll

Open window cmd and input following command:

$ gem install jekyll

Create a new blog project as follow:

$ cd blogfolder
$ jekyll new testblog 

Go to project folder and start jekyll server:

$ cd testblog
$ jekyll server
Configuration file: D:/Blog/website/testblog/_config.yml
            Source: D:/Blog/website/testblog
       Destination: D:/Blog/website/testblog/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
       Jekyll Feed: Generating feed for posts
                    done in 0.579 seconds.
 Auto-regeneration: enabled for 'D:/Blog/website/testblog'
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.

Open browser and input:

http://localhost:4000/


3 Using Exist Template

Download template and unzip template file. Open window cmd and go into project folder:

$ cd templatefolder

Using Gemfile and Gemfile.lock in section 2 to replace the corresponding files in the templatefolder.

Notice that you should remain the plugins config from original Gemfile, such as:

group :jekyll_plugins do
  gem "jekyll-feed", "~> 0.12"
  gem "jekyll-paginate"
  gem "jekyll-sitemap"
end

Running follow command to run jekyll server:

$ jekyll server

If there are errors like this:

D:/Ruby27-x64/lib/ruby/2.7.0/bundler/spec_set.rb:86:in `block in materialize': Could not find public_suffix-4.0.5 in any of the sources (Bundler::GemNotFound)

Input following command to solve the problem.

$ gem install public_suffix --version 4.0.5

Finally, open http://localhost:4000/ to see the template website.


Tags: Jekyll Vistied:
Share: Twitter Facebook LinkedIn