<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>主頁 on Hugo 社群文檔</title><link>https://hugo-community-docs.github.io/zh-tw/</link><description>Recent content in 主頁 on Hugo 社群文檔</description><generator>Hugo</generator><language>zh-TW</language><lastBuildDate>Sat, 15 Aug 2026 04:09:57 +0800</lastBuildDate><atom:link href="https://hugo-community-docs.github.io/zh-tw/index.xml" rel="self" type="application/rss+xml"/><item><title>認識 Hugo</title><link>https://hugo-community-docs.github.io/zh-tw/docs/guide/introduction/</link><pubDate>Sat, 15 Aug 2026 04:09:57 +0800</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/docs/guide/introduction/</guid><description>&lt;p&gt;&lt;a href="https://gohugo.io/"&gt;Hugo&lt;/a&gt; 是以 Go 語言撰寫的靜態網站生成器 (SSG)，構建的靜態網站讓你免於煩惱伺服器的開銷和維護問題。Hugo 有諸多特色，速度只是其中一個，設定靈活、可規模化、可擴展性以及開箱即用都只是他的眾多優點之一。&lt;/p&gt;</description></item><item><title>安裝 Hugo 以及其工具鏈</title><link>https://hugo-community-docs.github.io/zh-tw/docs/guide/installation/</link><pubDate>Sat, 15 Aug 2026 04:09:57 +0800</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/docs/guide/installation/</guid><description>&lt;p&gt;本篇說明如何在各作業系統安裝 Hugo，並設定好執行所需的環境變數（PATH）。&lt;/p&gt;</description></item><item><title>入門</title><link>https://hugo-community-docs.github.io/zh-tw/tutorial/introduction/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/tutorial/introduction/</guid><description>&lt;p&gt;本文假設讀者已經對程式語言有基礎認知，不會從零介紹所有程式知識，並且在這個基礎認知上介紹 Hugo 的語法。&lt;/p&gt;</description></item><item><title>介紹</title><link>https://hugo-community-docs.github.io/zh-tw/reference/introduction/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/reference/introduction/</guid><description>&lt;p&gt;本章節是參考，列出所有 Hugo 內建工具。&lt;/p&gt;</description></item><item><title>專案結構與 UFS</title><link>https://hugo-community-docs.github.io/zh-tw/docs/concept/project-structure/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/docs/concept/project-structure/</guid><description>&lt;h2 id="專案結構"&gt;
	專案結構
	&lt;a class="heading-anchor" href="#%e5%b0%88%e6%a1%88%e7%b5%90%e6%a7%8b" aria-label="Permalink to '專案結構'"&gt;&lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;標準的 Hugo 專案結構如下：&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;my-project/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── archetypes/ # 新內容的預設樣板
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── assets/ # 可經 Hugo Pipes 處理（CSS、JS、圖片）
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── static/ # 不會被處理，原樣複製到輸出目錄
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── config/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ ├── _default/ # 預設設定
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ │ └── hugo.yaml # 網站設定檔，也可放在專案根目錄
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ └── production/ # 環境專屬的覆寫設定
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── content/ # Markdown 內容
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── data/ # 供模板讀取的自訂資料檔（JSON/YAML/yaml）
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── i18n/ # 翻譯檔
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── layouts/ # 模板檔案，網站的 HTML 結構
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── public/ # 建置輸出目錄
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── resources/ # 資源處理快取
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;└── themes/ # 主題（若透過 git submodule 安裝）&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;其中 resources 和 public 每次構建都會重複生成，你應該將這兩個目錄設定到 &lt;code&gt;.gitignore&lt;/code&gt; 中，因為 Git 追蹤被生成的檔案沒有任何意義。&lt;/p&gt;</description></item><item><title>內容管理</title><link>https://hugo-community-docs.github.io/zh-tw/docs/concept/content-management/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/docs/concept/content-management/</guid><description>&lt;p&gt;本文介紹與 content 目錄所有有關的內容。&lt;/p&gt;</description></item><item><title>建立網站</title><link>https://hugo-community-docs.github.io/zh-tw/docs/guide/quick-start/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/docs/guide/quick-start/</guid><description>&lt;p&gt;本文說明如何使用 Hugo 建立網站並啟動本地開發伺服器。&lt;/p&gt;
&lt;h2 id="建立專案"&gt;
	建立專案
	&lt;a class="heading-anchor" href="#%e5%bb%ba%e7%ab%8b%e5%b0%88%e6%a1%88" aria-label="Permalink to '建立專案'"&gt;&lt;/a&gt;
