English | 简体中文
My personal blog (website example): [https://wentao.site/], welcome to fork and star
File directory structure introduction
yewentao256.github.io
├── archetypes # Default template for new posts
├── config.toml # Hugo configuration document
├── content # Store all articles in Markdown format
├── static # Store images, css, js, and other resources
└── themes # Themes-
Set the project name and branch required for gitpage It should be
username.github.io's main branch or master branch -
Modify the configuration Update the configuration in
config.toml, and change the personal information to your own. -
Delete old articles and images Delete my articles and images.
-
Set up your domain(optional) Set your domain on the GitHub
settings-Pagespage. -
Start writing your blog
hugo new posts/directory/title/index.en.mdThis command creates a new article witharchetypes/default.mdas the template, located in thecontent/postsdirectory. After writing, deletedraft: true. -
Start the local service for preview
hugo server -e production
-
There are two ways to index static files. One is to put them in the post folder, for example:
# content/posts/pytorch/deep_dive_to_autograd_2 ❯ ls index.en.md index.zh-cn.md resourcesThen you can index in the markdown with a relative path, e.g.,
Another form is to put them in the static folder, for example:
# static/csapp/resources ❯ ls ROP-attack.png io-redirection.pngThen you can index in any document as
 -
If you start the loveit theme on a Mac, you may encounter a fatal error due to the file number limit, fix it with
sudo launchctl limit maxfiles 100000 500000 -
No CSS style after
hugo? Press F12 to check where the frontend goes to find CSS, and fixbaseUrlaccording to related information.- For example, locally it may use an absolute path to find it,
/Users/yewentao/Desktop/myblog/docs - After deploying to gitpage, use pageurl to find, like
https://yewentao256.github.io/blog
- For example, locally it may use an absolute path to find it,
- Thanks to hugo, an efficient and easy-to-use static page generation tool: [https://github.com/gohugoio/hugo]
- Thanks to LoveIt, a neat and elegant hugo theme: [https://github.com/dillonzq/LoveIt]
- Thanks to Doit, who continued to maintain this hugo theme after the LoveIt project stopped: [https://github.com/HEIGE-PCloud/DoIt]
