This is the log of the creation of this website. You may read as a tutorial.
After create and run the starting page, we need to add theme and post.
Adding a themes to your website
The first thing is to find a theme that you wish to apply to your website.
You can find many themes on here https://hexo.io/themes/index.html .
After you find the theme, you click the theme name to get in the theme github page like this.
All code here will use this theme as example, if you are using a different theme, plz change the code to fit your theme.
Clone the theme to your local file.
Go back to VScode terminal, your web file directory and clone the theme by this code.
1 | git clone git://github.com/Molunerfinn/hexo-theme-melody.git themes/melody |
Change your web theme.
Then go to file [yourweb]\_config.yml
fine theme:
at the last and change it to your theme.
1 | theme: melody |
And preview in localhost by this 3 command.
1 | hexo clean |
1 | hexo g |
1 | hexo s |
And also hexo d
to deploy, and back up 3 step :git add .
, git commit -m "typesomething"
, and git push origin hexo
.
Adding page to your website.
Here is how to add some defult page of the theme. (If your theme has provided these pages.)
For the tags page:
1 | hexo new page "tags" |
Then a new directory tags
should be created and it have a file call index.md
.
Open the index.md
file, and add a type
become like this.
1 | --- |
categories page will be same procedure.
1 | hexo new page "categories" |
Then a new directory categories
should be created and it have a file call index.md
.
Open the index.md
file, and add a type
become like this.
1 | --- |
You can add more pages you want by the same step.
Add the page to the menu.
Go to the _config.yml
under your theme directory. NOT your website file. [youwebfile]\themes\melody\_config.yml
and add your page like this.
1 | menu: |
Adding post to your website.
Finally add some real content to the website. Here is how to add post.
Type the following code, and fill in the file name of you post.
1 | hexo new [filename] |
And you can add some tags and categories to your post like this.
1 | --- |
Another example:
1 | --- |