Giter Club home page Giter Club logo

linbojin.github.io's Introduction

Build blog with Hexo and MWeb

My blog: https://linbojin.github.io/

Requirements

  • Github account: blog deployed by GitHub Pages
  • Hexo: blog framework to generate static blog files
  • MWeb: Markdown writing tool

Setup Github

  1. Create a new repository named username.github.io
  2. https://username.github.io will be your personal blog address

Setup Hexo

Make sure you have installed node.js and git.

$ npm install -g hexo-cli
$ hexo init blog    
$ cd blog
$ hexo new "my first blog"

Setup MWeb

  1. Install MWeb in App Store
  2. Lauch MWeb and go into External Mode (Command + E)
  3. Add new external source: {blog}/source, and choose Media Save Path as Absolute
  4. Enjoy writing

Deploy Blog

  1. Install hexo-deployer-git

    $ npm install hexo-deployer-git --save
  2. Edit {blog}/_config.yml

    $ vim _config.yml
    
    # Deployment
    deploy:
      type: git
      repo: [email protected]:username/username.github.io.git
      branch: master
  3. Deploy after you make any changes and go to your blog https://username.github.io

    $ hexo deploy -g
  4. You can also test local: http://0.0.0.0:4000/

    $ hexo server

Tips

  1. Back up source folder and add version control: markdown source files will be inside {blog}/source and this folder will not be tracked by git. So I sync this important folder to cloud:

    $ cp -r {blog}/source {Dropbox}/blog/source
    $ vim _config.yml # point source_dir to the new synced path  
    	
    # Directory
    source_dir: {Dropbox}/blog/source
  2. Add README.md to repo: create README.md inside {source} folder and modify {blog}/_config.yml, so that README.md can introduce your repo on github like this one:

    $ vim _config.yml
    	
    # Directory
    skip_render: README.md

Congratulations, Enjoy your blog ^-^


Ref: Hexo, MWeb for Octpress

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.