&lt;/h2&gt;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;hugo new project my-site
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; my-site&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;code&gt;hugo new project&lt;/code&gt; 會建立基本的目錄結構，此時網站還沒有任何主題與內容。&lt;/p&gt;</description></item><item><title>基礎語法</title><link>https://hugo-community-docs.github.io/zh-tw/tutorial/basic-syntax/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/tutorial/basic-syntax/</guid><description>&lt;h2 id="計算和比較"&gt;
	計算和比較
	&lt;a class="heading-anchor" href="#%e8%a8%88%e7%ae%97%e5%92%8c%e6%af%94%e8%bc%83" aria-label="Permalink to '計算和比較'"&gt;&lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Hugo 沒有 &lt;code&gt;+&lt;/code&gt;、&lt;code&gt;&amp;lt;&lt;/code&gt; 這些符號，比較需用函式呼叫。&lt;/p&gt;</description></item><item><title>內容撰寫</title><link>https://hugo-community-docs.github.io/zh-tw/docs/guide/content-authoring/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/docs/guide/content-authoring/</guid><description>&lt;p&gt;本篇說明撰寫文章內容會用到的相關知識，包含 content 目錄結構，Markdown、front matter 與 shortcode。&lt;/p&gt;</description></item><item><title>資源處理</title><link>https://hugo-community-docs.github.io/zh-tw/tutorial/resources/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/tutorial/resources/</guid><description>&lt;p&gt;&lt;code&gt;resource.Resource&lt;/code&gt; 物件用於 Hugo 的資源處理。&lt;/p&gt;
&lt;h2 id="建立"&gt;
	建立
	&lt;a class="heading-anchor" href="#%e5%bb%ba%e7%ab%8b" aria-label="Permalink to '建立'"&gt;&lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;有多種方式可以建立 &lt;code&gt;resource.Resource&lt;/code&gt; 物件，以全局函式來說有以下幾種方式：&lt;/p&gt;</description></item><item><title>多語言網站</title><link>https://hugo-community-docs.github.io/zh-tw/docs/concept/multilingual/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/docs/concept/multilingual/</guid><description>&lt;p&gt;Hugo 每個語言就是獨立一個 site，每個 site 各自獨立，多語言網站中每種語言都是 language 這個維度上的一個 site，本篇說明具體應該如何設定。&lt;/p&gt;</description></item><item><title>開發設定</title><link>https://hugo-community-docs.github.io/zh-tw/tutorial/development-setup/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/tutorial/development-setup/</guid><description>&lt;p&gt;本文介紹 Hugo 開發相關設定。&lt;/p&gt;
&lt;h2 id="編輯器設定"&gt;
	編輯器設定
	&lt;a class="heading-anchor" href="#%e7%b7%a8%e8%bc%af%e5%99%a8%e8%a8%ad%e5%ae%9a" aria-label="Permalink to '編輯器設定'"&gt;&lt;/a&gt;
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;VS Code 語法高亮和補全：&lt;a href="https://github.com/theNewDynamic/language-hugo-vscode"&gt;theNewDynamic/language-hugo-vscode&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;JetBrains 語法高亮和補全：&lt;a href="https://www.smarthugo.dev/"&gt;Smart Hugo&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="formatter-設定"&gt;
	Formatter 設定
	&lt;a class="heading-anchor" href="#formatter-%e8%a8%ad%e5%ae%9a" aria-label="Permalink to 'Formatter 設定'"&gt;&lt;/a&gt;
