Metadata
Provides a simple way to mark up key/value information provided by a Twig hash or JSON object.
Example usage
{{
html.metadata({
'items': {
'File': 'true_lies.avi',
'Size': '1.2 Gb',
'Type': 'Video'
}
})
}}
See the Pen JYGvOg by Paul Stanton (@stanton) on CodePen.
Options
Option | Type | Description |
---|---|---|
class | string | CSS classes, space separated |
id | string | A unique identifier, if required |
items | hash | A hash of data where key: value = title: description |
data-* | string | Data attributes, eg: 'data-foo': 'bar' |
Bordered variation
{# an example of passing data via a Twig hash #}
{%
set data = {
"File" : "true_lies.avi",
"Size" : "1.2Gb",
"Type" : "Video"
}
%}
{{
html.metadata({
'items': data,
'class': 'metadata--bordered'
})
}}
See the Pen Metadata bordered by Paul Stanton (@stanton) on CodePen.