Refactor item into a template
This commit is contained in:
parent
c49b6c9088
commit
1057b54b3d
@ -11,16 +11,7 @@
|
||||
<span class="item-title">{{ or .Title .Id | raw }}</span>
|
||||
{{- end }}
|
||||
|
||||
{{ define "content" -}}
|
||||
<article class="center">
|
||||
<span class="item-title">
|
||||
<a href="#">Home</a>
|
||||
[<a href="#">Active</a> | <a href="#">All</a>]
|
||||
</span>
|
||||
</article>
|
||||
|
||||
{{ if .Items }}
|
||||
{{ range .Items }}
|
||||
{{ define "item" -}}
|
||||
<article id="{{ .Source }}-{{ .Id }}">
|
||||
|
||||
{{/* The item title is a clickable <summary> if there is body content */}}
|
||||
@ -57,7 +48,20 @@
|
||||
|
||||
</article>
|
||||
{{ end }}
|
||||
{{/* end range .Items */}}
|
||||
{{/* end define "item" */}}
|
||||
|
||||
{{ define "content" -}}
|
||||
<article class="center">
|
||||
<span class="item-title">
|
||||
<a href="#">Home</a>
|
||||
[<a href="#">Active</a> | <a href="#">All</a>]
|
||||
</span>
|
||||
</article>
|
||||
|
||||
{{ if .Items }}
|
||||
{{ range .Items }}
|
||||
{{ template "item" . }}
|
||||
{{ end }}
|
||||
|
||||
<article class="center">
|
||||
<button>Deactivate All</button>
|
||||
|
Loading…
Reference in New Issue
Block a user