使用 with 改變目前 Context
我們可使用 with 改變目前的 Context,並以 . 加以讀取。
我們可使用 with 改變目前的 Context,並以 . 加以讀取。
我們可使用 := 在 Go template 內定義變數,並使用 = 改變變數。
Hugo 的 Template 使用 Go Template 語言,可將在 Markdown 的資料綁定到 HTML。
我們可在 Go template 內使用 if else 處理 Truthy Value 或 Falsy Value。
Go template 的 . 有 Context 概念,本文解釋為什麼 . 可以存取 Page Object 與 Site Object。