创建一个高度自定义的博客
Posted justsong
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了创建一个高度自定义的博客相关的知识,希望对你有一定的参考价值。
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
Get a Github account .
Create a new repository named “you_username”.github.io, for example, my according reposity’s name is “songwonderful.github.io”.
Install Git and config it, you can refer this blog .
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.
Verify you installation. Open a console and run
node -v
to verift the installation of node. Runnpm -v
to verify the installation of npm.Create a new foloder and name it as “Blog”.
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:UserssongBlog" to your own path cd C:UserssongBlog # 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
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
```Run
npm install hexo-deployer-git --save
I am nott very clear ablou the fuction of this commandRun
ba hexo g hexo d
After all this done, you should can visit by this url : your_github_username.github.io
Buy a domain name and config it like this:
Remind that: domain name like XXX.xyz is very cheap.
Create a file named “CNAME” on blog/source , edit its content as “you_domain_name”. Save it.
Run those commands to update your site’s config infomation.
bas hexo clean hexo g hexo d
Some basic commands.
ba # Create a new artical. hexo n "new artical" # Now you can edit it on X:***Bloglogsource\\_posts # Generate static files. hexo g # Deploy hexo d
You use Markdown to write you posts. Here is a reference
Congratulation. That’s all.
## Reference
以上是关于创建一个高度自定义的博客的主要内容,如果未能解决你的问题,请参考以下文章