jaxvanyang / jaxvanyang.github.io

Just Call Me Jax

Home Page:https://jaxvanyang.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Just Call Me Jax

This is the repository for my blog. There is also a comment repository for my blog.

Configure Dev Environment

  1. Install Ruby and other prerequisites:

    # Ubuntu
    sudo apt install ruby-full build-essential zlib1g-dev
    # ArchLinux
    sudo pacman -S --needed ruby base-devel
  2. Configure RubyGems packages(called gems) to be installed in a folder under your home directory:

    echo '# Install Ruby Gems to ~/.gems' >> ~/.bashrc
    echo 'export GEM_HOME="$HOME/.gems"' >> ~/.bashrc
    echo 'export PATH="$HOME/.gems/bin:$PATH"' >> ~/.bashrc
    source ~/.bashrc

    or manually write the following lines in your .bashrc(or .zshrc, etc) file and execute source ~/.bashrc:

    # Install Ruby Gems to ~/.gems
    export GEM_HOME="$HOME/.gems"
    export PATH="$HOME/.gems/bin:$PATH"
  3. 更改 RubyGems 为国内镜像源:

    gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
    
    # 更改 bundle 的源代码镜像(安装完 bundler 后再执行)
    bundle config mirror.https://rubygems.org https://gems.ruby-china.com

    确保只有 gems.ruby-china.com

    $ gem sources -l
    https://gems.ruby-china.com
  4. Install Jekyll and Bundler(they are gems):

    gem install jekyll bundler

    If you use Ruby 3.0(maybe you use ArchLinux), you may see the following WARNING:

    WARNING:  You don't have /home/jax/.local/share/gem/ruby/3.0.0/bin in your PATH,
          gem executables will not run.

    Then just add it to your PATH:

    # ~/.bashrc
    export PATH="$HOME/.local/share/gem/ruby/3.0.0/bin:$PATH"
  5. Add webrick if you use Ruby 3.0 or later:

    gem add webrick

Quick Setup

  1. Create an empty directory or use an existing one:

    mkdir -p ~/blog
    cd ~/blog
  2. Initialize a new Jekyll site in an empty directory:

    jekyll new .

    or use an existing directory:

    jekyll new . --force
  3. Test your site:

    bundle exec jekyll serve

    here is a frequently used variant:

    bundle exec jekyll serve --drafts --incremental
  4. Look around your site directory:

    $ ls -l
    404.html  Gemfile  Gemfile.lock  README.md  _config.yml  _posts  _site  about.markdown  index.markdown

Blogging

  1. Check out this first: https://jekyllrb.com/docs/step-by-step/08-blogging/

  2. Create new posts in /_posts under your site directory.

Deploy on GitHub Pages

  1. Create a new empty repository on GitHub:

    create a new empty repository

  2. Initialize the local repository and push it to Github:

    git init
    git add .
    git commit -m "first commit"
    git branch -M main
    git remote add origin <your_repo_url>
    git push -u origin main
  3. Activate Github Pages

    activate GitHub Pages

Reference

Image Source

Special thanks for Unsplash and its uploaders <3

About

Just Call Me Jax

https://jaxvanyang.github.io/

License:MIT License


Languages

Language:Ruby 48.8%Language:HTML 26.5%Language:Makefile 9.4%Language:SCSS 7.8%Language:JavaScript 7.6%