雨果快速搭建博客

  

, - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

推荐二进制安装(简单,快速)

到,雨果Releases 下载对应的操作系统版本的雨果二进制文件(雨果或者雨果。exe)

雨果版本:h t tp s://g我th乌兰巴托。com/去h ug oi o/胡g o/r e l ea s e s

本文以Windows为例,所以下载:<强> hugo_0.24.1_windows - 64位。zip

下载之后解压得到“雨果。exe”文件。

将雨果。exe所在的目录添加到系统环境变量路径下面,打开cmd,输入“雨果”。

雨果快速搭建博客”> </p> <p>, </p> <p> </p> <p> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - </p> <p>想要创建站点,一个命令搞的定,切换到你想要创建站点的目录,输入:</p> <p> </p> <pre> D: \ git> hugo  new  site 博客
  恭喜你!,Your  new  Hugo  site  is  created  D: \ git \拷贝的博客。
  
  Just  a  few  more  steps 以及你're  ready 用:
  
  1只,Download  a  theme  into 从而same-named 文件夹。
  ,,Choose  a  theme 得到https://themes.gohugo.io/,或
  ,,create  your  own  with ,“hugo  new  theme  & lt; THEMENAME>”,命令。
  2只;Perhaps 你want 用add  some 内容又是;你还要add  single 文件
  ,,with “hugo  new  & lt; SECTIONNAME> \ & lt; FILENAME>灵活;FORMAT>”。
  3只Start 从而,built-in  live  server  via “hugo 服务器”。
  
  Visit  https://gohugo.io/  for  quickstart  guide 以及full 文档。</pre> <p> </p> <p>一个博客站点就创建好了。新建的站点目录结果如下:</p> <p> </p> <pre>博客/,,,原型/,
  ,,doc/内容/,,,,
  数据/,,,,
  ,,,布局/,
  静态/,,,,
  ,,配置。toml </pre> <p> </p> <p>, </p> <p>当前的站没有任何内容,也没做任何配置。</p> <p>接下来切换到博客站点目录,创建一篇文章:</p> <pre> D: \ git> cd 博客
  D: \ git \ blog> hugo  new 。md </pre> <p>该文件位于博客/内容/d目录下。打开编辑:</p> <p> </p> <pre> + + +
  时间=date “2017 - 07 - 03 - t15:37:11 +喂饲”
  tags =,(“博客”)
  时间=title “my  first 博客”
  
  +++
  
  # # #,这里使用减价来编写文章</pre> <p> </p> <p>减价教程:ht tp://w o w乌兰巴托u nt . c o m/ma rk d,噢n/</p> <p>, </p> <p> </p> <p>, - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - </p> <p>站点一定要有主题,安装主题应该是最难的一步了,因为不同的主题设置方式也会有所不同。</p> <p>雨果主题:h t t ps://m e s .g o h ug o。io/</p> <p>你可以到上面的网站中挑选你喜欢的主题。然后,根据指引找到github项目地址进行下载。</p> <p>, </p> <p> </p> <p>我使用的主题是:ht t ps://gi t胡锦涛b。w . m/d/胡g o - f, b, c r我</p> <p>把主题通过git克隆或直接下载到本地。放到…/博客/主题/目录下。</p> <p>, </p> <p> </p> <p>生成主题资源文件(hugo-fabric为主题名)</p> <p> </p> <pre> d: \ git \ blog> hugo  -t  hugo-fabric
  Started  building  sites …
  Built  site  for  language  en:
  0,of  3, drafts 呈现
  0,future 内容
  0,expired 内容
  8,regular  pages 创建
  12,other  pages 创建
  0,non-page  files 复制
  2,paginator  pages 创建
  1,tags 创建
  1,categories 创建
  total  35拷贝,女士</pre> <p> </p> <p> </p> <p>注:配置。toml文件是核心,对网站的配置多数需要修改该文件,而每个主题的配置又不完全一样。</p> <p>, </p> <p> </p> <p>, - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - </p> <p> </p> <pre> D: \ git \ blog> hugo 服务器
  警告:,Site 配置's  rssURI  is  deprecated 以及will  be  removed 拷贝a  future 释放只Set  baseName  outputFormats.RSS拷贝。
  Started  building  sites …
  Built  site  for  language  en:
  0,draft 内容
  0,future 内容
  0,expired 内容
  1,regular  pages 创建
  8,other  pages 创建
  0,non-page  files 复制
  1,paginator  pages 创建
  1,tags 创建
  0,categories 创建
  total  9拷贝,女士
  Watching  for  changes 拷贝;D: \ git \博客\{数据、内容、布局、静态、主题}
  Serving  pages 得到的记忆
  Web  Server  is  available  at  http://localhost: 1313/, (bind  address  127.0.0.1)
  Press  Ctrl + C 用停止<h2 class=雨果快速搭建博客