What
Jekyll is a static site generator written in Ruby, so the things we need to set up: ruby, RubyGems(package manager for ruby), Jekyll.
How
-
Download and install a Ruby+Devkit version from RubyInstaller Downloads. Use default options for installation.
And as the official Jekyll tutorial said, “Run the ridk install step on the last stage of the installation wizard. This is needed for installing gems with native extensions”.
- First make sure everything is ok.
gem -v # my version is 3.3.26
Open a new command prompt window, if you are in China, change the sources before gem install.
gem sources --remove https://rubygems.org/ #this url can not be reached, and it should be removed, only leave usable url in sources gem sources --add https://gems.ruby-china.com/ gem sources -l #check
- Install jekyll and necessary plugins.
Bundler provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed. Bundler can be a great tool to use with Jekyll.
Open a new cmd window as Administrator.
gem install jekyll bundler jekyll-paginate jekyll -v #check if it's installed bundler -v
- Start a new project(still in the cmd window as Administrator).
jekyll new yourprojectname
You can now write your own blog website, or just download the blog repository you like from Github then change it according to your needs.
- The directory tree of the jekyll project:
- _data (contents of navigation is stored in data files under this directory)
- _includes (html codes that can be included in layouts)
- _layouts (html files to design the layouts of website pages)
- _posts (where you create new posts, remember name them as the pattern of
permalink:
you define in _config.yml) - _sass (saas if an extension of css in jekyll)
- _site (generated after you first run
jekyll build
orjekyll serve
, they are html files for posts written in markdown files) - assests
- css
- images
- script
- pages (static pages of the website)
- _config.yml (website settings file)
- Gemfile (add all plugins you want to install here, don’t forget change the source according step 2 mentioned before if you’re in China)
- Gemfile.lock(generated after you use run
bundle install
to install the ) - index.html (Home page html)
-
Learn how to change the default website to what you like, read this official tutorial, it’s very detailed and clear.
- Make it work.
bundle exec jekyll build #build the website, and generate html files for posts written in markdown files bundle exec jekyll serve #make the website run in local(http://localhost:4000); "jekyll build" is a part of it
- Upload to Github
- create a new repository with the name “yourgithubname.github.io”
- open a git bash window in you local project, then:
git init git branch -M main git remote add origin git@github.com:areen-c/deep_learning_notes_fr.git git add . git commit -m "init" git push origin main
- Done!