Create Static Website with Hugo
Create Static Website with Hugo
1
winget install Hugo.Hugo.Extended
new site
1
hugo new site [site-name]
This will create a folder named [site-name]
apply theme
search theme from hugo theme
install paper theme as git submodule
Inside the folder of your Hugo project, run:
1
git submodule add https://github.com/nanxiaobei/hugo-paper themes/paper
Open hugo.toml, change theme to "paper":
1
theme = "paper"
add content
1
hugo new posts/<file-name>.md
Note that if the article is not located under
[site-name]/content/posts, it will not be able to be shown.
Host on GitHub Pages
The site will be built and deployed by GitHub Action.
under [site-name]
1
2
3
git remote add origin https://github.com/[user-name]/[user-name].github.io.git
git config --global user.name [name]
git config --global user.mail [mail-address]
1
2
3
git add .
git commit -m "[commit-message]"
git push
Navigate to your repo > acrtion page, once deployed successfully, you can access the website.
This post is licensed under CC BY 4.0 by the author.