Technology Blog address: DoubleDragon’s Blog Project file address: github.com/wsl2ls/Wsl2…

directory

First, build the environment

4. Deploy local blogs to Github. 5. Create new blog posts

First, build the environment

1. Download and install Node.js and Git
  • Node.js: where to download node.js
  • Git: Use the command line$ brew install gitTo install orClick here to download the installer

Auxiliary commands:

$sudo NPM cache clean -f '* Install n to manage node versions: '$sudo NPM install -g n' * Install the latest version of Node: '$sudo n stable' * Check the current git version: '$git --version'Copy the code
Install Hexo using NPM
  • $ npm install hexo-deployer-git –save
  • $hexo version # Check the version of hexo

Second, Hexo creates a local blog

/Users/yourname/wsl.github. IO/wsl.github. You can then deploy the local environment from the command line and preview the local blog in your browser.

IO // Create a local blog $CD wsl.github. IO // enter the blog directory $hexo clean // clear the cache $hexo g // hexo generate regenerate code $ Hexo s // Hexo Server is deployed locally, then open a browser and visit localhost:4000 to see the effectCopy the code

Run the following command to generate a static page to the public directory, enable the preview access port (default port 4000, ‘CTRL + C’ to close server), open the browser to visit http://localhost:4000 to preview the default blog theme

Hexo g // hexo generate generate code hexo s // Hexo server deployed locally, Then open your browser and visit localhost:4000 to see the effectCopy the code

Third, set your favorite blog theme

The default theme for my new blog is landscape, I don’t want to use that, let’s change it

Get your favorite theme first, of course. Collection of topics.

  • Download the theme using the following command line or manually go to github.com/iissnan/hex… Download it, and then put it in the wsl.github. IO /themes directory
CD WSL. Making. IO / / into the git clone https://github.com/iissnan/hexo-theme-next themes/next blog directoryCopy the code


Note: the colon: must be followed by a space in the configuration file, otherwise invalid, an error is reported.

  • Blog configuration: Open the _config.yml file in the wsl.github. IO file with a text editor and modify the internal parameters.
title: DoubleDragon's Blog subtitle: Rome was not built in one day. Study hard and make progress every day. description: ※ wechat official account: iOS2679114653 ※ QQ: 1685527540 author: and line and value _iOS language: Post_asset_folder: true # Set the theme: Next deploy: type: git repository: https://github.com/wsl2ls/Wsl2Ls.github.io.git brachanc: master # this line need to add, for the blog head avatar: "Https://upload.jianshu.io/collections/images/1661007/ Emma Watson. Jpeg? ImageMogr2 / auto - received/strip | imageView2/1 / w / 240 / h / 240"Copy the code
  • The topic configuration: using a text editor open the WSL. Making. IO/themes/next directory _config. Yml file, modify the internal parameters.

For parameter description and detailed Settings, see theme-next.iissnan.com/getting-sta…

  • After the configuration is complete, run the following command to preview the blog:
Hexo g // hexo generate generate code hexo s // Hexo server deployed locally, Then open your browser and visit localhost:4000 to see the effectCopy the code

4. Deploy local blogs to Github

Create a new project wsl2ls.github. IO. The project name must be username.github

2. Click Settings, create a page, select a theme, and immediately overwrite it with our local theme.

3. Deploy our Hexo code on Github
  • First open the _config.yml file in the wsl.github. IO file with a text editor, modify the internal parameters of the blog, and then save.
Deploy: type: git repository: / / https://github.com/wsl2ls/Wsl2Ls.github.io.git to the new project brachanc: masterCopy the code
  • Deploy to Github by command
NPM install hexo-deployer-git --save // hexo d // hexo deploy to GithubCopy the code

4. After the deployment is complete, open the browserwsl2ls.github.ioCheck the effect.

Five, new blog posts

Now that the local blog environment is configured, it’s time to create a new post. Use hexo new “name” to generate the name.md file in the wsl.github. IO /source/_posts directory, which supports Markdown syntax.

Once the name.md file has been opened, your article should be formatted as shown in the following image to properly display the time, title, category, etc. Of course, if you don’t need these things, you don’t have to set them.

After the article is written, open your browser and visit localhost:4000 to preview the blog with the following command:

IO // hexo g // hexo generate static page to public directory hexo s // Hexo server deployed locally Then open your browser and visit localhost:4000 to see the effectCopy the code

Once the preview is ok, you can publish it.

Hexo d // hexo publishes the deploy command to GithubCopy the code

Six, accessGitmentReview system

Here I choose to access Gitment, of course you can also official document theme-next.iissnan.com/third-party… Access to other three-party review systems.

Gitment access methods and steps, directly look at Gitment open source god imsun.net/posts/gitme…

Reference: blog.csdn.net/Hoshea_chx/… www.jianshu.com/p/8681ab76d… www.cnblogs.com/sqlsec/p/he… www.jianshu.com/p/57afa4844… Imsun.net/posts/gitme…