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>
|
<span class="item-title">{{ or .Title .Id | raw }}</span>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{ define "content" -}}
|
{{ define "item" -}}
|
||||||
<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 }}
|
|
||||||
<article id="{{ .Source }}-{{ .Id }}">
|
<article id="{{ .Source }}-{{ .Id }}">
|
||||||
|
|
||||||
{{/* The item title is a clickable <summary> if there is body content */}}
|
{{/* The item title is a clickable <summary> if there is body content */}}
|
||||||
@ -57,7 +48,20 @@
|
|||||||
|
|
||||||
</article>
|
</article>
|
||||||
{{ end }}
|
{{ 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">
|
<article class="center">
|
||||||
<button>Deactivate All</button>
|
<button>Deactivate All</button>
|
||||||
|
Loading…
Reference in New Issue
Block a user