Hugo 1 Install

install hugo on mac

install dependecy: Go

download the Installation package
set system envronment variable
  • export PATH=$PATH:/usr/local/go/bin
  • echo "PATH=$PATH:/usr/local/go/bin" > ~/.zshrc
  • echo "PATH=$PATH:/usr/local/go/bin" > ~/.bash_profile

update brew

change source
1# 以下针对 mac OS 系统上的 Homebrew
2git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
3git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
4git -C "$(brew --repo homebrew/cask-fonts)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git
5git -C "$(brew --repo homebrew/cask-drivers)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-drivers.git
update
1git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
2brew update

install hugo

1brew install hugo
test
1hugo --version

set up a website

init

1hugo new site [PATH]/parkman-auex.github.io
2cd [PATH]/parkman-auex.github.io

download theme

1git submodule add git@github.com:StaticMania/roxo-hugo.git themes/roxo

post an article

1hugo new content/Blog/REAMME.md
2vi content/Blog/REAMME.md

input something

1---
2title: "REAMME"
3date: 2021-09-01T13:22:34+08:00
4tags: ["Example"]
5slug: "readme"
6categories: ["Other"]
7draft: true
8comment: true
9---
  • title : Title of your article
  • date : the date when you publish this article
  • tags : More tags avaliable. Tags can be used in classification.
  • slug :
  • categories : More categories avaliable.
  • draft : true ignore in publish ,false
  • comment : open/close comment

compile

1hugo server --theme=roxo --buildDrafts

preview

1http://localhost:1313/

externel

1hugo server -D --bind ip -p 1313 --baseURL=http://ip:1313

200 Words|This article has been read times