Foreword
Hugo Stack theme is very nice, but there are still some details where it is a little rough, at the same time, want to add some of their favorite features, so I wrote this beautification article.
File Add Random Poster
Finding a good-looking cover image is a time-consuming task, so we can automatically generate a random cover image to solve this problem.
Recommended settings in the template, modify archetypes/default.md
(if not then just create a new one)
|
|
The focus here is on the image
line, which uses Lorem Picsum’s interface to get a randomized image, which can also be found at Lorem Picsum for more details.
After that, when we use the hugo new
command, the new post will be matched with a random image
Add a loading progress bar
Add the following to layouts/partials/footer/custom.html
:
|
|
Then you will see a progress bar at the top of the page with the loading progress.
Add a rainbow background
Add the following to layouts/partials/footer/custom.html
.
|
|
Scrollbar beautification
The default scrollbar is a bit ugly, but we can optimize it.
assets/scss/custom.scss
Add the following:
|
|
Styling the selected text
The default style of the selected text is white text on a blue background, which looks rather abrupt with the blog style, so you can change it.
Add the following to assets/scss/custom.scss
:
|
|
Summary
The above beautification effect refers to a number of big brother’s article.
This is the current beautification effect for the time being, and we will continue to update it later.
https://xrg.fj.cn/p/hugo-stack%E4%B8%BB%E9%A2%98%E6%9B%B4%E6%96%B0%E5%B0%8F%E8%AE%B0