$ hugo version Hugo Static Site Generator v0.60.1-96066756 windows/amd64 BuildDate: 2019-11-29T14:57:23Z
说明已配置成功。
mac:
1 2
brew install hugo hugo version
请自行验证。
创建站点和文章
创建站点
一行命令搞定:
1 2 3 4 5 6 7 8 9 10 11 12 13
$ hugo new site HugoSite Congratulations! Your new Hugo site is created in G:\workspace\github\sogrey\hugo\HugoSite.
Just a few more steps and you're ready to go: 1. Download a theme into the same-named folder. Choose a theme from https://themes.gohugo.io/ or create your own with the "hugo new theme <THEMENAME>" command. 2. Perhaps you want to add some content. You can add single files with "hugo new <SECTIONNAME>\<FILENAME>.<FORMAT>". 3. Start the built-in live server via "hugo server". Visit https://gohugo.io/ for quickstart guide and full documentation.
//默认为: baseURL = "http://example.org/" languageCode = "en-us" title = "My New Hugo Site" //修改为 baseURL = "github发布出去的博客地址" languageCode = "en-us" title = "My New Hugo Site" publishDir = "publish"
$ hugo server Building sites … | EN +------------------+----+ Pages | 8 Paginator pages | 0 Non-page files | 0 Static files | 6 Processed images | 0 Aliases | 0 Sitemaps | 1 Cleaned | 0
Built in 5 ms Watching for changes in G:\workspace\github\sogrey\hugo\HugoSite\{archetypes,content,data,layouts,static,themes} Watching for config changes in G:\workspace\github\sogrey\hugo\HugoSite\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/HugoSite/ (bind address 127.0.0.1) Press Ctrl+C to stop
____ U ___ u ____ ____ U _____ u __ __ / __"| u \/"_ \/ U /"___|u U | _"\ u \| ___"|/ \ \ / / <\___ \/ | | | | \| | _ / \| |_) |/ | _|" \ V / u___) | .-,_| |_| | | |_| | | _ < | |___ U_|"|_u |____/>> \_)-\___/ \____| |_| \_\ |_____| |_| )( (__) \\ _)(|_ // \\_ << >> .-,//|(_ (__) .github.io(__) (__)__) (__) (__) (__) (__) \_) (__) [1/3] commit 2 master branch Reinitialized existing Git repository in G:/workspace/github/sogrey/hugo/HugoSite/.git/ warning: LF will be replaced by CRLF in content/HelloWorld.md. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in publish/categories/index.xml. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in publish/helloworld/index.html. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in publish/index.xml. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in publish/sitemap.xml. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in publish/tags/index.xml. The file will have its original line endings in your working directory [master 60c0113] deploy master 1 file changed, 1 insertion(+), 1 deletion(-) Enumerating objects: 7, done. Counting objects: 100% (7/7), done. Delta compression using up to 8 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (4/4), 435 bytes | 435.00 KiB/s, done. Total 4 (delta 1), reused 0 (delta 0) remote: Resolving deltas: 100% (1/1), completed with 1 local object. To https://github.com/Sogrey/HugoSite.git bd0c5f8..60c0113 master -> master [2/3] Building static files Building sites … | EN +------------------+----+ Pages | 8 Paginator pages | 0 Non-page files | 0 Static files | 6 Processed images | 0 Aliases | 0 Sitemaps | 1 Cleaned | 0 Total in 40 ms [3/3] commit 2 gh-pages branch Reinitialized existing Git repository in G:/workspace/github/sogrey/hugo/HugoSite/publish/.git/ warning: LF will be replaced by CRLF in categories/index.xml. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in helloworld/index.html. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in index.xml. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in sitemap.xml. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in tags/index.xml. The file will have its original line endings in your working directory [master bfe7070] deploy gh-pages(web site) 3 files changed, 3 insertions(+), 3 deletions(-) Enumerating objects: 11, done. Counting objects: 100% (11/11), done. Delta compression using up to 8 threads Compressing objects: 100% (5/5), done. Writing objects: 100% (6/6), 697 bytes | 697.00 KiB/s, done. Total 6 (delta 4), reused 0 (delta 0) remote: Resolving deltas: 100% (4/4), completed with 4 local objects. To https://github.com/Sogrey/HugoSite.git ef3e33a..bfe7070 master -> gh-pages /g/workspace/github/sogrey/hugo/HugoSite