Giter Club home page Giter Club logo

jaxvanyang.github.io's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.