1 安裝
應縣網站制作公司哪家好,找創新互聯公司!從網頁設計、網站建設、微信開發、APP開發、響應式網站開發等網站項目制作,到程序開發,運營維護。創新互聯公司于2013年創立到現在10年的時間,我們擁有了豐富的建站經驗和運維經驗,來保證我們的工作的順利進行。專注于網站建設就選創新互聯公司。
---------------------------
推薦二進制安裝(簡單、快速)
到 Hugo Releases 下載對應的操作系統版本的Hugo二進制文件(hugo或者hugo.exe)
Hugo Releases:h t tp s : / /g i th ub . com / go h ug oi o/ hu g o /r e l ea s e s
本文以Windows為例,所以下載:hugo_0.24.1_Windows-64bit.zip
下載之后解壓得到“hugo.exe”文件。
將hugo.exe所在的目錄添加到系統環境變量PATH下面,打開cmd,輸入“hugo version”。
2 創建站點&文章
---------------------------------------
想要創建站點,一個命令搞定,切換到你想要創建站點的目錄,輸入:
D:\git>hugo new site blog Congratulations! Your new Hugo site is created in D:\git\blog. Just a few more steps and you're ready to go: 1. Download a theme into the same-named folder. Choose a theme from https://themes.gohugo.io/, or create your own with the "hugo new theme <THEMENAME>" command. 2. Perhaps you want to add some content. You can add single files with "hugo new <SECTIONNAME>\<FILENAME>.<FORMAT>". 3. Start the built-in live server via "hugo server". Visit https://gohugo.io/ for quickstart guide and full documentation.
一個blog站點就創建好了。新建的站點目錄結果如下:
blog/ archetypes/ doc/ content/ data/ layouts/ static/ config.toml
當前的站沒有任何內容,也沒做任何配置。
接下來切換到blog站點目錄,創建一篇文章:
D:\git>cd blog D:\git\blog>hugo new about.md
該文件位于 blog/content/about.md目錄下。打開編輯:
+++ date = "2017-07-03T15:37:11+08:00" tags = ["blog"] title = "my first blog" +++ ### 這里使用markdown來編寫文章
markdown 教程:ht tp : / / w o w ub u nt u .c o m / ma rk d ow n/
3 安裝主題
---------------------------
站點一定要有主題,安裝主題應該是最難的一步了,因為不同的主題設置方式也會有所不同。
Hugo themes:h t t ps : / / the m e s .g o h ug o . io/
你可以到上面的網站中挑選你喜歡的主題。然后,根據指引找到github項目地址進行下載。
3.1 下載主題:
我使用的主題是:ht t ps : // gi t hu b . co m / w d/ hu g o- f a b r i c
把主題通過git克隆或直接下載到本地。放到 …/blog/themes/目錄下。
3.2 使用主題:
生成主題資源文件(hugo-fabric為主題名)
D:\git\blog>hugo -t hugo-fabric Started building sites ... Built site for language en: 0 of 3 drafts rendered 0 future content 0 expired content 8 regular pages created 12 other pages created 0 non-page files copied 2 paginator pages created 1 tags created 1 categories created total in 35 ms
將\blog\themes\hugo-fabric\exampleSite\config.toml 替換 \blog\config.toml
注:config.toml文件是核心,對網站的配置多數需要修改該文件,而每個主題的配置又不完全一樣。
4 啟動服務器
------------------------------
D:\git\blog>hugo server WARNING: Site config's rssURI is deprecated and will be removed in a future release. Set baseName in outputFormats.RSS. Started building sites ... Built site for language en: 0 draft content 0 future content 0 expired content 1 regular pages created 8 other pages created 0 non-page files copied 1 paginator pages created 1 tags created 0 categories created total in 9 ms Watching for changes in D:\git\blog\{data,content,layouts,static,themes} Serving pages from memory Web Server is available at http://localhost:1313/ (bind address 127.0.0.1) Press Ctrl+C to stop
打開瀏覽器訪問:http://localhost:1313/
新聞名稱:Hugo快速搭建Blog
網頁路徑:http://vcdvsql.cn/article34/gjiise.html
成都網站建設公司_創新互聯,為您提供品牌網站建設、企業建站、響應式網站、網站設計公司、網站排名、商城網站
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