From 0 to build personal blog site (a)

EDITORIAL

I programmed a white, students in reading, always wanted to set up your own blog site, pulled out a little time last week, referring to the video sheep brother taught you from zero to build their own personal blog | pit-free version of the video tutorial | hexo great God and tutorials from various quarters, set up their own blog site https://trace001.gitee.io phased recorded here about the whole process of building

introduce

Built environment

Built environment is window10, blog framework using Hexo

Hexo official introduction

Hexo is a fast, simple and efficient framework blog. Hexo use Markdown (or other rendering engine) analytical articles, in a few seconds, you can use beautiful themes to generate static pages.

Hexo blog local deployment

First installation environment

Installation node.js

From 0 to build personal blog site (a)
Author started going to the official website download speed is really slow, then go here to download , fast thief. Internet can also be seen in Taobao Node.js mirror Download
fool to install, operate after a meal, you can see the following pages
From 0 to build personal blog site (a)
you can see the installation of node.js and npm

Install git

From 0 to build personal blog site (a)

Installation hexo

  • Create a new folder eg: blog Open the folder click of a mouse right-click in the blank space, choose git bash here look just installed node.js and npm version: node -v (version of node.js) npm -v (package Manager version)
    From 0 to build personal blog site (a)

  • Install a cnpm to increase speed

    npm install -g cnpm --registry=https://registry.npm.taobao.org

    Verify that the installation was successful:cnpm
    From 0 to build personal blog site (a)

    • Installation hexo

      cnpm install -g hexo-cli

      Verify that the installation was successful: hexo -v
      From 0 to build personal blog site (a)

    • Establishment of project: hexo init
      From 0 to build personal blog site (a)
      After the completion of the new, specify the directory folder is as follows:
      .
      ├── _config.yml
      ├── package.json
      ├── scaffolds
      ├── source
      |   ├── _drafts
      |   └── _posts
      └── themes
  • _config.yml
    website configuration information, you can configure most of the parameters here.
  • package.json
    information about the application. EJS, Stylus and Markdown renderer is installed by default, you are free to remove.
    package.json
    {
    "name": "hexo-site",
    "version": "0.0.0",
    "private": true,
    "hexo": {
    "version": ""
    },
    "dependencies": {
    "hexo": "^3.8.0",
    "hexo-generator-archive": "^0.1.5",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-index": "^0.2.1",
    "hexo-generator-tag": "^0.2.0",
    "hexo-renderer-ejs": "^0.3.1",
    "hexo-renderer-stylus": "^0.3.3",
    "hexo-renderer-marked": "^0.3.2",
    "hexo-server": "^0.3.3"
    }
    }
  • scaffolds
    template folder. When you create a new article, Hexo file will be established according to scaffold.
    Hexo default template is content filled in the new article file. For example, if you modify the Front-matter content scaffold / post.md in, then each time a new article will contain this modification.
  • source
    resource folder is a place to store user resources. In addition to outside posts folder, beginning named (underscore) files / folders and hidden files will be ignored. Markdown and HTML files are parsed and placed in public folders, and other files will be copied in the past.
  • themes
    themes folder. Hexo will generate static pages by topic.

    Several command

    1. hexo clean # to clear the cache
    2. hexo g # Makefile
    3. hexo s # running a local server
    4. hexo d # uploaded onto its service
      running on the local server: hexo s
      From 0 to build personal blog site (a)
      browser type: localhost:4000
      From 0 to build personal blog site (a)
      local environment successful deployment

Guess you like

Origin blog.51cto.com/13646338/2484374
Recommended