cupper-hugo-theme/themes/inclusive-pattern-docs/layouts/shortcodes/principles.html
2017-06-15 16:41:44 +08:00

17 lines
591 B
HTML

{{ $JSON := $.Site.Data.principles }}
{{ $included := .Get "include" }}
{{ $included := apply (split $included ", ") "lower" "." }}
{{ $descriptions := .Get "descriptions" }}
<ul class="principles {{ if $descriptions }}with-desc{{ end }}">
{{ range $JSON.principles }}
{{ if in $included (lower .title) }}
<li>
<strong><a href="https://inclusivedesignprinciples.org#{{ .title | urlize }}">{{ .title }}</a>:</strong> <em>{{ .strapline }}</em>
{{ if $descriptions }}
<p>{{ .description }}</p>
{{ end }}
</li>
{{ end }}
{{ end }}
</ul>