廣告設(shè)計(jì)軟件手機(jī)版朝陽(yáng)seo推廣
檢查Hugo是否安裝
hugo version
顯示所有可用命令
hugo help
顯示指定命令的可用子命令,例如查詢(xún)server的所有子命令
hugo server --help
建立你的網(wǎng)站,cd進(jìn)入你的項(xiàng)目根目錄運(yùn)行
hugo
默認(rèn)發(fā)布內(nèi)容到自動(dòng)創(chuàng)建的public
文件夾。
覆蓋hugo
或hugo server
的默認(rèn)行為
hugo -D # or -buildDrafts
hugo -E # or -buildExpired
hugo -F # or -buildFuture
你也可以在網(wǎng)站配置文件中設(shè)置它們。
在你編輯內(nèi)容或布局時(shí)實(shí)時(shí)觀察你的網(wǎng)站變化
hugo server
hugo server
編譯你的網(wǎng)站后放進(jìn)內(nèi)存中,并提供簡(jiǎn)易的HTTP服務(wù),你能夠在http://localhost:1313/
訪(fǎng)問(wèn)到你的網(wǎng)站。
它會(huì)監(jiān)聽(tīng)assets
、配置文件、content
、data
、layouts
、翻譯文件和static
的變化。
其工作機(jī)制是LiveReload。
自動(dòng)重定向到你正在編輯的頁(yè)面
hugo server --navigateToChanged
部署你的網(wǎng)站
Hugo不會(huì)自動(dòng)刪除hugo
命令生成的public目錄,需要我們手動(dòng)刪除。
public目錄結(jié)構(gòu)類(lèi)似于下面:
public/
├── categories/
│ ├── index.html
│ └── index.xml <-- 網(wǎng)站的RSS源
├── post/
│ ├── my-first-post/
│ │ └── index.html
│ ├── index.html
│ └── index.xml <-- 網(wǎng)站的RSS源
├── tags/
│ ├── index.html
│ └── index.xml <-- 網(wǎng)站的RSS源
├── index.html
├── index.xml <-- 網(wǎng)站的RSS源
└── sitemap.xml
通常通過(guò)CI/CD工作流,將網(wǎng)站的內(nèi)容部署到Github等服務(wù)器。
了解CI/CD工作流。