mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-14 20:37:55 -05:00
ec4e6f9df2
git-subtree-dir: docs git-subtree-split: f887bd7b4e3e7c7e76cd63951e5b0d37d8fe0ac7
1.8 KiB
1.8 KiB
title | description | godocref | workson | date | publishdate | lastmod | categories | menu | signature | workson | hugoversion | relatedfuncs | deprecated | aliases | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dict | Creates a dictionary from a list of key and value pairs. | 2017-02-01 | 2017-02-01 | 2017-02-26 |
|
|
|
false |
dict
is especially useful for passing more than one value to a partial template.
Example: dict
with Embedded SVGs
The partial below creates a SVG and expects fill
height
and width
from the caller:
{{< code file="layouts/partials/svgs/external-links.svg" download="external-links.svg" >}} {{< /code >}}
These values can be stored in one object with dict
and passed to the partial:
{{< code file="layouts/_default/list.html" >}} {{ partial "svg/link-ext.svg" (dict "fill" "#01589B" "size" 10 "width" 20 ) }} {{< /code >}}