src/components/link-list
// src/components/link-list/schema.json
{
"$schema": "http://json-schema.org/draft-07/schema",
"required": [
"headlineType",
"links",
"title"
],
"properties": {
"headlineType": {
"type": "string"
},
"links": {
"type": "array"
},
"title": {
"type": "string"
}
}
}
// src/components/link-list/mocks.json
{
"title": "Developed by…",
"headlineType": "3",
"links": [
{
"$tpl": "components/link",
"label": "mgrossklaus.de",
"url": "https://mgrossklaus.de"
},
{
"$tpl": "components/link",
"label": "twitter.com/mgrossklaus",
"url": "https://twitter.com/mgrossklaus"
},
{
"$tpl": "components/link",
"label": "github.com/mgrsskls",
"url": "https://github.com/mgrsskls"
}
]
}
// src/components/link-list/index.hbs
<div class="LinkList">
<h{{headlineType}} class="LinkList-title">{{title}}</h{{headlineType}}>
<ul class="LinkList-list">
{{#each links}}
<li class="LinkList-item">
{{{this}}}
</li>
{{/each}}
</ul>
</div>
default mock data
{
"title": "Developed by…",
"headlineType": "3",
"links": [
{
"$tpl": "components/link",
"label": "mgrossklaus.de",
"url": "https://mgrossklaus.de"
},
{
"$tpl": "components/link",
"label": "twitter.com/mgrossklaus",
"url": "https://twitter.com/mgrossklaus"
},
{
"$tpl": "components/link",
"label": "github.com/mgrsskls",
"url": "https://github.com/mgrsskls"
}
]
}