使用HUGO搭建博客

使用Hugo搭建静态博客

brew install hugo

创建一个博客site

#我这里命名为 CoderWGB-blog
hugo new site CoderWGB-blog
#打印一堆提示 说明创建好了 需要自己修改对应的配置
Congratulations! Your new Hugo site is created in /Users/wangguibin/Desktop/CoderWGB-blog.

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.

打开CoderWGB-blog

cd CoderWGB-blog

加个主题

git init
git submodule add https://github.com/lxndrblz/anatole.git themes/anatole  
echo theme = "anatole" >> config.toml

新建一篇文章 (.md格式) 其中life为创建的目录

hugo new life/first_day.md
#创建之后会放到content目录下

本地运行

#hugo server
#hugo server --theme=anatole --buildDrafts --disableFastRender 
hugo server theme=anatole --buildDrafts --bind="0.0.0.0" --baseURL=http://192.168.1.4:1313/
posted @ 2023-07-09 21:07  CoderWGB  阅读(36)  评论(0)    收藏  举报