{{- /* Lifecycle phases. One phase per line: Label | cadence | detail | optional-spec-slug Return paths: loop | Trigger | Label of the phase it returns to */ -}} {{- $phases := slice -}} {{- $loops := slice -}} {{- range split (trim .Inner "\n") "\n" -}} {{- $line := trim . " \t\r" -}} {{- if $line -}} {{- $p := slice -}} {{- range split $line "|" }}{{ $p = $p | append (trim . " ") }}{{ end -}} {{- if eq (index $p 0) "loop" -}} {{- $loops = $loops | append (dict "trigger" (index $p 1) "target" (index $p 2)) -}} {{- else -}} {{- $phases = $phases | append (dict "label" (index $p 0) "cadence" (cond (gt (len $p) 1) (index $p 1) "") "detail" (cond (gt (len $p) 2) (index $p 2) "") "spec" (cond (gt (len $p) 3) (index $p 3) "")) -}} {{- end -}} {{- end -}} {{- end -}} {{- $n := len $phases -}}
{{ with .Get 0 }}
Lifecycle{{ . }}
{{ end }}
    {{- range $i, $ph := $phases }} {{- $target := false }}{{ with $ph.spec }}{{ $target = site.GetPage (printf "/specs/%s" .) }}{{ end }}
  1. {{ with $ph.cadence }}{{ . }}{{ end }} {{- with $target }}{{ $ph.label | $.Page.RenderString }}{{ else }}{{ $ph.label | $.Page.RenderString }}{{ end -}} {{ with $ph.detail }}{{ . | $.Page.RenderString }}{{ end }}
  2. {{- end }}
{{ with $loops }} {{- $w := mul $n 100 }} {{ end }}