We use Widget Pack to get the function. It’s an powerful widget that has many function. Here we will just use it’s rating function because I thinks valine is more beautiful……
Here is a preview of the function. The color of the stars can be customized.
First Sign Up for an account.
Follow it’s steps. It will let you fill your website address.
After some steps, you will get your ID here:
Click here, you can set how can reader vote for your article.
Select the drop down box to turn on anonymous rating.
And there you can change color of stars and number of stars.
Then click SAVE SETTING
.
Create a new file called startRating.html
or .pug
1 | <center> |
But, if you are using it on your website, you can just copy the code he gives you.
Then find the file post.pug
. Find the bottom of the article and include the file starRating.pug
.
1 | if theme.star.on |
After that, find your theme _config.yml
and type these:
1 | # Rating star function 打星功能 |
Save and preview.