码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2018-06-10 15:15:55      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:clear   inf   https   dom   source   yml   example   des   oob   


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:

    技术分享图片

    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.

    技术分享图片

  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

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

标签:clear   inf   https   dom   source   yml   example   des   oob   

原文地址:https://www.cnblogs.com/justsong/p/9162702.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!