📔 如何安裝 Hugo 環境

📔 如何安裝 Hugo 環境

MacOS

透過 Homebrew Package Manager 安裝是最方便的

# install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# install hugo
brew install hugo

# verify hugo installation
hugo version
> hugo v0.119.0-b84644c008e0dc2c4b67bd69cccf87a41a03937e+extended darwin/amd64 BuildDate=2023-09-24T15:20:17Z VendorInfo=brew

Windows

以工作管理員開啟 powershell
win + x 游標上下選擇到 windows powershell (工作管理員),記得要選擇超級管理員的權限。

確認執行權限:

Get-ExecutionPolicy

如果顯示 Ristricted,則再執行以下指令:

Set-ExecutionPolicy AllSigned

安裝 chocolatey:

Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

確認是否安裝完成,在 powershell 輸入:

choco
# 如果有正常回覆,即安裝完成

接著就可以透過 choco 安裝 hugo 囉!👇👇👇

# install hugo
choco install hugo-extended

# verify hugo installation
hugo version
> hugo v0.119.0-b84644c008e0dc2c4b67bd69cccf87a41a03937e...

References