Welcome to Shiny Zhu's blog 2023 edition.
You can find blog posts and topics on #FullStack, #DevRel, #TravelTech and more now or in the future.
-
Hugo: One of the most popular open-source static site generators.
-
hugo-theme-diary: A Hugo theme ported from SumiMakito/hexo-theme-Journal. I also forked one to make my own changes.
-
giscus: A comments system powered by GitHub Discussions.
-
Vercel Hobby plan. This blog is hosted there. It's free and really fast.
Make sure you have Hugo installed.
I prefer download Hugo Extended from Hugo Releases.
apps % curl -LO https://github.com/gohugoio/hugo/releases/download/v0.121.1/hugo_extended_0.121.1_darwin-universal.tar.gz
apps % tar zxf hugo_extended_0.121.1_darwin-universal.tar.gz -C hugox
apps % export PATH=$PATH:/Users/shiny/apps/hugox
apps % which hugo
/Users/shiny/apps/hugox/hugo
Then run hugo serve
to view it.
shinyzhu.github.io[main*] % hugo serve
Watching for changes in /Users/shiny/Documents/GitHub/shinyzhu.github.io/{archetypes,content,layouts,static,themes}
Watching for config changes in /Users/shiny/Documents/GitHub/shinyzhu.github.io/config.toml
Start building sites …
hugo v0.121.1-00b46fed8e47f7bb0a85d7cfc2d9f1356379b740+extended darwin/arm64 BuildDate=2023-12-08T08:47:45Z VendorInfo=gohugoio
| EN
-------------------+------
Pages | 141
Paginator pages | 8
Non-page files | 97
Static files | 18
Processed images | 0
Aliases | 61
Sitemaps | 1
Cleaned | 0
Built in 118 ms
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
If you found layout or page error when after deploying to Vercel. That's because the default Hugo version maybe too old. You can specify the version of Hugo by setting an environment variable.
Here is the steps:
-
Navigate to the Settings tab of your Vercel project.
-
Click the Environment Variables item from the side menus.
-
Add a new env with key
HUGO_VERSION
and value0.121.1
. -
Re deploy and you'll get the right Hugo.
Enjoy coding and writing. Comments are welcome.