&lt;/h2&gt;&lt;h3 id="html"&gt;
	HTML
	&lt;a class="heading-anchor" href="#html" aria-label="Permalink to 'HTML'"&gt;&lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;可以使用 prettier 插件以格式化 HTML + go-template。&lt;/p&gt;</description></item><item><title>Sites Matrix</title><link>https://hugo-community-docs.github.io/zh-tw/docs/concept/sites-matrix/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/docs/concept/sites-matrix/</guid><description>&lt;p&gt;在 Hugo 中每個語言都是獨立的 site，而 &lt;a href="https://github.com/gohugoio/hugo/releases/tag/v0.153.0"&gt;Hugo v0.153.0&lt;/a&gt; 進一步引入了 sites matrix 概念，將原本單一維度的「一個 language 對應一個 site」提升到三個維度的組合。本篇說明這個概念，以及如何用它控制內容的產生範圍。&lt;/p&gt;</description></item><item><title>基礎設定</title><link>https://hugo-community-docs.github.io/zh-tw/docs/guide/basic-configuration/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/docs/guide/basic-configuration/</guid><description>&lt;p&gt;Hugo 的設定檔有上百個選項可以設定，初學者看到一定會非常迷惑，本文的目的是整理出 &lt;code&gt;hugo.yaml&lt;/code&gt; 中最值得關注的設定，讓你不會在大量的設定中迷路。&lt;/p&gt;</description></item><item><title>Hugo Modules</title><link>https://hugo-community-docs.github.io/zh-tw/docs/concept/hugo-modules/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/docs/concept/hugo-modules/</guid><description>&lt;p&gt;本文專門介紹 Hugo Modules 以及對應的 &lt;code&gt;hugo mod&lt;/code&gt; 指令。&lt;/p&gt;
&lt;h2 id="什麼是-module"&gt;
	什麼是 Module
	&lt;a class="heading-anchor" href="#%e4%bb%80%e9%ba%bc%e6%98%af-module" aria-label="Permalink to '什麼是 Module'"&gt;&lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Module 是 Hugo 組織內容的基本單位。一個 module 可以是完整的 Hugo 專案，也可以只是提供某一種元件（content、layouts、assets、data、i18n、static、archetypes）的小型可重用套件。你安裝的主題，本質上就是一個 module。&lt;/p&gt;</description></item><item><title>網址與路由</title><link>https://hugo-community-docs.github.io/zh-tw/docs/guide/routing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/docs/guide/routing/</guid><description>&lt;p&gt;這篇文章說明 Hugo 如何決定每個頁面的網址。從一開始就把網址管理做對，失效連結對網站的傷害幾乎大於一切，因此要及早規劃好你的做法。&lt;/p&gt;</description></item><item><title>模板系統</title><link>https://hugo-community-docs.github.io/zh-tw/docs/concept/templates/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/docs/concept/templates/</guid><description>&lt;p&gt;本文介紹 Hugo 的模板查找機制，查找機制決定每個頁面該套用哪個模板，主要由三個基本概念決定：page kind、page type，以及 front matter 手動指定的 layout。理解基本概念之後，我們會介紹完整的模板分類，才真正說明完整的查找順序，在文章的最後搭配兩個範例總結本文。&lt;/p&gt;</description></item><item><title>Data</title><link>https://hugo-community-docs.github.io/zh-tw/docs/concept/data/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/docs/concept/data/</guid><description>&lt;p&gt;Data 目錄只儲存三種檔案：yaml, YAML, JSON。這個目錄的特色是在 Hugo 啟動後，該目錄的內容就會被讀取到 Hugo 記憶體中直到構建結束，中間不會被清除。因此，如果有很大、不被多頁面共用的結構性文件，則應該放在 &lt;code&gt;assets&lt;/code&gt; 目錄中，因為 &lt;code&gt;assets&lt;/code&gt; 裡面的內容處理完成後，佔用的記憶體會被 GC 回收。&lt;/p&gt;</description></item><item><title>部署網站</title><link>https://hugo-community-docs.github.io/zh-tw/docs/guide/deploy/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/docs/guide/deploy/</guid><description>&lt;p&gt;將你的網站部署到公開網路上，Hugo 官方做了非常詳盡的教學，請見&lt;a href="https://gohugo.io/host-and-deploy/"&gt;官方文檔&lt;/a&gt;。&lt;/p&gt;</description></item><item><title>Content Adapter</title><link>https://hugo-community-docs.github.io/zh-tw/docs/concept/content-adapter/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/docs/concept/content-adapter/</guid><description>&lt;p&gt;Content Adapter 用於建立動態頁面，通常用於建立 API 文檔，透過前置腳本建立好 JSON 的結構化文件，然後在 content adapter 中讀取 &lt;code&gt;data&lt;/code&gt; 檔案並自動建立頁面。使用請見&lt;a href="https://gohugo.io/content-management/content-adapters/"&gt;官方文檔&lt;/a&gt;。&lt;/p&gt;</description></item><item><title>設定檔索引</title><link>https://hugo-community-docs.github.io/zh-tw/reference/config/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/reference/config/</guid><description>&lt;p&gt;請見 Hugo 官方文檔的&lt;a href="https://gohugo.io/configuration/all/"&gt;設定檔索引頁面&lt;/a&gt;。&lt;/p&gt;</description></item><item><title>API 索引</title><link>https://hugo-community-docs.github.io/zh-tw/reference/api/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/reference/api/</guid><description>&lt;p&gt;你可以把 Hugo 開發理解成 Hugo 語言，他封裝了 Go 語言的功能提供給模板使用，並且自行解析模板、reflect 變數，可以說是自成一家的語言了。Go 語言的功能僅有有限的提供，因此即使你熟悉 Go/Go template，使用 Hugo 還是得看文檔才會使用。&lt;/p&gt;</description></item><item><title>建立主題</title><link>https://hugo-community-docs.github.io/zh-tw/tutorial/build-a-theme/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/tutorial/build-a-theme/</guid><description>&lt;p&gt;這篇文章帶你從零建立主題，做中學更快理解，你說對吧。&lt;/p&gt;
