快速开始

新建站点

  1. hugo new side /path/tp/your/site

提示如下:

  1. $ hugo new site learning-cilium
  2. Congratulations! Your new Hugo site is created in /home/sky/work/code/learning/learning-cilium.
  3. Just a few more steps and you're ready to go:
  4. 1. Download a theme into the same-named folder.
  5. Choose a theme from https://themes.gohugo.io/, or
  6. create your own with the "hugo new theme <THEMENAME>" command.
  7. 2. Perhaps you want to add some content. You can add single files
  8. with "hugo new <SECTIONNAME>/<FILENAME>.<FORMAT>".
  9. 3. Start the built-in live server via "hugo server".
  10. Visit https://gohugo.io/ for quickstart guide and full documentation.

下载模板

选择喜欢的模板,一般下载方式如下:

  1. cd learning-cilium
  2. git clone git@github.com:digitalcraftsman/hugo-material-docs.git themes/hugo-material-docs

为了快速开始使用,一般模板都会提供一个exampleSite,通常将该目录下的内容都复制到站点跟目录下:

  1. cp -av themes/hugo-material-docs/exampleSite/* .

运行

直接执行server命令就可以启动:

  1. hugo server

通过浏览器访问 http://localhost:1313/ 就可以看内容,由于上面我们采用的是直接复制exampleSite的内容,所以一般此时看到的就是这个模板的example内容。

之后再进行具体的网站设定,模板修改,添加内容等。

提交到github

  1. echo "# learning-cilium" >> README.md
  2. git init
  3. git add -A
  4. git commit -m "first commit"
  5. git remote add origin git@github.com:skyao/learning-cilium.git
  6. git push -u origin master