By Long Luo
Hugo vs. Hexo
My current website uses Hexo + Next, which is standard on most personal websites. Hugo’s official website is claimed to be the fastest website framework with fast construction speed. Since I have a large number of articles, I will consider switching to Hugo in the future. I spent some time to learn it today.
Here’s the learning process:
Hugo User Guide
Download Hugo
For Windows 10, go to github.com/gohugoio/hu…
Add the Path of the Hugo. Exe file to the Path variable of Windows:
E:\Website> Hugo version Hugo V0.82.0-9D960784 + Extended Windows/AMD64 BuildDate= 2021-03-21T17:28:04z VendorInfo=gohugoioCopy the code
Create a site project
In my case, suppose you want to create a site in the F:\Hugo\Website\ directory, switch to that directory on the command line and execute:
E:\Website>hugo new site mywebsite
Congratulations! Your new Hugo site is created in E:\Website\mywebsite.
Copy the code
With the above information, the myWebsite project is created with the following file list:
2021/03/28 15:52 <DIR> . 2021/03/28 15:52 <DIR> .. 2021/03/28 15:51 <DIR> archetypes 2021/03/28 16:09 103 config.toml 2021/03/28 16:12 <DIR> content 2021/03/28 15:51 <DIR> data 2021/03/28 15:51 <DIR> layouts 2021/03/28 15:52 <DIR> resources 2021/03/28 15:51 <DIR> static 2021/03/28 16:08 <DIR> themesCopy the code
Add the theme
Once you have the files, you can’t build the site yet, because Hugo doesn’t have theme files by default. Here’s a neat theme
git clone https://github.com/yihui/hugo-prose.git themes/prose
Copy the code
Open the config.toml configuration file in the current project directory and add a theme = “prose” line at the end, setting the site to a Prose theme.
Running the site
Run the Hugo server -d command in the site project
E:\Website\ myWebsite > Hugo server -d Start building sites... | EN -------------------+----- Pages | 10 Paginator pages | 0 Non-page files | 0 Static files | 4 Processed images | 0 Aliases | 1 Sitemaps | 1 Cleaned | 0 Builtin 30 ms
Watching for changes in E:\Website\mywebsite\{archetypes,content,data,layouts,static,themes}
Watching for config changes in E:\Website\mywebsite\config.toml
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/ (bindAddress 127.0.0.1) Press Ctrl+C to stopCopy the code
In the browser window, enter http://localhost:1313/
If the Hugo website interface appears after the successful opening, then it is installed!
There’s still no content at this point because we haven’t added anything yet 🙂
summary
From Hugo’s initial experience, Hugo is fast. However, due to the lack of time at present, can not beautify one by one. After have time energy later, toss again!
Source: Use Hugo to build personal website