创建一个高度自定义的博客


Note

I use English to complete my writing, if you find it terrible, you can refer this post.


Welcome

Welcome to my personal website, in this hello world page, I will briefly show you how I create this website with the help of Github and Hexo . And you can also create you own, just follow me.


Steps

  1. Get a Github account .

  2. Create a new repository named “you_username”.github.io, for example, my according reposity’s name is “songwonderful.github.io”.

  3. Install Git and config it, you can refer this blog .

  4. Download Node.js and install it. But you may find the download speed is too low, download it here, which is uploaded by myself without changes.

  5. Verify you installation. Open a console and run node -v to verift the installation of node. Run npm -v to verify the installation of npm.

  6. Create a new foloder and name it as “Blog”.

  7. Install Hexo. Open a console and change path to your newly created folder. Then install hexo and init you blog.

The following code is for you to reference

bash # Change "C:\Users\song\Blog" to your own path cd C:\Users\song\Blog # Install Hexo npm install -g hexo-cli # Init your blog hexo init blog # It create a new folder named "blog" under current path. Enter this new folder cd blog npm install

  1. Config your site. Modify the _config.yml file. The following content should be changed.

    ```yml
    ~skip~
    # Site
    title: JustSong #your site's title
    subtitle: Better and Best #your site's subtitle
    description:
    keywords:
    author: JustSong #your name
    language: en
    timezone:

    ~skip~

    deploy:
    type: git
    repo: https://github.com/songwonderful/songwonderful.github.io.git #your own repo here
    branch: master
    ```

  2. Run npm install hexo-deployer-git --save I am nott very clear ablou the fuction of this command

  3. Run

    ba hexo g hexo d

    After all this done, you should can visit by this url : your_github_username.github.io

  4. Buy a domain name and config it like this:

    config domain name

    Remind that: domain name like XXX.xyz is very cheap.

  5. Create a file named “CNAME” on blog/source , edit its content as “you_domain_name”. Save it.

    config

  6. Run those commands to update your site’s config infomation.

    bas hexo clean hexo g hexo d

  7. Some basic commands.

    ba # Create a new artical. hexo n "new artical" # Now you can edit it on X:\***\Blog\blog\source\_posts # Generate static files. hexo g # Deploy hexo d

    You use Markdown to write you posts. Here is a reference

    You can find all orders here.

  8. Congratulation. That’s all.


## Reference

猜你喜欢

转载自www.cnblogs.com/justsong/p/9162702.html