使用 with 改變目前 Context
我們可使用 with 改變目前的 Context,並以 . 加以讀取。
我們可使用 with 改變目前的 Context,並以 . 加以讀取。
我們可使用 | operator 將多個 Function 組合起來實現 Function Pipeline。
我們可使用 := 在 Go template 內定義變數,並使用 = 改變變數。
Hugo 的 Template 使用 Go Template 語言,可將在 Markdown 的資料綁定到 HTML。
我們可在 Go template 內使用 if else 處理 Truthy Value 或 Falsy Value。
Go template 的 . 有 Context 概念,本文解釋為什麼 . 可以存取 Page Object 與 Site Object。
Hugo 有一些參數特別適合 編譯 時使用,但由於參數太多,可將其統一寫在 Bash Script 內,再由 NPM Script 呼叫。
Hugo 有一些參數特別適合 開發 時使用,但由於參數太多,可將其統一寫在 Bash Script 內,再由 NPM Script 呼叫。
儘管每年都有新的 SSG 問世,但 Hugo 仍然是很多人的首選,本文分析 Hugo 的優缺點,可視每個人的需求決定適不適合 Hugo。
Go 並沒有內建 filter(),但 Hugo 則提供 where() 類似 filter() 功能。