I added gitalk comment system and read counts. However the gitalk did not work properly. I post this only for testing purposes. All you need to do is clicking save after modifying any config file. There is not need to git add or git commit if you only want to update your config.
Add a new theme
You can look for your theme on https://hexo.io/themes/ . If you click any link on that page, it will direct you to a github repository. You will always find instructions of how to install the theme on README.md. I prefer git clone way.
Take theme keep as an example:
1 | $ cd themes |
You will see
Cloning into ‘keep’…
remote: Enumerating objects: 4592, done.
remote: Counting objects: 100% (321/321), done.
remote: Compressing objects: 100% (170/170), done.
remote: Total 4592 (delta 162), reused 248 (delta 147), pack-reused 4271
Receiving objects: 100% (4592/4592), 2.73 MiB | 3.84 MiB/s, done.
Resolving deltas: 100% (2971/2971), done.
Check your _config.yml in you root blog folder and set theme variable to keep
1 | # Extensions |
Re-generate your folder to check your new theme.
1 | > hexo clean |
If you want to update your keep theme to its latest version
1 | $ cd themes/keep |
Add read counts
Open _config.yml in your themes folder, for example themes/keep/_config.yml. Set busuanzi parameters to true.
1 | busuanzi_count: |
Add gitalk
It does not work properly at the beginning, but if you wait long enough, it will work.
Request a GitHub OAuth application via the link https://github.com/settings/applications/new . When you register a new application, set this information.
Application name: website_comments
Homepage URL: [your_personal_link_or_github.io_link]
Authorization callback URL: [your_blog_github.io_link]
Now you haveClient IDandClient secrets.
Create a new GitHub repository website_comments to save the comments for the website. Make sure the repository is public and ✔issues.
Create a new issue.
Open _config.yml in your themes folder. gitalk settings in keep is like this
1 | comment: |
The _config.yml files of other themes are similar. The gitalk settings in theme next are like this
1 | # Gitalk |
Read ‘_config.yml’ and README.md file, you will eventually know what to do. Cheers.