Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.

1. Install Node.js (mandatory)

  • Click to jump to Node.js Chinese website all the way to the next OK
  • Win +R key enter CMD to open node -v to view the node version

2. Install Git tools (for easier operation)

  • Go to Git’s official website and proceed to the next step

  • How do I check whether the installation is successful

  • Right click on your desktop to present the Git Bash Here option

3. Install the CNPM manager (CNPM saves more time)

  • Use Git tools on your desktop right click Git Bash Here enter the following command NPM install – g CNPM taobao mirror manager – registry=http://registry.npm.taobao.org installation

  • After the installation is successful, run the CNPM -v command to check the CNPM version

4. Get down to business

  • Create a new empty folder on your desktop such as blog

  • Go to the folder (the folder is still empty). Right-click inside the folder. Use Git tool Git Bash Here

  • Run CNPM install -g hexo-cli to install the hexo framework

  • After the installation is successful, run the hexo -v command to check the hexo version. This is to verify the installation

  • Then you type in the command hexo init to generate a blog. This is to initialize a blog. You only need to execute this command once to create a blog

This will take a long time and create a lot of stuff under your file

  •  Execute the commandhexo sThe startup will come out with the local access addresshttp://localhost:4000/

Then you can open your browser and type http://localhost:4000 in the address bar to view the blog system you just built

  •  Then we create our own blog posts  

Every time you change the blog, you must press Ctrl +C in Git tool to clear the last service started. You cannot enter commands until you close the last service started

  • Execute the commandhexo new“My First Post” creates a new post (write your blog post name in quotes)
    • Then after performing the Hexo S launch, go back to your blog and you’ll find an additional post with the title you created above

    • Note that the new blog here ends in.md, also known as Markdown. Markdown is a lightweight “markup language”. This is a simple tutorial on Markdown

Git Bash Here is not turned off. If not, your local address will not be accessible unless you have pushed it to a remote location. There is a remote push method below, no money to buy a server, then we use the free Github ah, access slower but free ah!!

5. Hexo blogging commands (mandatory commands)

  • Git tool Ctrl +C to clear the started service each time update data configuration blog file after pressing the first close the last command can enter a new command is not closed the last command cannot enter

  • Hexo s launches the local service for a local preview

  • Hexo clean Cleans the cache

  • Hexo G generates blogs

  • Hexo d pushes remote warehouses

6. Build a remote repository (so you can access your blog anytime, anywhere)

Githubname.github. IO Note YourGithubName: is the nickname you signed up for GitHub; Note that your repository must end with:.github. IO

  • Configure the _config.yml file in the “blog” directory (the directory where you created the blog folder where all our operations are performed) to locate the “deploy” keyword at the bottom

  

  deploy:
  type: git
  repo: https://github.com/YourGithubName/YourGithubName.github.io.git
  branch: master
Copy the code
  • The last line of the code above needs to be replaced with your Github repository address

  • YourGithubName: Just change your Github repository nickname

  •  Focus: Implementationcnpm install --save hexo-deployer-gitCommand to install the Git deployment plug-in in the blog directory
  • After installationExecute the commandhexo dDeploy to the Github repository
  • Baidu search YourGithubName. Making. IO. Git (YourGithubName: you making warehouse nickname change)

  • If you go in and you see a static page, it’s on Github and it’s not local and you can show it to your friends who don’t understand it. It’s pointless to study hard and not act like a jerk

7. Yilia theme (The default theme is not pretty, simple skin change, hexo plugin is over 300

This is just a simple change of theme, complex manipulation and there are a lot of amazing manipulations in the next three other people’s blogs that I also looked at and messed with

  • I used the Yilia theme here

  • Git clone github.com/litten/hexo…

  • Find the theme keyword in the _config.yml file in the hexo root directory and change it to theme: yilia

  • Follow orders

    • Hexo Clean

    • Generate hexo g

    • Hexo s launches the local http://localhost:4000/ preview and you’ll see the new theme

  • Want to push remote execution hexo d command to deploy to the remote making warehouse, check the address of the remote YourGithubName. Making. IO. Git

 conclusion

  •  After each update of Git, Ctrl+C ends in Hexo s
  •  Hexo s restarts after each change
  •  Hexo clean hexo g hexo d before each push
  •  Viewing a Local Addresshttp://localhost:4000/
  •  Check the address of the remote YourGithubName. Making. IO. Git
  •  YourGithubName YourGithub nickname

 Hexo builds a technology sharing blog

  •  cloudy-liu.github.io/
  •  dongshuyan.com/
  •  joeybling.github.io/