&lt;h2 id="建立專案"&gt;
	建立專案
	&lt;a class="heading-anchor" href="#%e5%bb%ba%e7%ab%8b%e5%b0%88%e6%a1%88" aria-label="Permalink to '建立專案'"&gt;&lt;/a&gt;
&lt;/h2&gt;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;hugo new project my-blog --format&lt;span class="o"&gt;=&lt;/span&gt;yaml
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; my-blog&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h2 id="css-樣式表"&gt;
	CSS 樣式表
	&lt;a class="heading-anchor" href="#css-%e6%a8%a3%e5%bc%8f%e8%a1%a8" aria-label="Permalink to 'CSS 樣式表'"&gt;&lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;先把樣式準備好，CSS 和模板無關，這裡直接複製一個簡易範本到 &lt;code&gt;assets/css/main.css&lt;/code&gt; 即可。&lt;/p&gt;</description></item><item><title>輸出格式</title><link>https://hugo-community-docs.github.io/zh-tw/docs/concept/output-formats/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/docs/concept/output-formats/</guid><description>&lt;p&gt;Hugo 支援一個頁面可以同時擁有多種輸出格式，此功能透過 &lt;a href="https://gohugo.io/configuration/output-formats/"&gt;output formats&lt;/a&gt; 進行設定。&lt;/p&gt;</description></item><item><title>CLI 索引</title><link>https://hugo-community-docs.github.io/zh-tw/reference/cli/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/reference/cli/</guid><description>&lt;p&gt;以下索引整理自 &lt;a href="https://gohugo.io"&gt;Hugo 官方文檔&lt;/a&gt;，本站不重複撰寫這些內容，直接連回官方頁面查閱即可。&lt;/p&gt;</description></item><item><title>FAQ</title><link>https://hugo-community-docs.github.io/zh-tw/docs/faq/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugo-community-docs.github.io/zh-tw/docs/faq/</guid><description>&lt;h2 id="連結檢查"&gt;
	連結檢查
	&lt;a class="heading-anchor" href="#%e9%80%a3%e7%b5%90%e6%aa%a2%e6%9f%a5" aria-label="Permalink to '連結檢查'"&gt;&lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;可以整合外部工具連結正確性，如 &lt;a href="https://github.com/rvben/rumdl"&gt;rumdl&lt;/a&gt; &lt;a href="https://rumdl.dev/md057/"&gt;MD057&lt;/a&gt; 規則支援 Markdown 連結以及資產，以及絕對連結偵測和補全。&lt;/p&gt;</description></item></channel></rss>